diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 19 | ||||
-rw-r--r-- | lib/VMCore/LLVMContextImpl.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 2 |
3 files changed, 22 insertions, 2 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index 2a870ec6cf..3244f2842c 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -33,6 +33,23 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { } LLVMContext::~LLVMContext() { delete pImpl; } +void LLVMContext::setInlineAsmDiagnosticHandler(void *DiagHandler, + void *DiagContext) { + pImpl->InlineAsmDiagHandler = DiagHandler; + pImpl->InlineAsmDiagContext = DiagContext; +} + +/// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by +/// setInlineAsmDiagnosticHandler. +void *LLVMContext::getInlineAsmDiagnosticHandler() const { + return pImpl->InlineAsmDiagHandler; +} + +/// getInlineAsmDiagnosticContext - Return the diagnostic context set by +/// setInlineAsmDiagnosticHandler. +void *LLVMContext::getInlineAsmDiagnosticContext() const { + return pImpl->InlineAsmDiagContext; +} #ifndef NDEBUG /// isValidName - Return true if Name is a valid custom metadata handler name. @@ -73,5 +90,3 @@ void LLVMContext::getMDKindNames(SmallVectorImpl<StringRef> &Names) const { // MD Handlers are numbered from 1. Names[I->second] = I->first(); } - - diff --git a/lib/VMCore/LLVMContextImpl.cpp b/lib/VMCore/LLVMContextImpl.cpp index b4553ddc1b..e71157f440 100644 --- a/lib/VMCore/LLVMContextImpl.cpp +++ b/lib/VMCore/LLVMContextImpl.cpp @@ -30,6 +30,9 @@ LLVMContextImpl::LLVMContextImpl(LLVMContext &C) Int32Ty(C, 32), Int64Ty(C, 64), AlwaysOpaqueTy(new OpaqueType(C)) { + InlineAsmDiagHandler = 0; + InlineAsmDiagContext = 0; + // Make sure the AlwaysOpaqueTy stays alive as long as the Context. AlwaysOpaqueTy->addRef(); OpaqueTypes.insert(AlwaysOpaqueTy); diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index d4ebf8044d..4876f5d507 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -115,6 +115,8 @@ public: class LLVMContextImpl { public: + void *InlineAsmDiagHandler, *InlineAsmDiagContext; + typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*, DenseMapAPIntKeyInfo> IntMapTy; IntMapTy IntConstants; |