aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/StringRef.h2
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h
index 6b17eb22de..b6486e7676 100644
--- a/include/llvm/ADT/StringRef.h
+++ b/include/llvm/ADT/StringRef.h
@@ -56,7 +56,7 @@ namespace llvm {
/// Construct a string ref from an std::string.
/*implicit*/ StringRef(const std::string &Str)
- : Data(Str.c_str()), Length(Str.length()) {}
+ : Data(Str.data()), Length(Str.length()) {}
/// @}
/// @name Iterators
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 9bac860013..7c5c23b268 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -729,7 +729,7 @@ static void printStringChar(formatted_raw_ostream &O, unsigned char C) {
/// Special characters are emitted properly.
/// \literal (Eg. '\t') \endliteral
void AsmPrinter::EmitString(const std::string &String) const {
- EmitString(String.c_str(), String.size());
+ EmitString(String.data(), String.size());
}
void AsmPrinter::EmitString(const char *String, unsigned Size) const {