diff options
author | Chris Lattner <sabre@nondot.org> | 2007-10-07 08:44:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-10-07 08:44:20 +0000 |
commit | c43ddc84a3d2b947ec79d1eb3f73ebb68594bccb (patch) | |
tree | 26fb2750d81acb07fbcb39848ece7824291f20b3 /clang/Lex/IdentifierTable.cpp | |
parent | 259716a6e118cd93a64c2a896041b152f9ac5c24 (diff) | |
download | bcm5719-llvm-c43ddc84a3d2b947ec79d1eb3f73ebb68594bccb.tar.gz bcm5719-llvm-c43ddc84a3d2b947ec79d1eb3f73ebb68594bccb.zip |
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
Diffstat (limited to 'clang/Lex/IdentifierTable.cpp')
-rw-r--r-- | clang/Lex/IdentifierTable.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
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<const IdentifierInfo*, MacroInfo*> 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 //===----------------------------------------------------------------------===// |