aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-08-18 17:56:32 +0000
committerChad Rosier <mcrosier@apple.com>2011-08-18 17:56:32 +0000
commit8722a5d48340659c98c79af820b9088a64ef0303 (patch)
tree423e2221d05df1ebf9aacb1079f2a9b3c4ca8fc1 /lib/Driver/Tools.cpp
parent1f89b4016505045d79b53ce1204fc2c46c7d01c9 (diff)
Use StringRef, rather than C string APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 295ab32aee..ca8b7d4bb9 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2448,18 +2448,19 @@ darwin::CC1::getDependencyFileName(const ArgList &Args,
void darwin::CC1::RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const {
for (ArgStringList::iterator it = CmdArgs.begin(), ie = CmdArgs.end();
it != ie;) {
- const char *Option = *it;
+
+ StringRef Option = *it;
// We only remove warning options.
- if (strncmp(Option, "-W", 2)) {
+ if (!Option.startswith("-W")) {
++it;
continue;
}
- if (strncmp(Option, "-Wno-", 5))
- Option = &Option[2];
+ if (Option.startswith("-Wno-"))
+ Option = Option.substr(5);
else
- Option = &Option[5];
+ Option = Option.substr(2);
bool RemoveOption = llvm::StringSwitch<bool>(Option)
.Case("address-of-temporary", true)