r247160 - Fix a small bug in clang where generating some temporary files would have an extra period before the extension.

Argyrios Kyrtzidis via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 09:48:48 PDT 2015


Author: akirtzidis
Date: Wed Sep  9 11:48:47 2015
New Revision: 247160

URL: http://llvm.org/viewvc/llvm-project?rev=247160&view=rev
Log:
Fix a small bug in clang where generating some temporary files would have an extra period before the extension.

Patch by Cameron Esfahani!

Modified:
    cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
    cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
    cfe/trunk/lib/Frontend/Rewrite/FrontendActions.cpp

Modified: cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/FileRemapper.cpp?rev=247160&r1=247159&r2=247160&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/FileRemapper.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/FileRemapper.cpp Wed Sep  9 11:48:47 2015
@@ -144,7 +144,7 @@ bool FileRemapper::flushToFile(StringRef
       SmallString<64> tempPath;
       int fd;
       if (fs::createTemporaryFile(path::filename(origFE->getName()),
-                                  path::extension(origFE->getName()), fd,
+                                  path::extension(origFE->getName()).drop_front(), fd,
                                   tempPath))
         return report("Could not create file: " + tempPath.str(), Diag);
 

Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=247160&r1=247159&r2=247160&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Wed Sep  9 11:48:47 2015
@@ -2218,7 +2218,7 @@ static std::string applyEditsToTemp(cons
   SmallString<64> TempPath;
   int FD;
   if (fs::createTemporaryFile(path::filename(FE->getName()),
-                              path::extension(FE->getName()), FD,
+                              path::extension(FE->getName()).drop_front(), FD,
                               TempPath)) {
     reportDiag("Could not create file: " + TempPath.str(), Diag);
     return std::string();

Modified: cfe/trunk/lib/Frontend/Rewrite/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/FrontendActions.cpp?rev=247160&r1=247159&r2=247160&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Rewrite/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/Rewrite/FrontendActions.cpp Wed Sep  9 11:48:47 2015
@@ -78,7 +78,7 @@ public:
   std::string RewriteFilename(const std::string &Filename, int &fd) override {
     SmallString<128> Path;
     llvm::sys::fs::createTemporaryFile(llvm::sys::path::filename(Filename),
-                                       llvm::sys::path::extension(Filename), fd,
+                                       llvm::sys::path::extension(Filename).drop_front(), fd,
                                        Path);
     return Path.str();
   }




More information about the cfe-commits mailing list