From 2eabcc988f636cd98e9bb2c5c5e3ad5913e7267c Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 9 Feb 2016 18:52:09 +0000 Subject: 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 --- clang/lib/Rewrite/HTMLRewrite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Rewrite') diff --git a/clang/lib/Rewrite/HTMLRewrite.cpp b/clang/lib/Rewrite/HTMLRewrite.cpp index 275fbd0ebca..2d82d8fd4bd 100644 --- a/clang/lib/Rewrite/HTMLRewrite.cpp +++ b/clang/lib/Rewrite/HTMLRewrite.cpp @@ -502,7 +502,7 @@ void html::HighlightMacros(Rewriter &R, FileID FID, const Preprocessor& PP) { // Enter the tokens we just lexed. This will cause them to be macro expanded // but won't enter sub-files (because we removed #'s). - TmpPP.EnterTokenStream(&TokenStream[0], TokenStream.size(), false, false); + TmpPP.EnterTokenStream(TokenStream, false); TokenConcatenation ConcatInfo(TmpPP); -- cgit v1.2.3