From: Chris Lattner Date: Thu, 26 Feb 2004 08:08:38 +0000 (+0000) Subject: Annotations are evil. This makes Value not derive from Annotable, which makes X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c230978a82adff3ab9d6ae0426a942e431ce9c5e;p=oota-llvm.git Annotations are evil. This makes Value not derive from Annotable, which makes all dynamically allocated LLVM values 4 bytes smaller, eliminate some vtables, and make Value's destructor faster. This makes Function derive from Annotation now because it is the only core LLVM class that still has an annotation stuck onto it: MachineFunction. MachineFunction is obviously horrible and gross (like most other annotations), but will be the subject of refactorings later in the future. Besides many fewer Function objects are dynamically allocated that instructions blocks, constants, types, etc... :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11878 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 4dd791ec21c..e77ddfaccd7 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -21,6 +21,7 @@ #include "llvm/GlobalValue.h" #include "llvm/BasicBlock.h" #include "llvm/Argument.h" +#include "Support/Annotation.h" namespace llvm { @@ -44,7 +45,7 @@ template<> struct ilist_traits static iplist &getList(Function *F); }; -class Function : public GlobalValue { +class Function : public GlobalValue, public Annotable { public: typedef iplist ArgumentListType; typedef iplist BasicBlockListType; diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 319115375dd..3a58a44da9e 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -19,7 +19,6 @@ #include "llvm/AbstractTypeUser.h" #include "llvm/Use.h" -#include "Support/Annotation.h" #include "Support/Casting.h" #include @@ -42,7 +41,7 @@ class SymbolTable; /// Value - The base class of all values computed by a program that may be used /// as operands to other values. /// -struct Value : public Annotable { // Values are annotable +struct Value { enum ValueTy { TypeVal, // This is an instance of Type ConstantVal, // This is an instance of Constant