joerg added inline comments.

================
Comment at: lib/Lex/PPMacroExpansion.cpp:1460
+  for (const auto &Entry : MacroPrefixMap)
+    if (Path.startswith(Entry.first))
+      return (Twine(Entry.second) + Path.substr(Entry.first.size())).str();
----------------
Lekensteyn wrote:
> dankm wrote:
> > dankm wrote:
> > > joerg wrote:
> > > > This doesn't handle directory vs string prefix prefix correctly, does 
> > > > it? At the very least, it should have a test case :)
> > > Good catch. I expect not. But on the other hand, it's exactly what 
> > > debug-prefix-map does :)
> > > 
> > > I'll add test cases in a future review. My first goal was getting 
> > > something sort-of working.
> > There should be a test, but apparently the debug prefix map code also does 
> > this.
> > 
> > What do you think the correct behaviour should be? a string prefix, or a 
> > directory prefix?
> It should be a string prefix (like GCC)
I disagree. I consider it a bug in GCC that it is a string prefix. It's quite 
inconsistent as well.


Repository:
  rC Clang

https://reviews.llvm.org/D49466



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to