From c43ddc84a3d2b947ec79d1eb3f73ebb68594bccb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 7 Oct 2007 08:44:20 +0000 Subject: improve layering: Now instead of IdentifierInfo knowing anything about MacroInfo, only the preprocessor knows. This makes MacroInfo truly private to the Lex library (and its direct clients) instead of being accessed in the Basic library. llvm-svn: 42727 --- clang/Lex/IdentifierTable.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'clang/Lex/IdentifierTable.cpp') diff --git a/clang/Lex/IdentifierTable.cpp b/clang/Lex/IdentifierTable.cpp index 865356c7f3d..f0baa155168 100644 --- a/clang/Lex/IdentifierTable.cpp +++ b/clang/Lex/IdentifierTable.cpp @@ -13,34 +13,18 @@ //===----------------------------------------------------------------------===// #include "clang/Lex/IdentifierTable.h" -#include "clang/Lex/MacroInfo.h" #include "clang/Basic/LangOptions.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/DenseMap.h" using namespace clang; -static llvm::DenseMap Macros; - -MacroInfo *IdentifierInfo::getMacroInfoInternal() const { - return Macros[this]; -} -void IdentifierInfo::setMacroInfo(MacroInfo *I) { - if (I == 0) { - if (HasMacro) { - Macros.erase(this); - HasMacro = false; - } - } else { - Macros[this] = I; - HasMacro = true; - } -} - - //===----------------------------------------------------------------------===// // Token Implementation //===----------------------------------------------------------------------===// +// FIXME: Move this elsewhere! +#include "clang/Lex/Token.h" + /// isObjCAtKeyword - Return true if we have an ObjC keyword identifier. bool Token::isObjCAtKeyword(tok::ObjCKeywordKind objcKey) const { return getKind() == tok::identifier && @@ -70,11 +54,6 @@ IdentifierInfo::IdentifierInfo() { FETokenInfo = 0; } -IdentifierInfo::~IdentifierInfo() { - if (MacroInfo *Macro = getMacroInfo()) - delete Macro; -} - //===----------------------------------------------------------------------===// // IdentifierTable Implementation //===----------------------------------------------------------------------===// -- cgit v1.2.3