summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r--clang/lib/Lex/MacroInfo.cpp21
-rw-r--r--clang/lib/Lex/PPDirectives.cpp9
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp2
3 files changed, 1 insertions, 31 deletions
diff --git a/clang/lib/Lex/MacroInfo.cpp b/clang/lib/Lex/MacroInfo.cpp
index dbc804490b2..7581fe3cd7a 100644
--- a/clang/lib/Lex/MacroInfo.cpp
+++ b/clang/lib/Lex/MacroInfo.cpp
@@ -218,8 +218,6 @@ void MacroDirective::dump() const {
if (auto *Prev = getPrevious())
Out << " prev " << Prev;
if (IsFromPCH) Out << " from_pch";
- if (IsImported) Out << " imported";
- if (IsAmbiguous) Out << " ambiguous";
if (IsPublic)
Out << " public";
@@ -235,25 +233,6 @@ 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) {
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 6c25bd87a27..1c66aac533b 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -78,15 +78,6 @@ Preprocessor::AllocateVisibilityMacroDirective(SourceLocation Loc,
return new (BP) VisibilityMacroDirective(Loc, isPublic);
}
-MacroDirective *
-Preprocessor::AllocateImportedMacroDirective(ModuleMacro *MM,
- SourceLocation Loc) {
- if (auto *MI = MM->getMacroInfo())
- return DefMacroDirective::createImported(*this, MI, Loc, MM);
- else
- return UndefMacroDirective::createImported(*this, Loc, MM);
-}
-
/// \brief Read and discard all tokens remaining on the current line until
/// the tok::eod token is found.
void Preprocessor::DiscardUntilEndOfDirective() {
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index cc8b7fe6dbd..0aff712abbc 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -55,7 +55,7 @@ void Preprocessor::appendMacroDirective(IdentifierInfo *II, MacroDirective *MD){
II->setHasMacroDefinition(true);
if (!MD->isDefined() && LeafModuleMacros.find(II) == LeafModuleMacros.end())
II->setHasMacroDefinition(false);
- if (II->isFromAST() && !MD->isImported())
+ if (II->isFromAST())
II->setChangedSinceDeserialization();
}
OpenPOWER on IntegriCloud