aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-08-09 09:54:57 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-08-09 09:55:07 -0700
commitacf57858c1acb4ff776a1d734b86e1c05303132a (patch)
tree2618866eb3a445f4b57431d8e33986b111ab4807 /clang/lib/Frontend/CompilerInvocation.cpp
parent501f92d343828c0066d3286c3ae6606021b8b271 (diff)
downloadllvm-acf57858c1acb4ff776a1d734b86e1c05303132a.zip
llvm-acf57858c1acb4ff776a1d734b86e1c05303132a.tar.gz
llvm-acf57858c1acb4ff776a1d734b86e1c05303132a.tar.bz2
[clang] NFC: Use compile-time option spelling when generating command line
When generating command lines, use the option spelling generated by TableGen (`StringLiteral`) instead of constructing it at runtime. This saves some needless allocations. Depends on D157029. Reviewed By: benlangmuir, MaskRay Differential Revision: https://reviews.llvm.org/D157054
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index c4082db..8719009 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -615,7 +615,7 @@ static unsigned getOptimizationLevelSize(ArgList &Args) {
static void GenerateArg(ArgumentConsumer Consumer,
llvm::opt::OptSpecifier OptSpecifier) {
Option Opt = getDriverOptTable().getOption(OptSpecifier);
- denormalizeSimpleFlag(Consumer, Opt.getPrefix() + Opt.getName(),
+ denormalizeSimpleFlag(Consumer, Opt.getPrefixedName(),
Option::OptionClass::FlagClass, 0);
}
@@ -623,8 +623,7 @@ static void GenerateArg(ArgumentConsumer Consumer,
llvm::opt::OptSpecifier OptSpecifier,
const Twine &Value) {
Option Opt = getDriverOptTable().getOption(OptSpecifier);
- denormalizeString(Consumer, Opt.getPrefix() + Opt.getName(), Opt.getKind(), 0,
- Value);
+ denormalizeString(Consumer, Opt.getPrefixedName(), Opt.getKind(), 0, Value);
}
// Parse command line arguments into CompilerInvocation.