summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit120035898b43fa4858cd3e81516df24e0ba84974 (patch)
tree00721699f442deb8cde575ce7faea1526d8bc4a6 /llvm/lib/Support/Annotation.cpp
parent21e941fbfd927a1539e981e8ef67699e9fdc3cb8 (diff)
downloadbcm5719-llvm-120035898b43fa4858cd3e81516df24e0ba84974.tar.gz
bcm5719-llvm-120035898b43fa4858cd3e81516df24e0ba84974.zip
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. llvm-svn: 11871
Diffstat (limited to 'llvm/lib/Support/Annotation.cpp')
-rw-r--r--llvm/lib/Support/Annotation.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Support/Annotation.cpp b/llvm/lib/Support/Annotation.cpp
index bcd196da448..45fd06f92e2 100644
--- a/llvm/lib/Support/Annotation.cpp
+++ b/llvm/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()) {
OpenPOWER on IntegriCloud