[modules] Actually allocate the extra space we use for the tail-allocated array

in this class.

llvm-svn: 235570
This commit is contained in:
Richard Smith 2015-04-23 04:13:52 +00:00
parent 8c80e7420a
commit 447ed43cc1
1 changed files with 5 additions and 3 deletions

View File

@ -237,7 +237,9 @@ void MacroDirective::dump() const {
ModuleMacro *ModuleMacro::create(Preprocessor &PP, unsigned OwningModuleID,
IdentifierInfo *II, MacroInfo *Macro,
ArrayRef<ModuleMacro*> Overrides) {
return new (PP.getPreprocessorAllocator())
ModuleMacro(OwningModuleID, II, Macro, Overrides);
ArrayRef<ModuleMacro *> Overrides) {
void *Mem = PP.getPreprocessorAllocator().Allocate(
sizeof(ModuleMacro) + sizeof(ModuleMacro *) * Overrides.size(),
llvm::alignOf<ModuleMacro>());
return new (Mem) ModuleMacro(OwningModuleID, II, Macro, Overrides);
}