[llvm-commits] CVS: reopt/lib/TraceJIT/TraceJITGlobals.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Jun 8 13:55:18 PDT 2004
Changes in directory reopt/lib/TraceJIT:
TraceJITGlobals.cpp updated: 1.1 -> 1.2
---
Log message:
Add lots of debugging printouts.
---
Diffs of the changes: (+14 -5)
Index: reopt/lib/TraceJIT/TraceJITGlobals.cpp
diff -u reopt/lib/TraceJIT/TraceJITGlobals.cpp:1.1 reopt/lib/TraceJIT/TraceJITGlobals.cpp:1.2
--- reopt/lib/TraceJIT/TraceJITGlobals.cpp:1.1 Thu Jun 3 00:42:46 2004
+++ reopt/lib/TraceJIT/TraceJITGlobals.cpp Tue Jun 8 13:53:59 2004
@@ -28,13 +28,22 @@
namespace llvm {
void TraceJIT::maybeAddInternalGlobal (GlobalValue *GV, unsigned int &Counter) {
- if (Counter >= _llvm_internalGlobals.Size) return;
+ DEBUG (std::cerr << "maybeAddInternalGlobal: Looking for #" << Counter << ": " << GV->getName () << "\n");
+ if (Counter >= _llvm_internalGlobals.Size) {
+ DEBUG (std::cerr << "maybeAddInternalGlobal: Walked off the end of InternalGlobals map: " << Counter << " >= " << _llvm_internalGlobals.Size << "\n");
+ return;
+ }
void *savedAddr = _llvm_internalGlobals.GlobalAddrs[Counter];
++Counter;
- if (GV->hasInternalLinkage() && GV->hasName () && savedAddr) {
- DEBUG (std::cerr << "Old internal global " << GV->getName ()
- << " found at " << savedAddr << "\n");
- addGlobalMapping (GV, savedAddr);
+ if (GV->hasInternalLinkage() && GV->hasName ()) {
+ if (savedAddr) {
+ DEBUG (std::cerr << "maybeAddInternalGlobal: Old internal global " << GV->getName () << " found at " << savedAddr << "\n");
+ addGlobalMapping (GV, savedAddr);
+ } else {
+ DEBUG (std::cerr << "maybeAddInternalGlobal: Old internal global " << GV->getName () << " NOT found (was null in map)!\n");
+ }
+ } else {
+ DEBUG (std::cerr << "maybeAddInternalGlobal: Old global " << GV->getName () << " is not internal or does not have a name\n");
}
}
More information about the llvm-commits
mailing list