Return const char* instead of std::string in Tool classes
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 6 May 2008 17:24:26 +0000 (17:24 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 6 May 2008 17:24:26 +0000 (17:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50733 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvmc2/Tool.h
utils/TableGen/LLVMCCConfigurationEmitter.cpp

index b0cd2373038b4ec2d6f5f8a50f2014b61269bc6d..0d907dd83a8235042278e9d078d321197012bb80 100644 (file)
@@ -34,10 +34,10 @@ namespace llvmcc {
     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;
index 48008f1065de506837485f17a2a23dcabc312b75..fe8e50695ca6c5fb55ea1a47b74bf616a5c9354f 100644 (file)
@@ -742,25 +742,25 @@ void EmitIsLastMethod (const ToolProperties& P, std::ostream& O) {
 
 // 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";
 }