r209002 - Rename SourceManager::createFileIDForMemBuffer()
Alp Toker
alp at nuanti.com
Fri May 16 10:23:01 PDT 2014
Author: alp
Date: Fri May 16 12:23:01 2014
New Revision: 209002
URL: http://llvm.org/viewvc/llvm-project?rev=209002&view=rev
Log:
Rename SourceManager::createFileIDForMemBuffer()
It makes more sense to just overload createFileID().
Gardening only.
Modified:
cfe/trunk/include/clang/Basic/SourceManager.h
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/lib/CodeGen/CodeGenAction.cpp
cfe/trunk/lib/Lex/Preprocessor.cpp
cfe/trunk/lib/Lex/ScratchBuffer.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/unittests/AST/CommentLexer.cpp
cfe/trunk/unittests/AST/CommentParser.cpp
Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Fri May 16 12:23:01 2014
@@ -754,7 +754,7 @@ public:
FileID createMainFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer,
SrcMgr::CharacteristicKind Kind = SrcMgr::C_User) {
assert(MainFileID.isInvalid() && "MainFileID already set!");
- MainFileID = createFileIDForMemBuffer(Buffer, Kind);
+ MainFileID = createFileID(Buffer, Kind);
return MainFileID;
}
@@ -810,10 +810,10 @@ public:
///
/// This does no caching of the buffer and takes ownership of the
/// MemoryBuffer, so only pass a MemoryBuffer to this once.
- FileID createFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer,
+ FileID createFileID(const llvm::MemoryBuffer *Buffer,
SrcMgr::CharacteristicKind FileCharacter = SrcMgr::C_User,
- int LoadedID = 0, unsigned LoadedOffset = 0,
- SourceLocation IncludeLoc = SourceLocation()) {
+ int LoadedID = 0, unsigned LoadedOffset = 0,
+ SourceLocation IncludeLoc = SourceLocation()) {
return createFileID(createMemBufferContentCache(Buffer), IncludeLoc,
FileCharacter, LoadedID, LoadedOffset);
}
Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Fri May 16 12:23:01 2014
@@ -4923,8 +4923,7 @@ FileID ASTImporter::Import(FileID FromID
llvm::MemoryBuffer *ToBuf
= llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBuffer(),
FromBuf->getBufferIdentifier());
- ToID = ToSM.createFileIDForMemBuffer(ToBuf,
- FromSLoc.getFile().getFileCharacteristic());
+ ToID = ToSM.createFileID(ToBuf, FromSLoc.getFile().getFileCharacteristic());
}
Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Fri May 16 12:23:01 2014
@@ -249,7 +249,7 @@ static FullSourceLoc ConvertBackendLocat
llvm::MemoryBuffer *CBuf =
llvm::MemoryBuffer::getMemBufferCopy(LBuf->getBuffer(),
LBuf->getBufferIdentifier());
- FileID FID = CSM.createFileIDForMemBuffer(CBuf);
+ FileID FID = CSM.createFileID(CBuf);
// Translate the offset into the file.
unsigned Offset = D.getLoc().getPointer() - LBuf->getBufferStart();
Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Fri May 16 12:23:01 2014
@@ -479,7 +479,7 @@ void Preprocessor::EnterMainSourceFile()
llvm::MemoryBuffer *SB =
llvm::MemoryBuffer::getMemBufferCopy(Predefines, "<built-in>");
assert(SB && "Cannot create predefined source buffer");
- FileID FID = SourceMgr.createFileIDForMemBuffer(SB);
+ FileID FID = SourceMgr.createFileID(SB);
assert(!FID.isInvalid() && "Could not create FileID for predefines?");
setPredefinesFileID(FID);
Modified: cfe/trunk/lib/Lex/ScratchBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ScratchBuffer.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ScratchBuffer.cpp (original)
+++ cfe/trunk/lib/Lex/ScratchBuffer.cpp Fri May 16 12:23:01 2014
@@ -65,7 +65,7 @@ void ScratchBuffer::AllocScratchBuffer(u
llvm::MemoryBuffer *Buf =
llvm::MemoryBuffer::getNewMemBuffer(RequestLen, "<scratch space>");
- FileID FID = SourceMgr.createFileIDForMemBuffer(Buf);
+ FileID FID = SourceMgr.createFileID(Buf);
BufferStartLoc = SourceMgr.getLocForStartOfFile(FID);
CurBuffer = const_cast<char*>(Buf->getBufferStart());
BytesUsed = 1;
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri May 16 12:23:01 2014
@@ -1249,8 +1249,8 @@ bool ASTReader::ReadSLocEntry(int ID) {
llvm::MemoryBuffer *Buffer
= llvm::MemoryBuffer::getMemBuffer(Blob.drop_back(1), Name);
- SourceMgr.createFileIDForMemBuffer(Buffer, FileCharacter, ID,
- BaseOffset + Offset, IncludeLoc);
+ SourceMgr.createFileID(Buffer, FileCharacter, ID, BaseOffset + Offset,
+ IncludeLoc);
break;
}
Modified: cfe/trunk/unittests/AST/CommentLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/CommentLexer.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/CommentLexer.cpp (original)
+++ cfe/trunk/unittests/AST/CommentLexer.cpp Fri May 16 12:23:01 2014
@@ -61,7 +61,7 @@ protected:
void CommentLexerTest::lexString(const char *Source,
std::vector<Token> &Toks) {
MemoryBuffer *Buf = MemoryBuffer::getMemBuffer(Source);
- FileID File = SourceMgr.createFileIDForMemBuffer(Buf);
+ FileID File = SourceMgr.createFileID(Buf);
SourceLocation Begin = SourceMgr.getLocForStartOfFile(File);
Lexer L(Allocator, Diags, Traits, Begin, Source, Source + strlen(Source));
Modified: cfe/trunk/unittests/AST/CommentParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/CommentParser.cpp?rev=209002&r1=209001&r2=209002&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/CommentParser.cpp (original)
+++ cfe/trunk/unittests/AST/CommentParser.cpp Fri May 16 12:23:01 2014
@@ -55,7 +55,7 @@ protected:
FullComment *CommentParserTest::parseString(const char *Source) {
MemoryBuffer *Buf = MemoryBuffer::getMemBuffer(Source);
- FileID File = SourceMgr.createFileIDForMemBuffer(Buf);
+ FileID File = SourceMgr.createFileID(Buf);
SourceLocation Begin = SourceMgr.getLocForStartOfFile(File);
Lexer L(Allocator, Diags, Traits, Begin, Source, Source + strlen(Source));
More information about the cfe-commits
mailing list