File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,15 @@ bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
238
238
&DiagBuf,
239
239
/* ShouldOwnClient=*/ false );
240
240
241
+ // Clang expects this to be like an actual command line. So we need to pass in
242
+ // "clang" for argv[0].
243
+ std::vector<const char *> ClangArgList;
244
+ ClangArgList.push_back (" clang" );
245
+ ClangArgList.insert (ClangArgList.end (), ArgList.begin (), ArgList.end ());
246
+
241
247
// Create a new Clang compiler invocation.
242
248
llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> ClangInvok{
243
- clang::createInvocationFromCommandLine (ArgList , ClangDiags)
249
+ clang::createInvocationFromCommandLine (ClangArgList , ClangDiags)
244
250
};
245
251
if (!ClangInvok || ClangDiags->hasErrorOccurred ()) {
246
252
for (auto I = DiagBuf.err_begin (), E = DiagBuf.err_end (); I != E; ++I) {
Original file line number Diff line number Diff line change 1
1
// FIXME: rdar://problem/19648117 Needs splitting objc parts out
2
2
// XFAIL: linux
3
- // REQUIRES: OS=macosx
4
3
5
4
// RUN: echo '#include "header-to-print.h"' > %t.m
6
5
// RUN: %target-swift-ide-test -source-filename %s -print-header -header-to-print %S/Inputs/print_clang_header/header-to-print.h -print-regular-comments --cc-args %target-cc-options -isysroot %clang-importer-sdk-path -fsyntax-only %t.m -I %S/Inputs/print_clang_header > %t.txt
Original file line number Diff line number Diff line change 4
4
// RUN: -isysroot %clang-importer-sdk-path -fsyntax-only %t.m -I %S/Inputs | FileCheck %s
5
5
6
6
// REQUIRES: objc_interop
7
- // REQUIRES: OS=macosx
8
7
9
8
// CHECK: enum Normal : Int {
10
9
// CHECK-NOT: {{^}}}
You can’t perform that action at this time.
0 commit comments