[llvm-commits] CVS: llvm/tools/gccld/gccld.cpp

Reid Spencer reid at x10sys.com
Thu Dec 16 15:04:31 PST 2004



Changes in directory llvm/tools/gccld:

gccld.cpp updated: 1.90 -> 1.91
---
Log message:

For PR351: http://llvm.cs.uiuc.edu/PR351 :
* removeFile() -> sys::Path::destroyFile()
* remove extraneous toString() calls
* convert local variables representing path names from std::string to
  sys::Path
* Use sys::Path objects with FileRemove instead of std::string
* Use sys::Path methods for construction of path names 


---
Diffs of the changes:  (+13 -10)

Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.90 llvm/tools/gccld/gccld.cpp:1.91
--- llvm/tools/gccld/gccld.cpp:1.90	Mon Dec 13 22:20:07 2004
+++ llvm/tools/gccld/gccld.cpp	Thu Dec 16 17:04:20 2004
@@ -276,10 +276,11 @@
       // Otherwise, create a script that will run the bytecode through the JIT.
       if (Native) {
         // Name of the Assembly Language output file
-        std::string AssemblyFile = OutputFilename + ".s";
+        sys::Path AssemblyFile ( OutputFilename);
+        AssemblyFile.appendSuffix("s");
 
         // Mark the output files for removal if we get an interrupt.
-        sys::RemoveFileOnSignal(sys::Path(AssemblyFile));
+        sys::RemoveFileOnSignal(AssemblyFile);
         sys::RemoveFileOnSignal(sys::Path(OutputFilename));
 
         // Determine the locations of the llc and gcc programs.
@@ -293,17 +294,19 @@
 
         // Generate an assembly language file for the bytecode.
         if (Verbose) std::cout << "Generating Assembly Code\n";
-        GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc);
+        GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc);
         if (Verbose) std::cout << "Generating Native Code\n";
-        GenerateNative(OutputFilename, AssemblyFile, Libraries, gcc, envp );
+        GenerateNative(OutputFilename, AssemblyFile.toString(), 
+                       Libraries, gcc, envp );
 
         // Remove the assembly language file.
-        removeFile (AssemblyFile);
+        AssemblyFile.destroyFile();;
       } else if (NativeCBE) {
-        std::string CFile = OutputFilename + ".cbe.c";
+        sys::Path CFile (OutputFilename);
+        CFile.appendSuffix("cbe.c");
 
         // Mark the output files for removal if we get an interrupt.
-        sys::RemoveFileOnSignal(sys::Path(CFile));
+        sys::RemoveFileOnSignal(CFile);
         sys::RemoveFileOnSignal(sys::Path(OutputFilename));
 
         // Determine the locations of the llc and gcc programs.
@@ -317,12 +320,12 @@
 
         // Generate an assembly language file for the bytecode.
         if (Verbose) std::cout << "Generating Assembly Code\n";
-        GenerateCFile(CFile, RealBytecodeOutput, llc);
+        GenerateCFile(CFile.toString(), RealBytecodeOutput, llc);
         if (Verbose) std::cout << "Generating Native Code\n";
-        GenerateNative(OutputFilename, CFile, Libraries, gcc, envp );
+        GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp );
 
         // Remove the assembly language file.
-        removeFile(CFile);
+        CFile.destroyFile();
 
       } else {
         EmitShellScript(argv);






More information about the llvm-commits mailing list