mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Represent Clang macro definitions from -Xcc options in the debug info.
Currently -Xcc options are serialized in Swift modules, but they are not saved as attributes to the DW_TAG_module representing the imported clang module. This patch saves all *user-specified* -D macros there, but it does not save any macros that are added by the ClangImporter itself. <rdar://problem/31990102>
This commit is contained in:
@@ -1470,6 +1470,14 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
}
|
||||
}
|
||||
|
||||
for (const Arg *A : make_range(Args.filtered_begin(OPT_Xcc),
|
||||
Args.filtered_end())) {
|
||||
StringRef Opt = A->getValue();
|
||||
if (Opt.startswith("-D") || Opt.startswith("-U"))
|
||||
Opts.ClangDefines.push_back(Opt);
|
||||
}
|
||||
|
||||
|
||||
for (const Arg *A : make_range(Args.filtered_begin(OPT_l, OPT_framework),
|
||||
Args.filtered_end())) {
|
||||
LibraryKind Kind;
|
||||
|
||||
Reference in New Issue
Block a user