[llvm-branch-commits] [llvm-branch] r101507 - in /llvm/branches/Apple/Morbo: include/llvm/LLVMContext.h lib/VMCore/LLVMContext.cpp lib/VMCore/LLVMContextImpl.cpp lib/VMCore/LLVMContextImpl.h
Daniel Dunbar
daniel at zuster.org
Fri Apr 16 11:33:32 PDT 2010
Author: ddunbar
Date: Fri Apr 16 13:33:31 2010
New Revision: 101507
URL: http://llvm.org/viewvc/llvm-project?rev=101507&view=rev
Log:
give LLVMContext an inline asm diagnostic hook member.
Modified:
llvm/branches/Apple/Morbo/include/llvm/LLVMContext.h
llvm/branches/Apple/Morbo/lib/VMCore/LLVMContext.cpp
llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.cpp
llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.h
Modified: llvm/branches/Apple/Morbo/include/llvm/LLVMContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/include/llvm/LLVMContext.h?rev=101507&r1=101506&r2=101507&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/include/llvm/LLVMContext.h (original)
+++ llvm/branches/Apple/Morbo/include/llvm/LLVMContext.h Fri Apr 16 13:33:31 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/branches/Apple/Morbo/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/VMCore/LLVMContext.cpp?rev=101507&r1=101506&r2=101507&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/VMCore/LLVMContext.cpp Fri Apr 16 13:33:31 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/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.cpp?rev=101507&r1=101506&r2=101507&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.cpp Fri Apr 16 13:33:31 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/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.h?rev=101507&r1=101506&r2=101507&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/branches/Apple/Morbo/lib/VMCore/LLVMContextImpl.h Fri Apr 16 13:33:31 2010
@@ -117,6 +117,8 @@
class LLVMContextImpl {
public:
+ void *InlineAsmDiagHandler, *InlineAsmDiagContext;
+
typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*,
DenseMapAPIntKeyInfo> IntMapTy;
IntMapTy IntConstants;
More information about the llvm-branch-commits
mailing list