summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-05-17 04:53:25 +0000
committerAlp Toker <alp@nuanti.com>2014-05-17 04:53:25 +0000
commit2d57cea25688fc3372467ee97505ed07d8474d48 (patch)
treeefe2fab72e9981b40469865ef663b56ae7cb8db8 /clang/lib/Lex/Lexer.cpp
parentec2748a8ad62769ff1a76d6ba2e57c17e888ded7 (diff)
downloadbcm5719-llvm-2d57cea25688fc3372467ee97505ed07d8474d48.tar.gz
bcm5719-llvm-2d57cea25688fc3372467ee97505ed07d8474d48.zip
Provide and use a safe Token::getRawIdentifier() accessor
llvm-svn: 209061
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r--clang/lib/Lex/Lexer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 0955cc5b335..2e859d663ff 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -382,7 +382,7 @@ unsigned Lexer::getSpelling(const Token &Tok, const char *&Buffer,
const char *TokStart = 0;
// NOTE: this has to be checked *before* testing for an IdentifierInfo.
if (Tok.is(tok::raw_identifier))
- TokStart = Tok.getRawIdentifierData();
+ TokStart = Tok.getRawIdentifier().data();
else if (!Tok.hasUCN()) {
if (const IdentifierInfo *II = Tok.getIdentifierInfo()) {
// Just return the string from the identifier table, which is very quick.
@@ -637,8 +637,7 @@ Lexer::ComputePreamble(const llvm::MemoryBuffer *Buffer,
// the raw identifier to recognize and categorize preprocessor directives.
TheLexer.LexFromRawLexer(TheTok);
if (TheTok.getKind() == tok::raw_identifier && !TheTok.needsCleaning()) {
- StringRef Keyword(TheTok.getRawIdentifierData(),
- TheTok.getLength());
+ StringRef Keyword = TheTok.getRawIdentifier();
PreambleDirectiveKind PDK
= llvm::StringSwitch<PreambleDirectiveKind>(Keyword)
.Case("include", PDK_Skipped)
OpenPOWER on IntegriCloud