From b2d11bad7e8daf2a5581cce7d394ffd0c6bb7a01 Mon Sep 17 00:00:00 2001 From: Ruchira Sasanka Date: Tue, 24 Jul 2001 18:21:21 +0000 Subject: [PATCH] Changed printValue() to print constant value if the value is a constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/LiveVar/ValueSet.cpp | 3 +++ lib/Target/SparcV9/LiveVar/ValueSet.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/Analysis/LiveVar/ValueSet.cpp b/lib/Analysis/LiveVar/ValueSet.cpp index d86587cde4c..680ad83428e 100644 --- a/lib/Analysis/LiveVar/ValueSet.cpp +++ b/lib/Analysis/LiveVar/ValueSet.cpp @@ -1,11 +1,14 @@ #include "llvm/Analysis/LiveVar/ValueSet.h" +#include "llvm/ConstPoolVals.h" void printValue( const Value *const v) // func to print a Value { if( (*v).hasName() ) cout << v << "(" << ((*v).getName()) << ") "; //if( (*v).hasName() ) cout << ((*v).getName()) << " "; + else if (v->getValueType() == Value::ConstantVal) // if const + cout << v << "(" << ((ConstPoolVal *) v)->getStrValue() << ") "; else cout << v << " "; } diff --git a/lib/Target/SparcV9/LiveVar/ValueSet.cpp b/lib/Target/SparcV9/LiveVar/ValueSet.cpp index d86587cde4c..680ad83428e 100644 --- a/lib/Target/SparcV9/LiveVar/ValueSet.cpp +++ b/lib/Target/SparcV9/LiveVar/ValueSet.cpp @@ -1,11 +1,14 @@ #include "llvm/Analysis/LiveVar/ValueSet.h" +#include "llvm/ConstPoolVals.h" void printValue( const Value *const v) // func to print a Value { if( (*v).hasName() ) cout << v << "(" << ((*v).getName()) << ") "; //if( (*v).hasName() ) cout << ((*v).getName()) << " "; + else if (v->getValueType() == Value::ConstantVal) // if const + cout << v << "(" << ((ConstPoolVal *) v)->getStrValue() << ") "; else cout << v << " "; } -- 2.34.1