[PATCH] D57532: [Index] Make sure c-index-test finds libc++ on Mac
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 1 03:05:25 PST 2019
ilya-biryukov updated this revision to Diff 184712.
ilya-biryukov added a comment.
- Revert "changes to main"
- Compute the path in parseTranslationUnit2
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57532/new/
https://reviews.llvm.org/D57532
Files:
clang/test/Index/record-completion-invocation.c
clang/test/Index/record-parsing-invocation.c
clang/tools/libclang/CIndex.cpp
Index: clang/tools/libclang/CIndex.cpp
===================================================================
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -3543,12 +3543,18 @@
const char *const *command_line_args, int num_command_line_args,
struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
unsigned options, CXTranslationUnit *out_TU) {
+ llvm::SmallString<128> MockClangPath;
+ llvm::sys::path::append(
+ MockClangPath, static_cast<CIndexer *>(CIdx)->getClangToolchainPath(),
+ "bin", "clang");
+
SmallVector<const char *, 4> Args;
- Args.push_back("clang");
+ Args.push_back(MockClangPath.c_str());
Args.append(command_line_args, command_line_args + num_command_line_args);
- return clang_parseTranslationUnit2FullArgv(
+ CXErrorCode Ret = clang_parseTranslationUnit2FullArgv(
CIdx, source_filename, Args.data(), Args.size(), unsaved_files,
num_unsaved_files, options, out_TU);
+ return Ret;
}
enum CXErrorCode clang_parseTranslationUnit2FullArgv(
Index: clang/test/Index/record-parsing-invocation.c
===================================================================
--- clang/test/Index/record-parsing-invocation.c
+++ clang/test/Index/record-parsing-invocation.c
@@ -24,5 +24,5 @@
# pragma clang __debug parser_crash
#endif
-// CHECK: {"toolchain":"{{.*}}","libclang.operation":"parse","libclang.opts":1,"args":["clang","-fno-spell-checking","{{.*}}record-parsing-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"]}
-// CHECK-UNSAVED: {"toolchain":"{{.*}}","libclang.operation":"parse","libclang.opts":1,"args":["clang","-fno-spell-checking","{{.*}}record-parsing-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"],"unsaved_file_hashes":[{"name":"{{.*}}record-parsing-invocation.c","md5":"aee23773de90e665992b48209351d70e"}]}
+// CHECK: {"toolchain":"{{.*}}","libclang.operation":"parse","libclang.opts":1,"args":["{{.*}}clang","-fno-spell-checking","{{.*}}record-parsing-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"]}
+// CHECK-UNSAVED: {"toolchain":"{{.*}}","libclang.operation":"parse","libclang.opts":1,"args":["{{.*}}clang","-fno-spell-checking","{{.*}}record-parsing-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"],"unsaved_file_hashes":[{"name":"{{.*}}record-parsing-invocation.c","md5":"aee23773de90e665992b48209351d70e"}]}
Index: clang/test/Index/record-completion-invocation.c
===================================================================
--- clang/test/Index/record-completion-invocation.c
+++ clang/test/Index/record-completion-invocation.c
@@ -8,4 +8,4 @@
// RUN: env LIBCLANG_DISABLE_CRASH_RECOVERY=1 CINDEXTEST_INVOCATION_EMISSION_PATH=%t not --crash c-index-test -code-completion-at=%s:10:1 "-remap-file=%s,%S/Inputs/record-parsing-invocation-remap.c" %s
// RUN: cat %t/libclang-* | FileCheck %s
-// CHECK: {"toolchain":"{{.*}}","libclang.operation":"complete","libclang.opts":1,"args":["clang","-fno-spell-checking","{{.*}}record-completion-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"],"invocation-args":["-code-completion-at={{.*}}record-completion-invocation.c:10:1"],"unsaved_file_hashes":[{"name":"{{.*}}record-completion-invocation.c","md5":"aee23773de90e665992b48209351d70e"}]}
+// CHECK: {"toolchain":"{{.*}}","libclang.operation":"complete","libclang.opts":1,"args":["{{.*}}clang","-fno-spell-checking","{{.*}}record-completion-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"],"invocation-args":["-code-completion-at={{.*}}record-completion-invocation.c:10:1"],"unsaved_file_hashes":[{"name":"{{.*}}record-completion-invocation.c","md5":"aee23773de90e665992b48209351d70e"}]}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57532.184712.patch
Type: text/x-patch
Size: 3857 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190201/7e297bbb/attachment-0001.bin>
More information about the cfe-commits
mailing list