aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2025-01-09 18:15:55 +0900
committerNAKAMURA Takumi <geek4civic@gmail.com>2025-01-09 18:15:55 +0900
commitbdcf47e4bcb92889665825654bb80a8bbe30379e (patch)
tree4de1d6b4ddc69f4f32daabb11ad5c71ab0cf895e /clang/lib/Frontend/CompilerInvocation.cpp
parente7fd5cd25334048980ea207a9eff72698724721a (diff)
parentfea7da1b00cc97d742faede2df96c7d327950f49 (diff)
downloadllvm-bdcf47e4bcb92889665825654bb80a8bbe30379e.zip
llvm-bdcf47e4bcb92889665825654bb80a8bbe30379e.tar.gz
llvm-bdcf47e4bcb92889665825654bb80a8bbe30379e.tar.bz2
Merge branch 'users/chapuni/cov/single/nextcount' into users/chapuni/cov/single/baseusers/chapuni/cov/single/base
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 348c56c..d711df0 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1260,6 +1260,23 @@ static void initOption(AnalyzerOptions::ConfigTable &Config,
<< Name << "an unsigned";
}
+static void initOption(AnalyzerOptions::ConfigTable &Config,
+ DiagnosticsEngine *Diags,
+ PositiveAnalyzerOption &OptionField, StringRef Name,
+ unsigned DefaultVal) {
+ auto Parsed = PositiveAnalyzerOption::create(
+ getStringOption(Config, Name, std::to_string(DefaultVal)));
+ if (Parsed.has_value()) {
+ OptionField = Parsed.value();
+ return;
+ }
+ if (Diags && !Parsed.has_value())
+ Diags->Report(diag::err_analyzer_config_invalid_input)
+ << Name << "a positive";
+
+ OptionField = DefaultVal;
+}
+
static void parseAnalyzerConfigs(AnalyzerOptions &AnOpts,
DiagnosticsEngine *Diags) {
// TODO: There's no need to store the entire configtable, it'd be plenty
@@ -1691,7 +1708,7 @@ void CompilerInvocationBase::GenerateCodeGenArgs(const CodeGenOptions &Opts,
}
}
- if (memcmp(Opts.CoverageVersion, "408*", 4) != 0)
+ if (memcmp(Opts.CoverageVersion, "0000", 4))
GenerateArg(Consumer, OPT_coverage_version_EQ,
StringRef(Opts.CoverageVersion, 4));
@@ -2007,7 +2024,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
} else if (Args.hasArg(OPT_fmemory_profile))
Opts.MemoryProfileOutput = MemProfileBasename;
- memcpy(Opts.CoverageVersion, "408*", 4);
if (Opts.CoverageNotesFile.size() || Opts.CoverageDataFile.size()) {
if (Args.hasArg(OPT_coverage_version_EQ)) {
StringRef CoverageVersion = Args.getLastArgValue(OPT_coverage_version_EQ);
@@ -4263,6 +4279,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (TT.getArch() == llvm::Triple::UnknownArch ||
!(TT.getArch() == llvm::Triple::aarch64 || TT.isPPC() ||
+ TT.getArch() == llvm::Triple::spirv64 ||
TT.getArch() == llvm::Triple::systemz ||
TT.getArch() == llvm::Triple::loongarch64 ||
TT.getArch() == llvm::Triple::nvptx ||