diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-04-04 21:06:41 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-04-04 21:06:41 +0000 |
commit | 51ca2d3ac1081b943629550a829f6b4f13467a6b (patch) | |
tree | 57570637e673f53a4bd0479be643c42d1720c3ae /tools/libclang | |
parent | fac080d750560c3997969b05a2b25be940754723 (diff) | |
download | clang-51ca2d3ac1081b943629550a829f6b4f13467a6b.tar.gz |
Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*
Requires making the llvm::MemoryBuffer* stored by SourceManager const,
which in turn requires making the accessors for that return const
llvm::MemoryBuffer*s and updating all call sites.
The original motivation for this was to use it and fix the TODO in
CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag
version of createFileID, and since llvm::SourceMgr* hands out a const
llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO
this way actually works, but this seems like a good change on its own
anyways.
No intended behavior change.
Differential Revision: https://reviews.llvm.org/D60247
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang')
-rw-r--r-- | tools/libclang/CIndex.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 1ea85ec30d..7bc1c459d8 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -4228,7 +4228,7 @@ const char *clang_getFileContents(CXTranslationUnit TU, CXFile file, const SourceManager &SM = cxtu::getASTUnit(TU)->getSourceManager(); FileID fid = SM.translateFile(static_cast<FileEntry *>(file)); bool Invalid = true; - llvm::MemoryBuffer *buf = SM.getBuffer(fid, &Invalid); + const llvm::MemoryBuffer *buf = SM.getBuffer(fid, &Invalid); if (Invalid) { if (size) *size = 0; |