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 | 654091391b61d49e6b5027376415fa853f30a313 (patch) | |
| tree | b6617c9e06667cd5cbb0966a2b166b9acf8bf3f9 /llvm/include | |
| parent | 3c799811c1405a187f9769ca69553d27fbb0bd5c (diff) | |
| download | bcm5719-llvm-654091391b61d49e6b5027376415fa853f30a313.tar.gz bcm5719-llvm-654091391b61d49e6b5027376415fa853f30a313.zip | |
give the SourceMgr object a cookie.
llvm-svn: 100504
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Support/SourceMgr.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h index caa67c03c59..3e66762ae34 100644 --- a/llvm/include/llvm/Support/SourceMgr.h +++ b/llvm/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 { |

