[cfe-dev] [PATCH] -B support in clang
Douglas Gregor
dgregor at apple.com
Thu Oct 29 08:26:04 PDT 2009
On Oct 28, 2009, at 5:51 AM, Roman Divacky wrote:
> fwiwi:
>
> vlakno.cz/~rdivacky/clang-B.patch
>
> this patch implements clang -B. someone might find it useful.
This is Daniel's domain, but I have two comments and a question:
+ // HACK
+ if (C->getArgs().hasArg(options::OPT_B)) {
+ Arg *B_dir = C->getArgs().getLastArg(options::OPT_B);
+ Prefix = B_dir->getValue(C->getArgs());
+ } else {
+ Prefix = "";
+ }
+
A "HACK" note should at least mention why it's a hack :)
+std::string Driver::GetPrefix() const {
+ return Prefix;
+}
Must we really copy the prefix string every time we call this? Please
return an llvm::StringRef instead.
The question: this doesn't look like it implements all of the
documented semantics of GCC's -B. Is this subset of -B useful enough
to be included in Clang? Often, having partly-implemented features can
cause more confusion, especially since a partially-implemented -B
would mean that we could silently pick up different libraries or
executables...
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091029/d2d6b5c5/attachment.html>
More information about the cfe-dev
mailing list