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,
238238 &DiagBuf,
239239 /* ShouldOwnClient=*/ false );
240240
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+
241247 // Create a new Clang compiler invocation.
242248 llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> ClangInvok{
243- clang::createInvocationFromCommandLine (ArgList , ClangDiags)
249+ clang::createInvocationFromCommandLine (ClangArgList , ClangDiags)
244250 };
245251 if (!ClangInvok || ClangDiags->hasErrorOccurred ()) {
246252 for (auto I = DiagBuf.err_begin (), E = DiagBuf.err_end (); I != E; ++I) {
Original file line number Diff line number Diff line change 11// FIXME: rdar://problem/19648117 Needs splitting objc parts out
22// XFAIL: linux
3- // REQUIRES: OS=macosx
43
54// RUN: echo '#include "header-to-print.h"' > %t.m
65// 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 44// RUN: -isysroot %clang-importer-sdk-path -fsyntax-only %t.m -I %S/Inputs | FileCheck %s
55
66// REQUIRES: objc_interop
7- // REQUIRES: OS=macosx
87
98// CHECK: enum Normal : Int {
109// CHECK-NOT: {{^}}}
You can’t perform that action at this time.
0 commit comments