summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-11-09 19:40:45 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-11-09 19:40:45 +0000
commitecd27bf256c92f56c7c7ede6f40ec5d31a40b35e (patch)
treec7318bae561a592d3ff8b282c7a864a175e0ac10 /include/clang/Basic/SourceManager.h
parent8616f9af65b9a3662f2c9dfed38eeabc509f8446 (diff)
Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBuffer
for completeness and use it in CompilerInstance::InitializeSourceManager if the input is a memory buffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index a8e10ecf75..db6bfd2ad3 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -674,9 +674,10 @@ public:
///
/// One example of when this would be used is when the main source is read
/// from STDIN.
- FileID createMainFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer) {
+ FileID createMainFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer,
+ SrcMgr::CharacteristicKind Kind = SrcMgr::C_User) {
assert(MainFileID.isInvalid() && "MainFileID already set!");
- MainFileID = createFileIDForMemBuffer(Buffer);
+ MainFileID = createFileIDForMemBuffer(Buffer, Kind);
return MainFileID;
}
@@ -733,10 +734,11 @@ 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,
+ SrcMgr::CharacteristicKind FileCharacter = SrcMgr::C_User,
int LoadedID = 0, unsigned LoadedOffset = 0,
SourceLocation IncludeLoc = SourceLocation()) {
return createFileID(createMemBufferContentCache(Buffer), IncludeLoc,
- SrcMgr::C_User, LoadedID, LoadedOffset);
+ FileCharacter, LoadedID, LoadedOffset);
}
/// \brief Return a new SourceLocation that encodes the