[llvm-commits] [llvm] r50733 - in /llvm/trunk: tools/llvmc2/Tool.h utils/TableGen/LLVMCCConfigurationEmitter.cpp

Mikhail Glushenkov foldr at codedgers.com
Tue May 6 10:24:27 PDT 2008


Author: foldr
Date: Tue May  6 12:24:26 2008
New Revision: 50733

URL: http://llvm.org/viewvc/llvm-project?rev=50733&view=rev
Log:
Return const char* instead of std::string in Tool classes

Modified:
    llvm/trunk/tools/llvmc2/Tool.h
    llvm/trunk/utils/TableGen/LLVMCCConfigurationEmitter.cpp

Modified: llvm/trunk/tools/llvmc2/Tool.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Tool.h?rev=50733&r1=50732&r2=50733&view=diff

==============================================================================
--- llvm/trunk/tools/llvmc2/Tool.h (original)
+++ llvm/trunk/tools/llvmc2/Tool.h Tue May  6 12:24:26 2008
@@ -34,10 +34,10 @@
     virtual Action GenerateAction (llvm::sys::Path const& inFile,
                                   llvm::sys::Path const& outFile) const = 0;
 
-    virtual std::string Name() const = 0;
-    virtual std::string InputLanguage() const = 0;
-    virtual std::string OutputLanguage() const = 0;
-    virtual std::string OutputSuffix() const = 0;
+    virtual const char* Name() const = 0;
+    virtual const char* InputLanguage() const = 0;
+    virtual const char* OutputLanguage() const = 0;
+    virtual const char* OutputSuffix() const = 0;
 
     virtual bool IsLast() const = 0;
     virtual bool IsJoin() const = 0;

Modified: llvm/trunk/utils/TableGen/LLVMCCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCCConfigurationEmitter.cpp?rev=50733&r1=50732&r2=50733&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCCConfigurationEmitter.cpp Tue May  6 12:24:26 2008
@@ -742,25 +742,25 @@
 
 // Emit static [Input,Output]Language() methods for Tool classes
 void EmitInOutLanguageMethods (const ToolProperties& P, std::ostream& O) {
-  O << Indent1 << "std::string InputLanguage() const {\n"
+  O << Indent1 << "const char* InputLanguage() const {\n"
     << Indent2 << "return \"" << P.InLanguage << "\";\n"
     << Indent1 << "}\n\n";
 
-  O << Indent1 << "std::string OutputLanguage() const {\n"
+  O << Indent1 << "const char* OutputLanguage() const {\n"
     << Indent2 << "return \"" << P.OutLanguage << "\";\n"
     << Indent1 << "}\n\n";
 }
 
 // Emit static [Input,Output]Language() methods for Tool classes
 void EmitOutputSuffixMethod (const ToolProperties& P, std::ostream& O) {
-  O << Indent1 << "std::string OutputSuffix() const {\n"
+  O << Indent1 << "const char* OutputSuffix() const {\n"
     << Indent2 << "return \"" << P.OutputSuffix << "\";\n"
     << Indent1 << "}\n\n";
 }
 
 // Emit static Name() method for Tool classes
 void EmitNameMethod (const ToolProperties& P, std::ostream& O) {
-  O << Indent1 << "std::string Name() const {\n"
+  O << Indent1 << "const char* Name() const {\n"
     << Indent2 << "return \"" << P.Name << "\";\n"
     << Indent1 << "}\n\n";
 }





More information about the llvm-commits mailing list