[llvm-commits] CVS: llvm-java/lib/Transforms/AddStubs.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Mon Mar 14 23:24:50 PST 2005
Changes in directory llvm-java/lib/Transforms:
AddStubs.cpp updated: 1.4 -> 1.5
---
Log message:
Return an allones value in stubs instead of an undef. This makes this
value more obvious when running programs with function tracing.
---
Diffs of the changes: (+6 -1)
AddStubs.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm-java/lib/Transforms/AddStubs.cpp
diff -u llvm-java/lib/Transforms/AddStubs.cpp:1.4 llvm-java/lib/Transforms/AddStubs.cpp:1.5
--- llvm-java/lib/Transforms/AddStubs.cpp:1.4 Tue Feb 8 19:28:30 2005
+++ llvm-java/lib/Transforms/AddStubs.cpp Tue Mar 15 01:24:39 2005
@@ -26,6 +26,9 @@
using namespace llvm;
namespace {
+
+ static Constant* ALL_ONES = ConstantUInt::getAllOnesValue(Type::ULongTy);
+
struct AddStubs : public ModulePass {
virtual bool runOnModule(Module &M) {
for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
@@ -35,7 +38,9 @@
if (F->getReturnType() == Type::VoidTy)
new ReturnInst(NULL, entry);
else
- new ReturnInst(UndefValue::get(F->getReturnType()), entry);
+ new ReturnInst(
+ new CastInst(ALL_ONES, F->getReturnType(), "dummy-value", entry),
+ entry);
}
return true;
}
More information about the llvm-commits
mailing list