diff options
author | David Blaikie <dblaikie@gmail.com> | 2016-02-09 18:52:09 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2016-02-09 18:52:09 +0000 |
commit | 2eabcc988f636cd98e9bb2c5c5e3ad5913e7267c (patch) | |
tree | 5155a49f343e8e5b3726ffadc53f2165d4acf64c /clang/lib/Parse/ParseObjc.cpp | |
parent | cb1175c7db87175ce4231555ad9eb75b762bb0d1 (diff) | |
download | bcm5719-llvm-2eabcc988f636cd98e9bb2c5c5e3ad5913e7267c.tar.gz bcm5719-llvm-2eabcc988f636cd98e9bb2c5c5e3ad5913e7267c.zip |
Simplify EnterTokenStream API to make it more robust for memory management
While this won't help fix things like the bug that r260219 addressed, it
seems like good tidy up to have anyway.
(it might be nice if "makeArrayRef" always produced a MutableArrayRef &
let it decay to an ArrayRef when needed - then I'd use that for the
MutableArrayRefs in this patch)
If we had std::dynarray I'd use that instead of unique_ptr+size_t,
ideally (but then it'd have to be threaded down through the Preprocessor
all the way - no idea how painful that would be)
llvm-svn: 260246
Diffstat (limited to 'clang/lib/Parse/ParseObjc.cpp')
-rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 5cd7e7ab7e8..6a680907cce 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -3585,8 +3585,8 @@ void Parser::ParseLexedObjCMethodDefs(LexedMethod &LM, bool parseMethod) { // Append the current token at the end of the new token stream so that it // doesn't get lost. LM.Toks.push_back(Tok); - PP.EnterTokenStream(LM.Toks.data(), LM.Toks.size(), true, false); - + PP.EnterTokenStream(LM.Toks, true); + // Consume the previously pushed token. ConsumeAnyToken(/*ConsumeCodeCompletionTok=*/true); |