summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/LLVMContext.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-17 08:13:01 +0000
committerChris Lattner <sabre@nondot.org>2010-11-17 08:13:01 +0000
commitb0e36085c437c71f126680b6fa38d6fc112f6471 (patch)
tree7f3b1297964a6642caca8de054acb09fa649671c /llvm/lib/VMCore/LLVMContext.cpp
parentc03d04ee1f032dafc99e2aebbfde80f68f876797 (diff)
downloadbcm5719-llvm-b0e36085c437c71f126680b6fa38d6fc112f6471.tar.gz
bcm5719-llvm-b0e36085c437c71f126680b6fa38d6fc112f6471.zip
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. llvm-svn: 119486
Diffstat (limited to 'llvm/lib/VMCore/LLVMContext.cpp')
-rw-r--r--llvm/lib/VMCore/LLVMContext.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/LLVMContext.cpp b/llvm/lib/VMCore/LLVMContext.cpp
index 15ae0ec5d5a..41806999ba5 100644
--- a/llvm/lib/VMCore/LLVMContext.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud