1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Use new method

llvm-svn: 10852
This commit is contained in:
Chris Lattner 2004-01-14 17:07:46 +00:00
parent a991025919
commit b57b97254b

View File

@ -44,8 +44,7 @@ static std::string getStringValue(Value *V, unsigned Offset = 0) {
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
if (GV->hasInitializer() && isa<ConstantArray>(GV->getInitializer())) {
ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
if (Init->getType()->getElementType() == Type::SByteTy ||
Init->getType()->getElementType() == Type::UByteTy) {
if (Init->isString()) {
std::string Result = Init->getAsString();
if (Offset < Result.size()) {
// If we are pointing INTO The string, erase the beginning...