diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-17 08:13:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-17 08:13:01 +0000 |
commit | 4afa12890f679034e9741a687a6ce33f2846f129 (patch) | |
tree | 57398005e91e5946ee1878c8322d3c1f25aaeba6 /lib/VMCore | |
parent | 3f409f7fefea4d4191a914b528afe16fd7d0b4d9 (diff) | |
download | external_llvm-4afa12890f679034e9741a687a6ce33f2846f129.zip external_llvm-4afa12890f679034e9741a687a6ce33f2846f129.tar.gz external_llvm-4afa12890f679034e9741a687a6ce33f2846f129.tar.bz2 |
now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
cookie argument to the SourceMgr diagnostic stuff. This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling
definition, increasing type safety and cleaning things up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 11 | ||||
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index 15ae0ec..4180699 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -53,15 +53,17 @@ void LLVMContext::removeModule(Module *M) { // Recoverable Backend Errors //===----------------------------------------------------------------------===// -void LLVMContext::setInlineAsmDiagnosticHandler(void *DiagHandler, - void *DiagContext) { +void LLVMContext:: +setInlineAsmDiagnosticHandler(InlineAsmDiagHandlerTy DiagHandler, + void *DiagContext) { pImpl->InlineAsmDiagHandler = DiagHandler; pImpl->InlineAsmDiagContext = DiagContext; } /// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by /// setInlineAsmDiagnosticHandler. -void *LLVMContext::getInlineAsmDiagnosticHandler() const { +LLVMContext::InlineAsmDiagHandlerTy +LLVMContext::getInlineAsmDiagnosticHandler() const { return pImpl->InlineAsmDiagHandler; } @@ -95,8 +97,7 @@ void LLVMContext::emitError(unsigned LocCookie, StringRef ErrorStr) { // If we do have an error handler, we can report the error and keep going. SMDiagnostic Diag("", "error: " + ErrorStr.str()); - ((SourceMgr::DiagHandlerTy)(intptr_t)pImpl->InlineAsmDiagHandler) - (Diag, pImpl->InlineAsmDiagContext, LocCookie); + pImpl->InlineAsmDiagHandler(Diag, pImpl->InlineAsmDiagContext, LocCookie); } diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index faeebb6..23971aa 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -119,7 +119,8 @@ public: /// will be automatically deleted if this context is deleted. SmallPtrSet<Module*, 4> OwnedModules; - void *InlineAsmDiagHandler, *InlineAsmDiagContext; + LLVMContext::InlineAsmDiagHandlerTy InlineAsmDiagHandler; + void *InlineAsmDiagContext; typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*, DenseMapAPIntKeyInfo> IntMapTy; |