llvm.org GIT mirror llvm / 42a4ee0
give LLVMContext an inline asm diagnostic hook member. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100506 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
4 changed file(s) with 40 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
4949 /// custom metadata IDs registered in this LLVMContext. ID #0 is not used,
5050 /// so it is filled in as an empty string.
5151 void getMDKindNames(SmallVectorImpl &Result) const;
52
53 /// setInlineAsmDiagnosticHandler - This method sets a handler that is invoked
54 /// when problems with inline asm are detected by the backend. The first
55 /// argument is a function pointer (of type SourceMgr::DiagHandlerTy) and the
56 /// second is a context pointer that gets passed into the DiagHandler.
57 ///
58 /// LLVMContext doesn't take ownership or interpreter either of these
59 /// pointers.
60 void setInlineAsmDiagnosticHandler(void *DiagHandler, void *DiagContext = 0);
61
62 /// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by
63 /// setInlineAsmDiagnosticHandler.
64 void *getInlineAsmDiagnosticHandler() const;
65
66 /// getInlineAsmDiagnosticContext - Return the diagnostic context set by
67 /// setInlineAsmDiagnosticHandler.
68 void *getInlineAsmDiagnosticContext() const;
69
5270 };
5371
5472 /// getGlobalContext - Returns a global context. This is for LLVM clients that
3232 }
3333 LLVMContext::~LLVMContext() { delete pImpl; }
3434
35 void LLVMContext::setInlineAsmDiagnosticHandler(void *DiagHandler,
36 void *DiagContext) {
37 pImpl->InlineAsmDiagHandler = DiagHandler;
38 pImpl->InlineAsmDiagContext = DiagContext;
39 }
40
41 /// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by
42 /// setInlineAsmDiagnosticHandler.
43 void *LLVMContext::getInlineAsmDiagnosticHandler() const {
44 return pImpl->InlineAsmDiagHandler;
45 }
46
47 /// getInlineAsmDiagnosticContext - Return the diagnostic context set by
48 /// setInlineAsmDiagnosticHandler.
49 void *LLVMContext::getInlineAsmDiagnosticContext() const {
50 return pImpl->InlineAsmDiagContext;
51 }
3552
3653 #ifndef NDEBUG
3754 /// isValidName - Return true if Name is a valid custom metadata handler name.
7289 // MD Handlers are numbered from 1.
7390 Names[I->second] = I->first();
7491 }
75
76
2929 Int32Ty(C, 32),
3030 Int64Ty(C, 64),
3131 AlwaysOpaqueTy(new OpaqueType(C)) {
32 InlineAsmDiagHandler = 0;
33 InlineAsmDiagContext = 0;
34
3235 // Make sure the AlwaysOpaqueTy stays alive as long as the Context.
3336 AlwaysOpaqueTy->addRef();
3437 OpaqueTypes.insert(AlwaysOpaqueTy);
114114
115115 class LLVMContextImpl {
116116 public:
117 void *InlineAsmDiagHandler, *InlineAsmDiagContext;
118
117119 typedef DenseMap
118120 DenseMapAPIntKeyInfo> IntMapTy;
119121 IntMapTy IntConstants;