Forgot to click ready, this is the comment that "otherwise" referred to.
================
Comment at: lib/Driver/OptTable.cpp:183
@@ -136,1 +182,3 @@
+}
+
Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index) const {
----------------
This function is creating a new std::string and concatenating to it just to do
a comparison (also, the local name Prefix is bogus). This should be rewritten
to do the comparison directly. Without thinking about it, the body of the loop
should look something like:
StringRef Prefix(Pre);
if (Str.startswith(Prefix) && Str.substr(Prefix.size()).startswith(I->Name))
return ...
Also, can the name of this function be less generic?
http://llvm-reviews.chandlerc.com/D69
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits