[llvm-commits] CVS: llvm/include/llvm/iOther.h iTerminators.h

Chris Lattner lattner at cs.uiuc.edu
Fri Oct 31 11:52:37 PST 2003


Changes in directory llvm/include/llvm:

iOther.h updated: 1.39 -> 1.40
iTerminators.h updated: 1.32 -> 1.33

---
Log message:

Constant pointer refs are causing these to fail unnecessarily, which is causing
a lot of code to be pessimized.  I hate CPRs.  :(


---
Diffs of the changes:  (+11 -15)

Index: llvm/include/llvm/iOther.h
diff -u llvm/include/llvm/iOther.h:1.39 llvm/include/llvm/iOther.h:1.40
--- llvm/include/llvm/iOther.h:1.39	Mon Oct 20 15:19:15 2003
+++ llvm/include/llvm/iOther.h	Fri Oct 31 11:51:02 2003
@@ -69,12 +69,10 @@
   virtual Instruction *clone() const { return new CallInst(*this); }
   bool mayWriteToMemory() const { return true; }
 
-  const Function *getCalledFunction() const {
-    return dyn_cast<Function>(Operands[0].get());
-  }
-  Function *getCalledFunction() {
-    return dyn_cast<Function>(Operands[0].get());
-  }
+  // FIXME: These methods should be inline once we eliminate
+  // ConstantPointerRefs!
+  const Function *getCalledFunction() const;
+  Function *getCalledFunction();
 
   // getCalledValue - Get a pointer to a method that is invoked by this inst.
   inline const Value *getCalledValue() const { return Operands[0]; }


Index: llvm/include/llvm/iTerminators.h
diff -u llvm/include/llvm/iTerminators.h:1.32 llvm/include/llvm/iTerminators.h:1.33
--- llvm/include/llvm/iTerminators.h:1.32	Mon Oct 20 15:19:15 2003
+++ llvm/include/llvm/iTerminators.h	Fri Oct 31 11:51:02 2003
@@ -214,15 +214,13 @@
 
   bool mayWriteToMemory() const { return true; }
 
-  // getCalledFunction - Return the function called, or null if this is an
-  // indirect function invocation...
-  //
-  inline const Function *getCalledFunction() const {
-    return dyn_cast<Function>(Operands[0].get());
-  }
-  inline Function *getCalledFunction() {
-    return dyn_cast<Function>(Operands[0].get());
-  }
+  /// getCalledFunction - Return the function called, or null if this is an
+  /// indirect function invocation... 
+  ///
+  /// FIXME: These should be inlined once we get rid of ConstantPointerRefs!
+  ///
+  const Function *getCalledFunction() const;
+  Function *getCalledFunction();
 
   // getCalledValue - Get a pointer to a function that is invoked by this inst.
   inline const Value *getCalledValue() const { return Operands[0]; }





More information about the llvm-commits mailing list