Skip to content

Commit dccc758

Browse files
committed
Pass in clang as arg[0] when invoking clang via the clang importer. Clang is expecting an argv[0] argument.
1 parent 4cbf382 commit dccc758

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ ClangImporter::create(ASTContext &ctx,
515515

516516
std::vector<std::string> invocationArgStrs;
517517

518+
// Clang expects this to be like an actual command line. So we need to pass in
519+
// "clang" for argv[0]
520+
invocationArgStrs.push_back("clang");
521+
518522
switch (importerOpts.Mode) {
519523
case ClangImporterOptions::Modes::Normal:
520524
getNormalInvocationArguments(invocationArgStrs, ctx, importerOpts);

0 commit comments

Comments
 (0)