Fix a bug introduced by the Getelementptr change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3695 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index bc3829f..c54af08 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -925,7 +925,7 @@
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << ")]";
} else {
- Out << ".field" << cast<ConstantSInt>(*I)->getValue();
+ Out << ".field" << cast<ConstantUInt>(*I)->getValue();
}
}
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index bc3829f..c54af08 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -925,7 +925,7 @@
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << ")]";
} else {
- Out << ".field" << cast<ConstantSInt>(*I)->getValue();
+ Out << ".field" << cast<ConstantUInt>(*I)->getValue();
}
}