Skip to content

DIBuilder Bindings #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require("bindings")("llvm-node.node");
module.exports = require("bindings")("llvm-node.node");
107 changes: 107 additions & 0 deletions llvm-node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,113 @@ declare namespace llvm {
private constructor();
}

class DIBasicType extends DIType {
readonly isSigned: bool;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No such method exists on DIBasicType (llvm-node is only a thin wrapper around llvm methods).

I assume it's a simplification for getSignedness. I would prefer exposing the enum and making the return type optional


private constructor();
}

class DIBuilder {
constructor(module: Module);

createCompileUnit(language: dwarf.SourceLanguage, file: DIFile, producer: string, isOptimized: boolean, flags?: string, runtimeVersion?: number): DICompileUnit;

createFile(filename: string, directory: string): DIFile;

createBasicType(name: string, sizeInBits: number, encoding: dwarf.AttributeEncoding): DIBasicType;

createSubroutineType(parameterTypes: DIType[]): DISubroutineType;

finalize();
}

class DICompileUnit {
private constructor();
}

class DIFile {
readonly filename: string;
readonly directory: string;
readonly name: string;

private constructor();
}

class DISubroutineType extends DIType {
getTypes(): DIType[];

private constructor();
}

class DIType extends DIScope {
readonly line: number;

private constructor();
}

namespace dwarf {
enum SourceLanguage {
C89,
C,
Ada83,
C_plus_plus,
Cobol74,
Cobol85,
Fortran77,
Fortran90,
Pascal83,
Modula2,
Java,
C99,
Ada95,
Fortran95,
PLI,
ObjC,
ObjC_plus_plus,
UPC,
D,
Python,
OpenCL,
Go,
Modula3,
Haskell,
C_plus_plus_03,
C_plus_plus_11,
OCaml,
Rust,
C11,
Swift,
Julia,
Dylan,
C_plus_plus_14,
Fortran03,
Fortran08,
RenderScript,
BLISS
}

enum AttributeEncoding {
address,
boolean,
complex_float,
float,
signed,
signed_char,
unsigned,
unsigned_char,
imaginary_float,
packed_decimal,
numeric_string,
edited,
signed_fixed,
unsigned_fixed,
decimal_float,
UTF,
UCS,
ASCII
}
}

class Function extends Constant {
static create(functionType: FunctionType, linkageTypes: LinkageTypes, name?: string, module?: Module): Function;

Expand Down
Loading