1 //===-- ExecutionAnnotations.h ---------------------------------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header file defines annotations used by the execution engine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLI_EXECUTION_ANNOTATIONS_H
15 #define LLI_EXECUTION_ANNOTATIONS_H
17 //===----------------------------------------------------------------------===//
18 // Support for FunctionInfo annotations
19 //===----------------------------------------------------------------------===//
21 // This annotation (attached only to Function objects) is used to cache useful
22 // information about the function, including the number of types present in the
23 // function, and the number of values for each type.
26 FunctionInfo(Function *F);
27 std::vector<unsigned> NumPlaneElements;
30 unsigned getValueSlot(const Value *V);
33 //===----------------------------------------------------------------------===//
34 // Support for the SlotNumber annotation
35 //===----------------------------------------------------------------------===//
37 // This annotation (attached only to Argument & Instruction objects) is used to
38 // hold the the slot number for the value in its type plane.
40 // Entities have this annotation attached to them when the containing
41 // function has it's FunctionInfo created (by the FunctionInfo ctor).
43 static AnnotationID SlotNumberAID(
44 AnnotationManager::getID("Interpreter::SlotNumber"));
46 struct SlotNumber : public Annotation {
47 unsigned SlotNum; // Ranges from 0->
49 SlotNumber(unsigned sn) : Annotation(SlotNumberAID),
53 //===----------------------------------------------------------------------===//
54 // Support for the InstNumber annotation
55 //===----------------------------------------------------------------------===//
57 // This annotation (attached only to Instruction objects) is used to hold the
58 // instruction number of the instruction, and the slot number for the value in
59 // its type plane. InstNumber's are used for user interaction, and for
60 // calculating which value slot to store the result of the instruction in.
62 // Instructions have this annotation attached to them when the containing
63 // function has it's FunctionInfo created (by the FunctionInfo ctor).
65 struct InstNumber : public SlotNumber {
66 unsigned InstNum; // Ranges from 1->
68 InstNumber(unsigned in, unsigned sn) : SlotNumber(sn), InstNum(in) {}