[cfe-dev] [PATCH] -B support in clang

Daniel Dunbar daniel at zuster.org
Mon Nov 2 13:37:54 PST 2009


Hi Roman,

On Thu, Oct 29, 2009 at 7:26 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
> 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...

Just to be clear, I'm not "refusing" to have this functionality, but I
do think its a bad idea. It isn't a very good feature, wasn't ever
really designed for users, and I don't think that it is one that real
world projects have any business relying on. I can always be convinced
otherwise, but I'd need some evidence that it is actually serving a
useful purpose for a (number of) real project(s).

 - Daniel

> 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
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list