<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 28, 2009, at 5:51 AM, Roman Divacky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>fwiwi:<br><br><span class="Apple-tab-span" style="white-space:pre">     </span>vlakno.cz/~rdivacky/clang-B.patch<br><br>this patch implements clang -B. someone might find it useful.<br></div></blockquote><div><br></div><div><br></div>This is Daniel's domain, but I have two comments and a question:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">+  // 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 = "";
+  }
+</pre></span><div>A "HACK" note should at least mention why it's a hack :)</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">+std::string Driver::GetPrefix() const {
+   return Prefix;
+}</pre></span><div>Must we really copy the prefix string every time we call this? Please return an llvm::StringRef instead.</div><div><br></div><div>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...</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>- Doug</div></div><div><br></div></div></body></html>