diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-09 22:32:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-09 22:32:34 +0000 |
commit | 5b750fe6189a41937ff2b080a983c95ea273769f (patch) | |
tree | d47ac117b60b52f97c0fb1cece6ebc235a27af64 /lib/Driver/Tools.cpp | |
parent | 16484afe5ca790d2f9a16650638e54067c037d7d (diff) |
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ce99aa203b..31b6cb5a45 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -22,6 +22,7 @@ #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" @@ -383,22 +384,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, it = Args.begin(), ie = Args.end(); it != ie; ++it) { const Arg *A = *it; if (A->getOption().matches(options::OPT_m_x86_Features_Group)) { - const char *Name = A->getOption().getName(); + llvm::StringRef Name = A->getOption().getName(); // Skip over "-m". - assert(Name[0] == '-' && Name[1] == 'm' && "Invalid feature name."); - Name += 2; + assert(Name.startswith("-m") && "Invalid feature name."); + Name = Name.substr(2); - bool IsNegative = memcmp(Name, "no-", 3) == 0; + bool IsNegative = Name.startswith("no-"); if (IsNegative) - Name += 3; + Name = Name.substr(3); A->claim(); CmdArgs.push_back("-target-feature"); - CmdArgs.push_back(MakeFormattedString(Args, - llvm::format("%c%s", - IsNegative ? '-' : '+', - Name))); + CmdArgs.push_back(Args.MakeArgString((IsNegative ? "-" : "+") + Name)); } } |