aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-29 19:36:52 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-29 19:36:52 +0000
commit6d5038c19c1ed84d3a3a0d6cc7011933d927d1dd (patch)
tree01b9a3f03a893caf8b188d38c107472c0cf77822 /clang/lib/Lex/Preprocessor.cpp
parente90195c09b20d3d49c346ee6bc0f62e505cc5573 (diff)
downloadllvm-6d5038c19c1ed84d3a3a0d6cc7011933d927d1dd.zip
llvm-6d5038c19c1ed84d3a3a0d6cc7011933d927d1dd.tar.gz
llvm-6d5038c19c1ed84d3a3a0d6cc7011933d927d1dd.tar.bz2
unique_ptrify Preprocessor's TokenLexerCache
llvm-svn: 216756
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index faf5bbb..2c23d682 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) {