[cfe-dev] [PATCH] -B support in clang
Roman Divacky
rdivacky at freebsd.org
Thu Oct 29 08:26:37 PDT 2009
this patch is not going to get integrated at all. Daniel already
refused to have this functionality. I just posted it to the list
to archive it. ie. when someone in the future googles for clang -B
they can have this patch...
I have no intention to integrate it upstream
On Thu, Oct 29, 2009 at 08:26:04AM -0700, Douglas Gregor wrote:
>
> 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
>
More information about the cfe-dev
mailing list