summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 5e3b16e60de..ffdc6ae5894 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -33,8 +33,12 @@ MacroInfo *Preprocessor::AllocateMacroInfo() {
if (!MICache.empty()) {
MI = MICache.back();
MICache.pop_back();
- } else
- MI = (MacroInfo*) BP.Allocate<MacroInfo>();
+ } else {
+ MacroInfoChain *MIChain = BP.Allocate<MacroInfoChain>();
+ MIChain->Next = MIChainHead;
+ MIChainHead = MIChain;
+ MI = &(MIChainHead->MI);
+ }
return MI;
}
OpenPOWER on IntegriCloud