[llvm-commits] [llvm] r100506 - in /llvm/trunk: include/llvm/LLVMContext.h lib/VMCore/LLVMContext.cpp lib/VMCore/LLVMContextImpl.cpp lib/VMCore/LLVMContextImpl.h
Chris Lattner
sabre at nondot.org
Mon Apr 5 17:44:45 PDT 2010
Author: lattner
Date: Mon Apr 5 19:44:45 2010
New Revision: 100506
URL: http://llvm.org/viewvc/llvm-project?rev=100506&view=rev
Log:
give LLVMContext an inline asm diagnostic hook member.
Modified:
llvm/trunk/include/llvm/LLVMContext.h
llvm/trunk/lib/VMCore/LLVMContext.cpp
llvm/trunk/lib/VMCore/LLVMContextImpl.cpp
llvm/trunk/lib/VMCore/LLVMContextImpl.h
Modified: llvm/trunk/include/llvm/LLVMContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LLVMContext.h?rev=100506&r1=100505&r2=100506&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LLVMContext.h (original)
+++ llvm/trunk/include/llvm/LLVMContext.h Mon Apr 5 19:44:45 2010
@@ -50,6 +50,24 @@
/// custom metadata IDs registered in this LLVMContext. ID #0 is not used,
/// so it is filled in as an empty string.
void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
+
+ /// setInlineAsmDiagnosticHandler - This method sets a handler that is invoked
+ /// when problems with inline asm are detected by the backend. The first
+ /// argument is a function pointer (of type SourceMgr::DiagHandlerTy) and the
+ /// second is a context pointer that gets passed into the DiagHandler.
+ ///
+ /// LLVMContext doesn't take ownership or interpreter either of these
+ /// pointers.
+ void setInlineAsmDiagnosticHandler(void *DiagHandler, void *DiagContext = 0);
+
+ /// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by
+ /// setInlineAsmDiagnosticHandler.
+ void *getInlineAsmDiagnosticHandler() const;
+
+ /// getInlineAsmDiagnosticContext - Return the diagnostic context set by
+ /// setInlineAsmDiagnosticHandler.
+ void *getInlineAsmDiagnosticContext() const;
+
};
/// getGlobalContext - Returns a global context. This is for LLVM clients that
Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=100506&r1=100505&r2=100506&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContext.cpp Mon Apr 5 19:44:45 2010
@@ -33,6 +33,23 @@
}
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 @@
// MD Handlers are numbered from 1.
Names[I->second] = I->first();
}
-
-
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.cpp?rev=100506&r1=100505&r2=100506&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.cpp Mon Apr 5 19:44:45 2010
@@ -30,6 +30,9 @@
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);
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.h?rev=100506&r1=100505&r2=100506&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Mon Apr 5 19:44:45 2010
@@ -115,6 +115,8 @@
class LLVMContextImpl {
public:
+ void *InlineAsmDiagHandler, *InlineAsmDiagContext;
+
typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*,
DenseMapAPIntKeyInfo> IntMapTy;
IntMapTy IntConstants;
More information about the llvm-commits
mailing list