[PATCH] D12627: Fix a small bug in clang where generating some temporary files would have an extra period before the extension.

Cameron Esfahani via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 22:16:31 PDT 2015


dirty created this revision.
dirty added a reviewer: akyrtzi.
dirty added a subscriber: cfe-commits.

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

http://reviews.llvm.org/D12627

Files:
  lib/ARCMigrate/FileRemapper.cpp
  lib/ARCMigrate/ObjCMT.cpp
  lib/Frontend/Rewrite/FrontendActions.cpp

Index: lib/Frontend/Rewrite/FrontendActions.cpp
===================================================================
--- lib/Frontend/Rewrite/FrontendActions.cpp
+++ lib/Frontend/Rewrite/FrontendActions.cpp
@@ -78,7 +78,7 @@
   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();
   }
Index: lib/ARCMigrate/ObjCMT.cpp
===================================================================
--- lib/ARCMigrate/ObjCMT.cpp
+++ lib/ARCMigrate/ObjCMT.cpp
@@ -2218,7 +2218,7 @@
   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();
Index: lib/ARCMigrate/FileRemapper.cpp
===================================================================
--- lib/ARCMigrate/FileRemapper.cpp
+++ lib/ARCMigrate/FileRemapper.cpp
@@ -144,7 +144,7 @@
       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);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12627.34013.patch
Type: text/x-patch
Size: 1834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150904/92785d49/attachment.bin>


More information about the cfe-commits mailing list