diff options
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 6e46c4f701..9d2d46fa0c 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -159,14 +159,14 @@ void StringLiteral::DoDestroy(ASTContext &C) { Expr::DoDestroy(C); } -void StringLiteral::setStrData(ASTContext &C, const char *Str, unsigned Len) { +void StringLiteral::setString(ASTContext &C, llvm::StringRef Str) { if (StrData) C.Deallocate(const_cast<char*>(StrData)); - char *AStrData = new (C, 1) char[Len]; - memcpy(AStrData, Str, Len); + char *AStrData = new (C, 1) char[Str.size()]; + memcpy(AStrData, Str.data(), Str.size()); StrData = AStrData; - ByteLength = Len; + ByteLength = Str.size(); } /// getOpcodeStr - Turn an Opcode enum value into the punctuation char it |