diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-19 22:51:13 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-19 22:51:13 +0000 |
commit | 230bd918b2a6ac14cd1f03f1599cf081d8c5b64c (patch) | |
tree | 841cea0e5c67b5bafcd0f91cd8b9c1122f296ee2 /clang/Driver/RewriteTest.cpp | |
parent | f7bfae6b45771cef04afac043d67cd11a18927e6 (diff) | |
download | bcm5719-llvm-230bd918b2a6ac14cd1f03f1599cf081d8c5b64c.tar.gz bcm5719-llvm-230bd918b2a6ac14cd1f03f1599cf081d8c5b64c.zip |
Interned MainFileID within SourceManager. Since SourceManager is referenced by
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.
llvm-svn: 45228
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r-- | clang/Driver/RewriteTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index c5de0700214..c9dd0f731cd 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/Driver/RewriteTest.cpp @@ -62,7 +62,7 @@ namespace { static const int OBJC_ABI_VERSION =7 ; public: - void Initialize(ASTContext &context, unsigned mainFileID) { + void Initialize(ASTContext &context) { Context = &context; SM = &Context->getSourceManager(); MsgSendFunctionDecl = 0; @@ -81,7 +81,7 @@ namespace { SuperStructDecl = 0; // Get the ID and start/end of the main file. - MainFileID = mainFileID; + MainFileID = SM->getMainFileID(); const llvm::MemoryBuffer *MainBuf = SM->getBuffer(MainFileID); MainFileStart = MainBuf->getBufferStart(); MainFileEnd = MainBuf->getBufferEnd(); @@ -123,7 +123,7 @@ namespace { "extern Protocol *objc_getProtocol(const char *);\n" "#include <objc/objc.h>\n"; - Rewrite.InsertText(SourceLocation::getFileLoc(mainFileID, 0), + Rewrite.InsertText(SourceLocation::getFileLoc(MainFileID, 0), s, strlen(s)); } |