Handle value promotion properly to work with tracing better
[oota-llvm.git] / lib / ExecutionEngine / Interpreter / ExecutionAnnotations.h
index e03c24cc046ccf687a81d6112643296ede232fcb..1a5c7fee9803ae0418d32733c3942c0698d91815 100644 (file)
 // Support for MethodInfo annotations
 //===----------------------------------------------------------------------===//
 
-// This annotation (attached only to Method objects) is used to cache useful
-// information about the method, including the number of types present in the
-// method, and the number of values for each type.
+// This annotation (attached only to Function objects) is used to cache useful
+// information about the function, including the number of types present in the
+// function, and the number of values for each type.
 //
 // This annotation object is created on demand, and attaches other annotation
-// objects to the instructions in the method when it's created.
+// objects to the instructions in the function when it's created.
 //
 static AnnotationID MethodInfoAID(
-                   AnnotationManager::getID("Interpreter::MethodInfo"));
+                   AnnotationManager::getID("Interpreter::FunctionInfo"));
 
 struct MethodInfo : public Annotation {
-  MethodInfo(Method *M);
-  vector<unsigned> NumPlaneElements;
+  MethodInfo(Function *F);
+  std::vector<unsigned> NumPlaneElements;
+
+
+  // Create - Factory function to allow MethodInfo annotations to be
+  // created on demand.
+  //
+  static Annotation *Create(AnnotationID AID, const Annotable *O, void *) {
+    assert(AID == MethodInfoAID);
+    return new MethodInfo(cast<Function>((Value*)O));  // Simply invoke the ctor
+  }
 
 private:
   unsigned getValueSlot(const Value *V);
 };
 
-// CreateMethodInfo - Factory function to allow MethodInfo annotations to be
-// created on demand.
-//
-inline static Annotation *CreateMethodInfo(AnnotationID AID, Annotable *O,
-                                          void *) {
-  assert(AID == MethodInfoAID);
-  return new MethodInfo((Method*)O);  // Simply invoke the ctor
-}
-
 
 //===----------------------------------------------------------------------===//
 // Support for the SlotNumber annotation
 //===----------------------------------------------------------------------===//
 
-// This annotation (attached only to MethodArgument & Instruction objects) is
-// used to hold the the slot number for the value in its type plane.
+// This annotation (attached only to Argument & Instruction objects) is used to
+// hold the the slot number for the value in its type plane.
 //
 // Entities have this annotation attached to them when the containing
-// method has it's MethodInfo created (by the MethodInfo ctor).
+// function has it's MethodInfo created (by the MethodInfo ctor).
 //
 static AnnotationID SlotNumberAID(
                    AnnotationManager::getID("Interpreter::SlotNumber"));
@@ -71,8 +71,8 @@ struct SlotNumber : public Annotation {
 // its type plane.  InstNumber's are used for user interaction, and for
 // calculating which value slot to store the result of the instruction in.
 //
-// Instructions have this annotation attached to them when the containing method
-// has it's MethodInfo created (by the MethodInfo ctor).
+// Instructions have this annotation attached to them when the containing
+// function has it's MethodInfo created (by the MethodInfo ctor).
 //
 struct InstNumber : public SlotNumber {
   unsigned InstNum;   // Ranges from 1->
@@ -89,4 +89,5 @@ static AnnotationID BreakpointAID(
                    AnnotationManager::getID("Interpreter::Breakpoint"));
 // Just use an Annotation directly, Breakpoint is currently just a marker
 
+
 #endif