Skip to content

Pass -Xcc flags through swift-symbolgraph-extract #29568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/driver/swift_symbolgraph_extract_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ PrettyPrint("pretty-print", llvm::cl::desc("Pretty-print the resulting Symbol Gr
static llvm::cl::opt<std::string>
MinimumAccessLevel("minimum-access-level", llvm::cl::desc("Include symbols with this access level or more"), llvm::cl::cat(Category));

static llvm::cl::list<std::string>
Xcc("Xcc", llvm::cl::desc("Pass the following command-line flag to Clang"),
llvm::cl::cat(Category));

static llvm::cl::opt<std::string>
OutputPath("o", llvm::cl::desc("Symbol Graph JSON Output Path"), llvm::cl::cat(Category));
} // end namespace options
Expand All @@ -90,6 +94,10 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
Invocation.setSDKPath(options::SDK);
Invocation.setTargetTriple(options::Target);

for (auto &Arg : options::Xcc) {
Invocation.getClangImporterOptions().ExtraArgs.push_back(Arg);
}

std::vector<SearchPathOptions::FrameworkSearchPath> FrameworkSearchPaths;
for (const auto &Path : options::FrameworkSearchPaths) {
FrameworkSearchPaths.push_back({ Path, /*isSystem*/ false});
Expand Down