aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJustin Stitt <justinstitt@google.com>2024-08-23 23:33:23 -0700
committerGitHub <noreply@github.com>2024-08-23 23:33:23 -0700
commit76236fafda19ff3760443196edcd3cd9610ed733 (patch)
treef0e92e4114c3f09131b19361d4b5502904fa884e /clang/lib/Frontend/CompilerInvocation.cpp
parente185850ce735ade5924129bec56a5954c443cf17 (diff)
downloadllvm-76236fafda19ff3760443196edcd3cd9610ed733.zip
llvm-76236fafda19ff3760443196edcd3cd9610ed733.tar.gz
llvm-76236fafda19ff3760443196edcd3cd9610ed733.tar.bz2
[Clang] Overflow Pattern Exclusion - rename some patterns, enhance docs (#105709)
From @vitalybuka's review on https://github.com/llvm/llvm-project/pull/104889: - [x] remove unused variable in tests - [x] rename `post-decr-while` --> `unsigned-post-decr-while` - [x] split `add-overflow-test` into `add-unsigned-overflow-test` and `add-signed-overflow-test` - [x] be more clear about defaults within docs - [x] add table to docs Here's a screenshot of the rendered table so you don't have to build the html docs yourself to inspect the layout: ![image](https://github.com/user-attachments/assets/5d3497c4-5f5a-4579-b29b-96a0fd192faa) CCs: @vitalybuka --------- Signed-off-by: Justin Stitt <justinstitt@google.com> Co-authored-by: Vitaly Buka <vitalybuka@google.com>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f510d30..0bb4175 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4274,9 +4274,13 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
llvm::StringSwitch<unsigned>(A->getValue(i))
.Case("none", LangOptionsBase::None)
.Case("all", LangOptionsBase::All)
- .Case("add-overflow-test", LangOptionsBase::AddOverflowTest)
+ .Case("add-unsigned-overflow-test",
+ LangOptionsBase::AddUnsignedOverflowTest)
+ .Case("add-signed-overflow-test",
+ LangOptionsBase::AddSignedOverflowTest)
.Case("negated-unsigned-const", LangOptionsBase::NegUnsignedConst)
- .Case("post-decr-while", LangOptionsBase::PostDecrInWhile)
+ .Case("unsigned-post-decr-while",
+ LangOptionsBase::PostDecrInWhile)
.Default(0);
}
}