aboutsummaryrefslogtreecommitdiff
path: root/Lex/IdentifierTable.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-07 08:44:20 +0000
committerChris Lattner <sabre@nondot.org>2007-10-07 08:44:20 +0000
commitcc1a875f94630e58d24a55577ffbf0e89b7da8c7 (patch)
treeca4db3025d08d21df9879e6fe968f9eac07e51b0 /Lex/IdentifierTable.cpp
parent0edde55077cc3cb9fffeba19f5936f05a68c8e2b (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/IdentifierTable.cpp')
-rw-r--r--Lex/IdentifierTable.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/Lex/IdentifierTable.cpp b/Lex/IdentifierTable.cpp
index 865356c7f3..f0baa15516 100644
--- a/Lex/IdentifierTable.cpp
+++ b/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
//===----------------------------------------------------------------------===//