summaryrefslogtreecommitdiff
path: root/clang/lib/AST/Interp/Program.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Interp/Program.h')
-rw-r--r--clang/lib/AST/Interp/Program.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/Interp/Program.h b/clang/lib/AST/Interp/Program.h
index 5f0012db9b3f..c81ec777a5fe 100644
--- a/clang/lib/AST/Interp/Program.h
+++ b/clang/lib/AST/Interp/Program.h
@@ -44,6 +44,12 @@ class Program {
public:
Program(Context &Ctx) : Ctx(Ctx) {}
+ /// Marshals a native pointer to an ID for embedding in bytecode.
+ unsigned getOrCreateNativePointer(const void *Ptr);
+
+ /// Returns the value of a marshalled native pointer.
+ const void *getNativePointer(unsigned Idx);
+
/// Emits a string literal among global data.
unsigned createGlobalString(const StringLiteral *S);
@@ -143,6 +149,11 @@ private:
/// Function relocation locations.
llvm::DenseMap<const FunctionDecl *, std::vector<unsigned>> Relocs;
+ /// Native pointers referenced by bytecode.
+ std::vector<const void *> NativePointers;
+ /// Cached native pointer indices.
+ llvm::DenseMap<const void *, unsigned> NativePointerIndices;
+
/// Custom allocator for global storage.
using PoolAllocTy = llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator>;