diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-11 21:27:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-11 21:27:55 +0000 |
commit | d4e5fbacab6d93e5a2c6d2a5ad5645b972c54bea (patch) | |
tree | d62c11fc6fb1d4a88cf3a2b6fc17efd40eeec16a /clang/Driver/RewriteTest.cpp | |
parent | f24dd1c1eb0730c6265f5fed2fde4edf38472c7b (diff) | |
download | bcm5719-llvm-d4e5fbacab6d93e5a2c6d2a5ad5645b972c54bea.tar.gz bcm5719-llvm-d4e5fbacab6d93e5a2c6d2a5ad5645b972c54bea.zip |
Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.
Modified all users of Diagnostics to comply with this new interface.
Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).
Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.
llvm-svn: 44878
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r-- | clang/Driver/RewriteTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index 77adafecba6..cc10ab0d383 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/Driver/RewriteTest.cpp @@ -64,7 +64,7 @@ namespace { public: void Initialize(ASTContext &context, unsigned mainFileID) { Context = &context; - SM = &Context->SourceMgr; + SM = &Context->getSourceManager(); MsgSendFunctionDecl = 0; MsgSendSuperFunctionDecl = 0; MsgSendStretFunctionDecl = 0; @@ -87,7 +87,7 @@ namespace { MainFileEnd = MainBuf->getBufferEnd(); - Rewrite.setSourceMgr(Context->SourceMgr); + Rewrite.setSourceMgr(Context->getSourceManager()); // declaring objc_selector outside the parameter list removes a silly // scope related warning... const char *s = "struct objc_selector; struct objc_class;\n" @@ -917,7 +917,8 @@ Stmt *RewriteTest::RewriteAtEncode(ObjCEncodeExpr *Exp) { unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, "rewriter could not replace sub-expression due to macros"); SourceRange Range = Exp->getSourceRange(); - Diags.Report(Exp->getAtLoc(), DiagID, 0, 0, &Range, 1); + Diags.Report(Exp->getAtLoc(), DiagID, Context->getSourceManager(), + 0, 0, &Range, 1); delete Replacement; return Exp; } |