[cfe-commits] r123576 - /cfe/trunk/lib/Driver/Tools.cpp

Chris Lattner sabre at nondot.org
Sun Jan 16 00:14:11 PST 2011


Author: lattner
Date: Sun Jan 16 02:14:11 2011
New Revision: 123576

URL: http://llvm.org/viewvc/llvm-project?rev=123576&view=rev
Log:
improve compatibility with GCC: when generating the ".d" filename to use
and the filename has multiple .'s in it, use the last.  For example, "foo.bar.cpp"
should produce "foo.bar.d" not "foo.d".  Patch by Johan Boule in PR8391

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=123576&r1=123575&r2=123576&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Jan 16 02:14:11 2011
@@ -1964,7 +1964,7 @@
                                           const InputInfoList &Inputs) {
   const char *Str = getBaseInputName(Args, Inputs);
 
-  if (const char *End = strchr(Str, '.'))
+  if (const char *End = strrchr(Str, '.'))
     return Args.MakeArgString(std::string(Str, End));
 
   return Str;





More information about the cfe-commits mailing list