From 6d5038c19c1ed84d3a3a0d6cc7011933d927d1dd Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 29 Aug 2014 19:36:52 +0000 Subject: unique_ptrify Preprocessor's TokenLexerCache llvm-svn: 216756 --- clang/lib/Lex/Preprocessor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/Lex/Preprocessor.cpp') diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index faf5bbb38b9..2c23d682820 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -151,8 +151,7 @@ Preprocessor::~Preprocessor() { // Free any cached macro expanders. // This populates MacroArgCache, so all TokenLexers need to be destroyed // before the code below that frees up the MacroArgCache list. - for (unsigned i = 0, e = NumCachedTokenLexers; i != e; ++i) - delete TokenLexerCache[i]; + std::fill(TokenLexerCache, TokenLexerCache + NumCachedTokenLexers, nullptr); CurTokenLexer.reset(); while (DeserializedMacroInfoChain *I = DeserialMIChainHead) { -- cgit v1.2.3