erichkeane added inline comments.

================
Comment at: include/clang/Lex/PreprocessorOptions.h:171
+  /// A prefix map for __FILE__ and __BASEFILE__
+  std::map<std::string, std::string> MacroPrefixMap;
+
----------------
dankm wrote:
> erichkeane wrote:
> > erichkeane wrote:
> > > It seems this can be StringRefs as well.
> > Did you miss this one?  Or is there a good reason these cannot be 
> > stringrefs?
> I didn't miss it. StringRefs here don't survive. The function that adds them 
> to the map creates temporary strings, that go away once that function ends 
> causing StringRefs to dangle. std::string keeps copies.
Oh! I hadn't realized that getAllArgValues gives a vector<string>.  That is 
actually pretty odd for our codebase.  Looking into it, there is no reason that 
function cannot return a vector of StringRef...

Alright, at one point someone should likely fix that, but that person should 
change this type.


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