diff options
Diffstat (limited to 'clang/lib/Lex/MacroInfo.cpp')
-rw-r--r-- | clang/lib/Lex/MacroInfo.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/Lex/MacroInfo.cpp b/clang/lib/Lex/MacroInfo.cpp index d7f483192f1..dbc804490b2 100644 --- a/clang/lib/Lex/MacroInfo.cpp +++ b/clang/lib/Lex/MacroInfo.cpp @@ -235,6 +235,25 @@ void MacroDirective::dump() const { Out << "\n"; } +DefMacroDirective * +DefMacroDirective::createImported(Preprocessor &PP, MacroInfo *MI, + SourceLocation Loc, + ModuleMacro *ImportedFrom) { + void *Mem = PP.getPreprocessorAllocator().Allocate( + sizeof(DefMacroDirective) + sizeof(MacroDirective::ImportData), + llvm::alignOf<DefMacroDirective>()); + return new (Mem) DefMacroDirective(MI, Loc, ImportedFrom); +} + +UndefMacroDirective * +UndefMacroDirective::createImported(Preprocessor &PP, SourceLocation Loc, + ModuleMacro *ImportedFrom) { + void *Mem = PP.getPreprocessorAllocator().Allocate( + sizeof(UndefMacroDirective) + sizeof(MacroDirective::ImportData), + llvm::alignOf<UndefMacroDirective>()); + return new (Mem) UndefMacroDirective(Loc, ImportedFrom); +} + ModuleMacro *ModuleMacro::create(Preprocessor &PP, Module *OwningModule, IdentifierInfo *II, MacroInfo *Macro, ArrayRef<ModuleMacro *> Overrides) { |