[cfe-commits] [PATCH] Add multiple prefixes to Option.
Daniel Dunbar
daniel at zuster.org
Fri Oct 19 15:22:32 PDT 2012
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
More information about the cfe-commits
mailing list