diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-22 03:27:33 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-22 03:27:33 +0000 |
commit | b648023da23e8b227cdda57a241db4c6f368726b (patch) | |
tree | fbbeaee2056090e3c1c44b519ec6f20f31814bf9 /lib/AST/Expr.cpp | |
parent | 3f066522342538509cf0aa4f381503b43fbdb68b (diff) |
Add StringLiteral::getString -> StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82514 91177308-0d34-0410-b5e6-96231b3b80d8
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 |