diff options
author | Alp Toker <alp@nuanti.com> | 2014-05-21 01:12:41 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-05-21 01:12:41 +0000 |
commit | b671e34c36463f972a3984e407f91484ad6e5806 (patch) | |
tree | cc9796f60ac6ea4e73fc15bc58642210a590e7b6 /clang/unittests/Lex | |
parent | 80fd10e6e10d23fed1a78cc3755ce06bcc2cb9d8 (diff) | |
download | bcm5719-llvm-b671e34c36463f972a3984e407f91484ad6e5806.tar.gz bcm5719-llvm-b671e34c36463f972a3984e407f91484ad6e5806.zip |
SourceManager: Use setMainFileID() consistently
Eliminate createMainFileID() / createMainFileIDForMemBuffer() utility
functions. These didn't add much convenience and conflated two distinct
operations.
This change makes things easier to follow by providing a consistent interface
and getting rid of a bunch of cast-to-voids.
llvm-svn: 209266
Diffstat (limited to 'clang/unittests/Lex')
-rw-r--r-- | clang/unittests/Lex/LexerTest.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/Lex/PPCallbacksTest.cpp | 4 | ||||
-rw-r--r-- | clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp index 7be9360a598..3d30352d489 100644 --- a/clang/unittests/Lex/LexerTest.cpp +++ b/clang/unittests/Lex/LexerTest.cpp @@ -64,7 +64,7 @@ protected: std::vector<Token> CheckLex(StringRef Source, ArrayRef<tok::TokenKind> ExpectedTokens) { MemoryBuffer *buf = MemoryBuffer::getMemBuffer(Source); - (void) SourceMgr.createMainFileIDForMemBuffer(buf); + SourceMgr.setMainFileID(SourceMgr.createFileID(buf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts, diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp index 25dc7db53e5..cceebea6c18 100644 --- a/clang/unittests/Lex/PPCallbacksTest.cpp +++ b/clang/unittests/Lex/PPCallbacksTest.cpp @@ -163,7 +163,7 @@ protected: CharSourceRange InclusionDirectiveFilenameRange(const char* SourceText, const char* HeaderPath, bool SystemHeader) { MemoryBuffer *Buf = MemoryBuffer::getMemBuffer(SourceText); - (void)SourceMgr.createMainFileIDForMemBuffer(Buf); + SourceMgr.setMainFileID(SourceMgr.createFileID(Buf)); VoidModuleLoader ModLoader; @@ -200,7 +200,7 @@ protected: OpenCLLangOpts.OpenCL = 1; MemoryBuffer* sourceBuf = MemoryBuffer::getMemBuffer(SourceText, "test.cl"); - (void)SourceMgr.createMainFileIDForMemBuffer(sourceBuf); + SourceMgr.setMainFileID(SourceMgr.createFileID(sourceBuf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, diff --git a/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp b/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp index ff81fa0bb6a..f7ed8e54fc5 100644 --- a/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp +++ b/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp @@ -92,7 +92,7 @@ TEST_F(PPConditionalDirectiveRecordTest, PPRecAPI) { "9\n"; MemoryBuffer *buf = MemoryBuffer::getMemBuffer(source); - SourceMgr.createMainFileIDForMemBuffer(buf); + SourceMgr.setMainFileID(SourceMgr.createFileID(buf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts, |