diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-06 00:33:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-06 00:33:43 +0000 |
commit | 214aa8a2cf0c407e87d36a4ed2e36468d052669d (patch) | |
tree | e60e98e9856f8e35cc9dbfc4a7d451b3885c7425 /include/llvm/Support | |
parent | 8f0f480a10cd5b62914fd53611e696c5069fc62d (diff) | |
download | external_llvm-214aa8a2cf0c407e87d36a4ed2e36468d052669d.zip external_llvm-214aa8a2cf0c407e87d36a4ed2e36468d052669d.tar.gz external_llvm-214aa8a2cf0c407e87d36a4ed2e36468d052669d.tar.bz2 |
give the SourceMgr object a cookie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/SourceMgr.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index caa67c0..3e66762 100644 --- a/include/llvm/Support/SourceMgr.h +++ b/include/llvm/Support/SourceMgr.h @@ -35,7 +35,8 @@ public: /// DiagHandlerTy - Clients that want to handle their own diagnostics in a /// custom way can register a function pointer+context as a diagnostic /// handler. It gets called each time PrintMessage is invoked. - typedef void (*DiagHandlerTy)(const SMDiagnostic&, void *Context); + typedef void (*DiagHandlerTy)(const SMDiagnostic&, void *Context, + unsigned LocCookie); private: struct SrcBuffer { /// Buffer - The memory buffer for the file. @@ -59,6 +60,7 @@ private: DiagHandlerTy DiagHandler; void *DiagContext; + unsigned DiagLocCookie; SourceMgr(const SourceMgr&); // DO NOT IMPLEMENT void operator=(const SourceMgr&); // DO NOT IMPLEMENT @@ -71,10 +73,12 @@ public: } /// setDiagHandler - Specify a diagnostic handler to be invoked every time - /// PrintMessage is called. - void setDiagHandler(DiagHandlerTy DH, void *Ctx = 0) { + /// PrintMessage is called. Ctx and Cookie are passed into the handler when + /// it is invoked. + void setDiagHandler(DiagHandlerTy DH, void *Ctx = 0, unsigned Cookie = 0) { DiagHandler = DH; DiagContext = Ctx; + DiagLocCookie = Cookie; } const SrcBuffer &getBufferInfo(unsigned i) const { |