From c9d8bd8ed2a5aa8c7e0934e12fc0bf38c78646da Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 12 May 2017 23:40:52 +0000 Subject: Remove unused tracking of owning module for MacroInfo objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302966 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/MacroInfo.h | 21 --------------------- include/clang/Lex/Preprocessor.h | 15 --------------- 2 files changed, 36 deletions(-) (limited to 'include/clang/Lex') diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h index 44b7b2e4a4..7da1e7b41a 100644 --- a/include/clang/Lex/MacroInfo.h +++ b/include/clang/Lex/MacroInfo.h @@ -105,9 +105,6 @@ class MacroInfo { /// \brief Must warn if the macro is unused at the end of translation unit. bool IsWarnIfUnused : 1; - /// \brief Whether this macro info was loaded from an AST file. - bool FromASTFile : 1; - /// \brief Whether this macro was used as header guard. bool UsedForHeaderGuard : 1; @@ -264,34 +261,16 @@ public: IsDisabled = true; } - /// \brief Determine whether this macro info came from an AST file (such as - /// a precompiled header or module) rather than having been parsed. - bool isFromASTFile() const { return FromASTFile; } - /// \brief Determine whether this macro was used for a header guard. bool isUsedForHeaderGuard() const { return UsedForHeaderGuard; } void setUsedForHeaderGuard(bool Val) { UsedForHeaderGuard = Val; } - /// \brief Retrieve the global ID of the module that owns this particular - /// macro info. - unsigned getOwningModuleID() const { - if (isFromASTFile()) - return *(const unsigned *)(this + 1); - - return 0; - } - void dump() const; private: unsigned getDefinitionLengthSlow(const SourceManager &SM) const; - void setOwningModuleID(unsigned ID) { - assert(isFromASTFile()); - *(unsigned *)(this + 1) = ID; - } - friend class Preprocessor; }; diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 0e3f563785..114bf70ad5 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -644,14 +644,6 @@ class Preprocessor { /// of that list. MacroInfoChain *MIChainHead; - struct DeserializedMacroInfoChain { - MacroInfo MI; - unsigned OwningModuleID; // MUST be immediately after the MacroInfo object - // so it can be accessed by MacroInfo::getOwningModuleID(). - DeserializedMacroInfoChain *Next; - }; - DeserializedMacroInfoChain *DeserialMIChainHead; - void updateOutOfDateIdentifier(IdentifierInfo &II) const; public: @@ -1669,10 +1661,6 @@ public: /// \brief Allocate a new MacroInfo object with the provided SourceLocation. MacroInfo *AllocateMacroInfo(SourceLocation L); - /// \brief Allocate a new MacroInfo object loaded from an AST file. - MacroInfo *AllocateDeserializedMacroInfo(SourceLocation L, - unsigned SubModuleID); - /// \brief Turn the specified lexer token into a fully checked and spelled /// filename, e.g. as an operand of \#include. /// @@ -1764,9 +1752,6 @@ private: /// macro name. void updateModuleMacroInfo(const IdentifierInfo *II, ModuleMacroInfo &Info); - /// \brief Allocate a new MacroInfo object. - MacroInfo *AllocateMacroInfo(); - DefMacroDirective *AllocateDefMacroDirective(MacroInfo *MI, SourceLocation Loc); UndefMacroDirective *AllocateUndefMacroDirective(SourceLocation UndefLoc); -- cgit v1.2.3