From 82072d47436a8e150bad42c9c3bf230617d53608 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 9 Sep 2001 21:02:38 +0000 Subject: [PATCH] Clean up Type class by removing mutable ConstRules member and use annotations insead git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@516 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Annotation.cpp | 10 ++++++++++ lib/VMCore/Type.cpp | 1 - support/lib/Support/Annotation.cpp | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/Support/Annotation.cpp b/lib/Support/Annotation.cpp index fabf34b2db7..65a049d42dc 100644 --- a/lib/Support/Annotation.cpp +++ b/lib/Support/Annotation.cpp @@ -28,6 +28,16 @@ AnnotationID AnnotationManager::getID(const string &Name) { // Name -> ID return I->second; } +// getID - Name -> ID + registration of a factory function for demand driven +// annotation support. +AnnotationID AnnotationManager::getID(const string &Name, Factory Fact, + void *Data=0) { + AnnotationID Result(getID(Name)); + registerAnnotationFactory(Result, Fact, Data); + return Result; +} + + // getName - This function is especially slow, but that's okay because it should // only be used for debugging. // diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 033ca952c4c..87fa581a573 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -29,7 +29,6 @@ Type::Type(const string &name, PrimitiveID id) setDescription(name); ID = id; Abstract = false; - ConstRulesImpl = 0; UID = CurUID++; // Assign types UID's as they are created UIDMappings.push_back(this); } diff --git a/support/lib/Support/Annotation.cpp b/support/lib/Support/Annotation.cpp index fabf34b2db7..65a049d42dc 100644 --- a/support/lib/Support/Annotation.cpp +++ b/support/lib/Support/Annotation.cpp @@ -28,6 +28,16 @@ AnnotationID AnnotationManager::getID(const string &Name) { // Name -> ID return I->second; } +// getID - Name -> ID + registration of a factory function for demand driven +// annotation support. +AnnotationID AnnotationManager::getID(const string &Name, Factory Fact, + void *Data=0) { + AnnotationID Result(getID(Name)); + registerAnnotationFactory(Result, Fact, Data); + return Result; +} + + // getName - This function is especially slow, but that's okay because it should // only be used for debugging. // -- 2.34.1