summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Compilation.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-10-06 22:53:35 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-10-06 22:53:35 +0000
commit8c26d440da7383a0de26dd86386c71f077160e1a (patch)
treeec481677ed9478a55678265db3a268d46957600d /clang/lib/Driver/Compilation.cpp
parent5626c66a8929c547ea1a4162ede08e36db8a97d2 (diff)
downloadbcm5719-llvm-8c26d440da7383a0de26dd86386c71f077160e1a.tar.gz
bcm5719-llvm-8c26d440da7383a0de26dd86386c71f077160e1a.zip
Use strpbrk(3) instead of open coding it.
llvm-svn: 141328
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r--clang/lib/Driver/Compilation.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index baaba19ed72..d02da9588a6 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/lib/Driver/Compilation.cpp
@@ -70,13 +70,6 @@ const DerivedArgList &Compilation::getArgsForToolChain(const ToolChain *TC,
return *Entry;
}
-static bool needsQuote(const char *s) {
- for (const char *c = s; *c; ++c)
- if (*c == ' ' || *c == '"' || *c == '\\' || *c == '$')
- return true;
- return false;
-}
-
void Compilation::PrintJob(raw_ostream &OS, const Job &J,
const char *Terminator, bool Quote) const {
if (const Command *C = dyn_cast<Command>(&J)) {
@@ -84,7 +77,7 @@ void Compilation::PrintJob(raw_ostream &OS, const Job &J,
for (ArgStringList::const_iterator it = C->getArguments().begin(),
ie = C->getArguments().end(); it != ie; ++it) {
OS << ' ';
- if (!Quote && !needsQuote(*it)) {
+ if (!Quote && !std::strpbrk(*it, " \"\\$")) {
OS << *it;
continue;
}
OpenPOWER on IntegriCloud