Use std::string instead of llvm::StringRef to avoid dangling ref.

Per Chris's comment.

llvm-svn: 112979
This commit is contained in:
Fariborz Jahanian 2010-09-03 18:01:09 +00:00
parent 4583827e13
commit dadfc1c144
1 changed files with 1 additions and 1 deletions

View File

@ -599,7 +599,7 @@ IdentifierInfo *Parser::ParseObjCSelectorPiece(SourceLocation &SelectorLoc) {
case tok::pipeequal:
case tok::caret:
case tok::caretequal: {
llvm::StringRef ThisTok = PP.getSpelling(Tok);
std::string ThisTok(PP.getSpelling(Tok));
if (isalpha(ThisTok[0])) {
IdentifierInfo *II = &PP.getIdentifierTable().get(ThisTok.data());
Tok.setKind(tok::identifier);