aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorPuyan Lotfi <puyan@puyan.org>2020-03-28 04:08:27 -0400
committerPuyan Lotfi <puyan@puyan.org>2020-04-01 10:49:06 -0400
commite3033c0ce5517efddbf92a079ad1e0ca4868591f (patch)
tree98ef0cb8c4d7c7ad93346933371f8a43f600ff79 /clang/lib/Frontend/CompilerInvocation.cpp
parenta67cd71acdb0cd636097a74ec80e2f23ef301ada (diff)
downloadllvm-e3033c0ce5517efddbf92a079ad1e0ca4868591f.zip
llvm-e3033c0ce5517efddbf92a079ad1e0ca4868591f.tar.gz
llvm-e3033c0ce5517efddbf92a079ad1e0ca4868591f.tar.bz2
[llvm][clang][IFS] Enhancing the llvm-ifs yaml format for symbol lists.
Prior to this change the clang interface stubs format resembled something ending with a symbol list like this: Symbols: a: { Type: Func } This was problematic because we didn't actually want a map format and also because we didn't like that an empty symbol list required "Symbols: {}". That is to say without the empty {} llvm-ifs would crash on an empty list. With this new format it is much more clear which field is the symbol name, and instead the [] that is used to express an empty symbol vector is optional, ie: Symbols: - { Name: a, Type: Func } or Symbols: [] or Symbols: This further diverges the format from existing llvm-elftapi. This is a good thing because although the format originally came from the same place, they are not the same in any way. Differential Revision: https://reviews.llvm.org/D76979
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index e056713..5d0be3c 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1780,25 +1780,26 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
StringRef ArgStr =
Args.hasArg(OPT_interface_stub_version_EQ)
? Args.getLastArgValue(OPT_interface_stub_version_EQ)
- : "experimental-ifs-v1";
+ : "experimental-ifs-v2";
if (ArgStr == "experimental-yaml-elf-v1" ||
+ ArgStr == "experimental-ifs-v1" ||
ArgStr == "experimental-tapi-elf-v1") {
std::string ErrorMessage =
"Invalid interface stub format: " + ArgStr.str() +
" is deprecated.";
Diags.Report(diag::err_drv_invalid_value)
<< "Must specify a valid interface stub format type, ie: "
- "-interface-stub-version=experimental-ifs-v1"
+ "-interface-stub-version=experimental-ifs-v2"
<< ErrorMessage;
- } else if (ArgStr != "experimental-ifs-v1") {
+ } else if (!ArgStr.startswith("experimental-ifs-")) {
std::string ErrorMessage =
"Invalid interface stub format: " + ArgStr.str() + ".";
Diags.Report(diag::err_drv_invalid_value)
<< "Must specify a valid interface stub format type, ie: "
- "-interface-stub-version=experimental-ifs-v1"
+ "-interface-stub-version=experimental-ifs-v2"
<< ErrorMessage;
} else {
- Opts.ProgramAction = frontend::GenerateInterfaceIfsExpV1;
+ Opts.ProgramAction = frontend::GenerateInterfaceStubs;
}
break;
}
@@ -3367,7 +3368,7 @@ static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) {
case frontend::GenerateModuleInterface:
case frontend::GenerateHeaderModule:
case frontend::GeneratePCH:
- case frontend::GenerateInterfaceIfsExpV1:
+ case frontend::GenerateInterfaceStubs:
case frontend::ParseSyntaxOnly:
case frontend::ModuleFileInfo:
case frontend::VerifyPCH: