diff options
author | Kim Gräsman <kim.grasman@gmail.com> | 2024-08-26 19:49:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 14:49:56 -0300 |
commit | 924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68 (patch) | |
tree | 1530e289a7319cb63c9b01f3794b3ef5a07f1c34 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 1387ba48a312b6e9b174d850f8c9a1322f44c623 (diff) | |
download | llvm-924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68.zip llvm-924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68.tar.gz llvm-924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68.tar.bz2 |
Use CLANG_RESOURCE_DIR more consistently (#103388)
When Clang is consumed as a library, the CLANG_RESOURCE_DIR definition
is not exported from the CMake system, so external clients will be
unable to compute the same resource dir as Clang itself would, because
they don't know what to pass for the optional CustomResourceDir
argument.
All call sites except one would pass CLANG_RESOURCE_DIR to
Driver::GetResourcesPath. It seems the one exception in libclang
CIndexer was an oversight.
Move the use of CLANG_RESOURCE_DIR into GetResourcesPath and remove the
optional argument to avoid this inconsistency between internal and
external clients.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0bb4175..32628c5 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3130,7 +3130,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0, void *MainAddr) { std::string ClangExecutable = llvm::sys::fs::getMainExecutable(Argv0, MainAddr); - return Driver::GetResourcesPath(ClangExecutable, CLANG_RESOURCE_DIR); + return Driver::GetResourcesPath(ClangExecutable); } static void GenerateHeaderSearchArgs(const HeaderSearchOptions &Opts, |