[llvm-commits] CVS: reopt/lib/LightWtProfiling/TraceOptEmitter.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Tue Apr 13 16:30:13 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

TraceOptEmitter.cpp updated: 1.1 -> 1.2

---
Log message:

Constify the TargetData object that we're using.
Add a comment about stubs.


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

Index: reopt/lib/LightWtProfiling/TraceOptEmitter.cpp
diff -u reopt/lib/LightWtProfiling/TraceOptEmitter.cpp:1.1 reopt/lib/LightWtProfiling/TraceOptEmitter.cpp:1.2
--- reopt/lib/LightWtProfiling/TraceOptEmitter.cpp:1.1	Mon Apr 12 15:57:43 2004
+++ reopt/lib/LightWtProfiling/TraceOptEmitter.cpp	Tue Apr 13 16:29:44 2004
@@ -10,6 +10,10 @@
 // The trace reoptimizer uses this MachineCodeEmitter to output
 // optimized machine code to memory, so that it can be executed instead of
 // the corresponding unoptimized code.
+//
+// We do not need to support function stubs in this Emitter because
+// with the current Reoptimizer, there can never be any references in a
+// trace to functions which have not yet been compiled.
 // 
 // Currently, it uses the same executable memory segment that the
 // TraceCache would use, but the TraceCache is unaware of it, so they can
@@ -33,7 +37,7 @@
   /// which is used to output functions to memory for execution.
   ///
   class TraceOptEmitter : public MachineCodeEmitter {
-    TargetData &TD;
+    const TargetData &TD;
 
     // CurBlock - The start of the current block of memory.  CurByte - The
     // current byte being emitted to.
@@ -44,7 +48,7 @@
     // constant pool.
     std::vector<void*> ConstantPoolAddresses;
   public:
-    TraceOptEmitter (TargetData &_TD) : TD (_TD) {
+    TraceOptEmitter (const TargetData &_TD) : TD (_TD) {
       // Re-use the existing DummyFunction area for code emission in the
       // Reoptimizer.  No memory is reserved for stubs.
       FunctionBase = (unsigned char *) dummyFunction2;
@@ -78,7 +82,7 @@
   };
 }
 
-MachineCodeEmitter *createTraceOptEmitter(TargetData &TD) {
+MachineCodeEmitter *createTraceOptEmitter(const TargetData &TD) {
   return new TraceOptEmitter(TD);
 }
 





More information about the llvm-commits mailing list