-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IR): add some classes and methods related to debug information
- Loading branch information
Showing
73 changed files
with
1,732 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DIBasicType : public Napi::ObjectWrap<DIBasicType> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DIBasicType *type); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DIBasicType *Extract(const Napi::Value &value); | ||
|
||
explicit DIBasicType(const Napi::CallbackInfo &info); | ||
|
||
llvm::DIBasicType *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DIBasicType *type = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DIBuilder.h> | ||
|
||
class DIBuilder : public Napi::ObjectWrap<DIBuilder> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DIBuilder *builder); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DIBuilder *Extract(const Napi::Value &value); | ||
|
||
explicit DIBuilder(const Napi::CallbackInfo &info); | ||
|
||
llvm::DIBuilder *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DIBuilder *builder = nullptr; | ||
|
||
Napi::Value createFile(const Napi::CallbackInfo &info); | ||
|
||
Napi::Value createCompileUnit(const Napi::CallbackInfo &info); | ||
|
||
Napi::Value createFunction(const Napi::CallbackInfo &info); | ||
|
||
Napi::Value createBasicType(const Napi::CallbackInfo &info); | ||
|
||
Napi::Value getOrCreateTypeArray(const Napi::CallbackInfo &info); | ||
|
||
Napi::Value createSubroutineType(const Napi::CallbackInfo &info); | ||
|
||
// Napi::Value createGlobalVariableExpression(const Napi::CallbackInfo &info); | ||
// | ||
// Napi::Value insertDbgValueIntrinsic(const Napi::CallbackInfo &info); | ||
|
||
void finalizeSubprogram(const Napi::CallbackInfo &info); | ||
|
||
void finalize(const Napi::CallbackInfo &info); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DICompileUnit : public Napi::ObjectWrap<DICompileUnit> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DICompileUnit *unit); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DICompileUnit *Extract(const Napi::Value &value); | ||
|
||
explicit DICompileUnit(const Napi::CallbackInfo &info); | ||
|
||
llvm::DICompileUnit *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DICompileUnit *unit = nullptr; | ||
|
||
Napi::Value getFile(const Napi::CallbackInfo &info); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DIFile : public Napi::ObjectWrap<DIFile> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DIFile *file); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DIFile *Extract(const Napi::Value &value); | ||
|
||
explicit DIFile(const Napi::CallbackInfo &info); | ||
|
||
llvm::DIFile *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DIFile *file = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DILocalScope : public Napi::ObjectWrap<DILocalScope> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DILocalScope *scope); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DILocalScope *Extract(const Napi::Value &value); | ||
|
||
explicit DILocalScope(const Napi::CallbackInfo &info); | ||
|
||
llvm::DILocalScope *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DILocalScope *scope = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DILocation : public Napi::ObjectWrap<DILocation> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DILocation *location); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DILocation *Extract(const Napi::Value &value); | ||
|
||
explicit DILocation(const Napi::CallbackInfo &info); | ||
|
||
llvm::DILocation *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DILocation *location = nullptr; | ||
|
||
static Napi::Value get(const Napi::CallbackInfo &info); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DINode : public Napi::ObjectWrap<DINode> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DINode *node); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DINode *Extract(const Napi::Value &value); | ||
|
||
explicit DINode(const Napi::CallbackInfo &info); | ||
|
||
llvm::DINode *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DINode *node = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DIScope : public Napi::ObjectWrap<DIScope> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DIScope *scope); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DIScope *Extract(const Napi::Value &value); | ||
|
||
explicit DIScope(const Napi::CallbackInfo &info); | ||
|
||
llvm::DIScope *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DIScope *scope = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DISubprogram : public Napi::ObjectWrap<DISubprogram> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DISubprogram *subProgram); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DISubprogram *Extract(const Napi::Value &value); | ||
|
||
explicit DISubprogram(const Napi::CallbackInfo &info); | ||
|
||
llvm::DISubprogram *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DISubprogram *subprogram = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DISubroutineType : public Napi::ObjectWrap<DISubroutineType> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DISubroutineType *type); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DISubroutineType *Extract(const Napi::Value &value); | ||
|
||
explicit DISubroutineType(const Napi::CallbackInfo &info); | ||
|
||
llvm::DISubroutineType *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DISubroutineType *type = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DIType : public Napi::ObjectWrap<DIType> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DIType *type); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DIType *Extract(const Napi::Value &value); | ||
|
||
explicit DIType(const Napi::CallbackInfo &info); | ||
|
||
llvm::DIType *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DIType *type = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugInfoMetadata.h> | ||
|
||
class DITypeRefArray : public Napi::ObjectWrap<DITypeRefArray> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DITypeRefArray *array); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DITypeRefArray *Extract(const Napi::Value &value); | ||
|
||
explicit DITypeRefArray(const Napi::CallbackInfo &info); | ||
|
||
llvm::DITypeRefArray *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DITypeRefArray *array = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <napi.h> | ||
#include <llvm/IR/DebugLoc.h> | ||
|
||
class DebugLoc : public Napi::ObjectWrap<DebugLoc> { | ||
public: | ||
static inline Napi::FunctionReference constructor; // NOLINT | ||
|
||
static void Init(Napi::Env env, Napi::Object &exports); | ||
|
||
static Napi::Value New(Napi::Env env, llvm::DebugLoc *location); | ||
|
||
static bool IsClassOf(const Napi::Value &value); | ||
|
||
static llvm::DebugLoc *Extract(const Napi::Value &value); | ||
|
||
explicit DebugLoc(const Napi::CallbackInfo &info); | ||
|
||
llvm::DebugLoc *getLLVMPrimitive(); | ||
|
||
private: | ||
llvm::DebugLoc *location = nullptr; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.