Use StringRef instead of std::string in DIEString.
authorDevang Patel <dpatel@apple.com>
Tue, 24 Nov 2009 19:42:17 +0000 (19:42 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 24 Nov 2009 19:42:17 +0000 (19:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89793 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/DIE.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h

index 0a4d9bd7da7bf6bddef03a7b0358929f81dc2c26..9a07e31ac70b03e6bebc5e304ebab225444cc3ef 100644 (file)
@@ -297,7 +297,7 @@ namespace llvm {
     /// EmitString - Emit a string with quotes and a null terminator.
     /// Special characters are emitted properly.
     /// @verbatim (Eg. '\t') @endverbatim
-    void EmitString(const std::string &String) const;
+    void EmitString(const StringRef String) const;
     void EmitString(const char *String, unsigned Size) const;
 
     /// EmitFile - Emit a .file directive.
index 8eae7b23a02fcb8400967efd8daa330ed7586853..993cdbfb76c78b82f43c6e7a871eddfc7bea7d28 100644 (file)
@@ -728,7 +728,7 @@ static void printStringChar(formatted_raw_ostream &O, unsigned char C) {
 /// EmitString - Emit a string with quotes and a null terminator.
 /// Special characters are emitted properly.
 /// \literal (Eg. '\t') \endliteral
-void AsmPrinter::EmitString(const std::string &String) const {
+void AsmPrinter::EmitString(const StringRef String) const {
   EmitString(String.data(), String.size());
 }
 
index d073da7d1b881f9ed975305eba01bf65e2ca1761..dc6a70a6bd6a3cf8c199158e3608031a4bdfc5ba 100644 (file)
@@ -277,9 +277,9 @@ namespace llvm {
   /// DIEString - A string value DIE.
   ///
   class DIEString : public DIEValue {
-    const std::string Str;
+    const StringRef Str;
   public:
-    explicit DIEString(const std::string &S) : DIEValue(isString), Str(S) {}
+    explicit DIEString(const StringRef S) : DIEValue(isString), Str(S) {}
 
     /// EmitValue - Emit string value.
     ///
index 4ba156c6a235b4a73d8ddebcdcf09b22cee954e3..f8873a4d941f6bfe69a9ed03c6d994504de65ba5 100644 (file)
@@ -333,7 +333,7 @@ void DwarfDebug::addSInt(DIE *Die, unsigned Attribute,
 /// addString - Add a string attribute data and value.
 ///
 void DwarfDebug::addString(DIE *Die, unsigned Attribute, unsigned Form,
-                           const std::string &String) {
+                           const StringRef String) {
   DIEValue *Value = new DIEString(String);
   DIEValues.push_back(Value);
   Die->addValue(Attribute, Form, Value);
index 01d0e3c749864b85a22d6876c334b71a71ddfba8..19583b84c5ffe8812b2a66b98b34c6ed97d38486 100644 (file)
@@ -244,7 +244,7 @@ class DwarfDebug : public Dwarf {
   /// addString - Add a string attribute data and value.
   ///
   void addString(DIE *Die, unsigned Attribute, unsigned Form,
-                 const std::string &String);
+                 const StringRef Str);
 
   /// addLabel - Add a Dwarf label attribute data and value.
   ///