From acf57858c1acb4ff776a1d734b86e1c05303132a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 9 Aug 2023 09:54:57 -0700 Subject: [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 --- clang/lib/Frontend/CompilerInvocation.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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. -- cgit v1.1