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.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index c22b0592218..4f3efa526c4 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -64,24 +64,16 @@ MacroInfo *Preprocessor::AllocateDeserializedMacroInfo(SourceLocation L,
DefMacroDirective *
Preprocessor::AllocateDefMacroDirective(MacroInfo *MI, SourceLocation Loc,
- unsigned ImportedFromModuleID,
- ArrayRef<unsigned> Overrides) {
- unsigned NumExtra = (ImportedFromModuleID ? 1 : 0) + Overrides.size();
- return new (BP.Allocate(sizeof(DefMacroDirective) +
- sizeof(unsigned) * NumExtra,
- llvm::alignOf<DefMacroDirective>()))
- DefMacroDirective(MI, Loc, ImportedFromModuleID, Overrides);
+ ModuleMacro *MM) {
+ if (MM) return DefMacroDirective::createImported(*this, MI, Loc, MM);
+ return new (BP) DefMacroDirective(MI, Loc);
}
UndefMacroDirective *
Preprocessor::AllocateUndefMacroDirective(SourceLocation UndefLoc,
- unsigned ImportedFromModuleID,
- ArrayRef<unsigned> Overrides) {
- unsigned NumExtra = (ImportedFromModuleID ? 1 : 0) + Overrides.size();
- return new (BP.Allocate(sizeof(UndefMacroDirective) +
- sizeof(unsigned) * NumExtra,
- llvm::alignOf<UndefMacroDirective>()))
- UndefMacroDirective(UndefLoc, ImportedFromModuleID, Overrides);
+ ModuleMacro *MM) {
+ if (MM) return UndefMacroDirective::createImported(*this, UndefLoc, MM);
+ return new (BP) UndefMacroDirective(UndefLoc);
}
VisibilityMacroDirective *
OpenPOWER on IntegriCloud