aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-19 22:51:13 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-19 22:51:13 +0000
commit95041a2029a069386ee67439f6d0fb524a9d184f (patch)
treefc90277b24345b3b96aa34852ac44656e513e361 /Driver/RewriteTest.cpp
parent7dcc968f17a6ff9088c9651dddccc8d4025a1271 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index c5de070021..c9dd0f731c 100644
--- a/Driver/RewriteTest.cpp
+++ b/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));
}