Skip to content

Commit ff9d3ef

Browse files
authored
Merge pull request #29568 from bitjammer/acgarland/rdar-59055039-ssg-pass-xcc
Pass -Xcc flags through swift-symbolgraph-extract
2 parents 307a2f0 + 7030301 commit ff9d3ef

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 (Required)"), llvm::cl::cat(Category));
7175
} // end namespace options
@@ -120,6 +124,10 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
120124
Invocation.setSDKPath(options::SDK);
121125
Invocation.setTargetTriple(options::Target);
122126

127+
for (auto &Arg : options::Xcc) {
128+
Invocation.getClangImporterOptions().ExtraArgs.push_back(Arg);
129+
}
130+
123131
std::vector<SearchPathOptions::FrameworkSearchPath> FrameworkSearchPaths;
124132
for (const auto &Path : options::FrameworkSearchPaths) {
125133
FrameworkSearchPaths.push_back({ Path, /*isSystem*/ false});

0 commit comments

Comments
 (0)