Skip to content

Commit 7030301

Browse files
committed
Pass -Xcc flags through swift-symbolgraph-extract
rdar://problem/59055039
1 parent 8b7a621 commit 7030301

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/driver/swift_symbolgraph_extract_main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ PrettyPrint("pretty-print", llvm::cl::desc("Pretty-print the resulting Symbol Gr
6666
static llvm::cl::opt<std::string>
6767
MinimumAccessLevel("minimum-access-level", llvm::cl::desc("Include symbols with this access level or more"), llvm::cl::cat(Category));
6868

69+
static llvm::cl::list<std::string>
70+
Xcc("Xcc", llvm::cl::desc("Pass the following command-line flag to Clang"),
71+
llvm::cl::cat(Category));
72+
6973
static llvm::cl::opt<std::string>
7074
OutputPath("o", llvm::cl::desc("Symbol Graph JSON Output Path"), llvm::cl::cat(Category));
7175
} // end namespace options
@@ -90,6 +94,10 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
9094
Invocation.setSDKPath(options::SDK);
9195
Invocation.setTargetTriple(options::Target);
9296

97+
for (auto &Arg : options::Xcc) {
98+
Invocation.getClangImporterOptions().ExtraArgs.push_back(Arg);
99+
}
100+
93101
std::vector<SearchPathOptions::FrameworkSearchPath> FrameworkSearchPaths;
94102
for (const auto &Path : options::FrameworkSearchPaths) {
95103
FrameworkSearchPaths.push_back({ Path, /*isSystem*/ false});

0 commit comments

Comments
 (0)