llvm.org GIT mirror llvm / b96cb60
Return const char* instead of std::string in Tool classes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50733 91177308-0d34-0410-b5e6-96231b3b80d8 Mikhail Glushenkov 11 years ago
2 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3333 virtual Action GenerateAction (llvm::sys::Path const& inFile,
3434 llvm::sys::Path const& outFile) const = 0;
3535
36 virtual std::string Name() const = 0;
37 virtual std::string InputLanguage() const = 0;
38 virtual std::string OutputLanguage() const = 0;
39 virtual std::string OutputSuffix() const = 0;
36 virtual const char* Name() const = 0;
37 virtual const char* InputLanguage() const = 0;
38 virtual const char* OutputLanguage() const = 0;
39 virtual const char* OutputSuffix() const = 0;
4040
4141 virtual bool IsLast() const = 0;
4242 virtual bool IsJoin() const = 0;
741741
742742 // Emit static [Input,Output]Language() methods for Tool classes
743743 void EmitInOutLanguageMethods (const ToolProperties& P, std::ostream& O) {
744 O << Indent1 << "std::string InputLanguage() const {\n"
744 O << Indent1 << "const char* InputLanguage() const {\n"
745745 << Indent2 << "return \"" << P.InLanguage << "\";\n"
746746 << Indent1 << "}\n\n";
747747
748 O << Indent1 << "std::string OutputLanguage() const {\n"
748 O << Indent1 << "const char* OutputLanguage() const {\n"
749749 << Indent2 << "return \"" << P.OutLanguage << "\";\n"
750750 << Indent1 << "}\n\n";
751751 }
752752
753753 // Emit static [Input,Output]Language() methods for Tool classes
754754 void EmitOutputSuffixMethod (const ToolProperties& P, std::ostream& O) {
755 O << Indent1 << "std::string OutputSuffix() const {\n"
755 O << Indent1 << "const char* OutputSuffix() const {\n"
756756 << Indent2 << "return \"" << P.OutputSuffix << "\";\n"
757757 << Indent1 << "}\n\n";
758758 }
759759
760760 // Emit static Name() method for Tool classes
761761 void EmitNameMethod (const ToolProperties& P, std::ostream& O) {
762 O << Indent1 << "std::string Name() const {\n"
762 O << Indent1 << "const char* Name() const {\n"
763763 << Indent2 << "return \"" << P.Name << "\";\n"
764764 << Indent1 << "}\n\n";
765765 }