aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/LLVMContext.h
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
commit4afa12890f679034e9741a687a6ce33f2846f129 (patch)
tree57398005e91e5946ee1878c8322d3c1f25aaeba6 /include/llvm/LLVMContext.h
parent3f409f7fefea4d4191a914b528afe16fd7d0b4d9 (diff)
downloadexternal_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 'include/llvm/LLVMContext.h')
-rw-r--r--include/llvm/LLVMContext.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h
index e5b7777..3502ff7 100644
--- a/include/llvm/LLVMContext.h
+++ b/include/llvm/LLVMContext.h
@@ -21,6 +21,7 @@ class LLVMContextImpl;
class StringRef;
class Instruction;
class Module;
+class SMDiagnostic;
template <typename T> class SmallVectorImpl;
/// This is an important class for using LLVM in a threaded context. It
@@ -49,18 +50,23 @@ public:
/// custom metadata IDs registered in this LLVMContext.
void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
+
+ typedef void (*InlineAsmDiagHandlerTy)(const SMDiagnostic&, void *Context,
+ unsigned LocCookie);
+
/// 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.
+ /// argument is a function pointer and the second is a context pointer that
+ /// gets passed into the DiagHandler.
///
- /// LLVMContext doesn't take ownership or interpreter either of these
+ /// LLVMContext doesn't take ownership or interpret either of these
/// pointers.
- void setInlineAsmDiagnosticHandler(void *DiagHandler, void *DiagContext = 0);
+ void setInlineAsmDiagnosticHandler(InlineAsmDiagHandlerTy DiagHandler,
+ void *DiagContext = 0);
/// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by
/// setInlineAsmDiagnosticHandler.
- void *getInlineAsmDiagnosticHandler() const;
+ InlineAsmDiagHandlerTy getInlineAsmDiagnosticHandler() const;
/// getInlineAsmDiagnosticContext - Return the diagnostic context set by
/// setInlineAsmDiagnosticHandler.