[llvm-commits] CVS: llvm/include/llvm/Function.h Value.h

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 26 02:09:00 PST 2004


Changes in directory llvm/include/llvm:

Function.h updated: 1.49 -> 1.50
Value.h updated: 1.49 -> 1.50

---
Log message:

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... :)



---
Diffs of the changes:  (+3 -3)

Index: llvm/include/llvm/Function.h
diff -u llvm/include/llvm/Function.h:1.49 llvm/include/llvm/Function.h:1.50
--- llvm/include/llvm/Function.h:1.49	Tue Nov 11 16:41:29 2003
+++ llvm/include/llvm/Function.h	Thu Feb 26 02:08:38 2004
@@ -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 @@
   static iplist<Argument> &getList(Function *F);
 };
 
-class Function : public GlobalValue {
+class Function : public GlobalValue, public Annotable {
 public:
   typedef iplist<Argument> ArgumentListType;
   typedef iplist<BasicBlock> BasicBlockListType;


Index: llvm/include/llvm/Value.h
diff -u llvm/include/llvm/Value.h:1.49 llvm/include/llvm/Value.h:1.50
--- llvm/include/llvm/Value.h:1.49	Sat Jan 10 15:40:29 2004
+++ llvm/include/llvm/Value.h	Thu Feb 26 02:08:38 2004
@@ -19,7 +19,6 @@
 
 #include "llvm/AbstractTypeUser.h"
 #include "llvm/Use.h"
-#include "Support/Annotation.h"
 #include "Support/Casting.h"
 #include <iostream>
 
@@ -42,7 +41,7 @@
 /// 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





More information about the llvm-commits mailing list