Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*
authorNico Weber <nicolasweber@gmx.de>
Thu, 4 Apr 2019 21:06:41 +0000 (21:06 +0000)
committerNico Weber <nicolasweber@gmx.de>
Thu, 4 Apr 2019 21:06:41 +0000 (21:06 +0000)
commit04347d848d270737b183060b2ba488eef84d3a16
treeffaf4b92f3c7f02498e4b188ecd4476a566f62e9
parentce2b61b2994bb08d3c45b958894ebff1ad4929f3
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

llvm-svn: 357724
13 files changed:
clang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
clang/include/clang/Basic/SourceManager.h
clang/include/clang/Frontend/FrontendOptions.h
clang/lib/Basic/SourceManager.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CodeGenAction.cpp
clang/lib/Frontend/PrecompiledPreamble.cpp
clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
clang/lib/StaticAnalyzer/Core/IssueHash.cpp
clang/tools/clang-import-test/clang-import-test.cpp
clang/tools/libclang/CIndex.cpp
llvm/include/llvm/Support/MemoryBuffer.h