aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Annotation.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-26 07:24:18 +0000
committerChris Lattner <sabre@nondot.org>2004-02-26 07:24:18 +0000
commit1cd4c7294c9873d7208aab5227bc27cdf8011b2e (patch)
tree61f5ebd3676781ad53c4743379c2aed6ddfb62c4 /lib/Support/Annotation.cpp
parentf2dbf50efa2690396e5e46c2a1a2ca80f4c701e9 (diff)
downloadexternal_llvm-1cd4c7294c9873d7208aab5227bc27cdf8011b2e.zip
external_llvm-1cd4c7294c9873d7208aab5227bc27cdf8011b2e.tar.gz
external_llvm-1cd4c7294c9873d7208aab5227bc27cdf8011b2e.tar.bz2
Make sure that at least one virtual method is defined in a .cpp file to avoid
having the compiler emit RTTI and vtables to EVERY translation unit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Annotation.cpp')
-rw-r--r--lib/Support/Annotation.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Support/Annotation.cpp b/lib/Support/Annotation.cpp
index bcd196d..45fd06f 100644
--- a/lib/Support/Annotation.cpp
+++ b/lib/Support/Annotation.cpp
@@ -15,6 +15,18 @@
#include "Support/Annotation.h"
using namespace llvm;
+Annotation::~Annotation() {} // Designed to be subclassed
+
+Annotable::~Annotable() { // Virtual because it's designed to be subclassed...
+ Annotation *A = AnnotationList;
+ while (A) {
+ Annotation *Next = A->getNext();
+ delete A;
+ A = Next;
+ }
+}
+
+
typedef std::map<const std::string, unsigned> IDMapType;
static unsigned IDCounter = 0; // Unique ID counter
@@ -41,7 +53,6 @@ static void eraseFromFactMap(unsigned ID) {
}
}
-
AnnotationID AnnotationManager::getID(const std::string &Name) { // Name -> ID
IDMapType::iterator I = getIDMap().find(Name);
if (I == getIDMap().end()) {