aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-25 01:27:20 +0000
committerChris Lattner <sabre@nondot.org>2012-01-25 01:27:20 +0000
commit0f193b8a6846dab25323788638e760ae03b7cd87 (patch)
treeb89bd3a70578256be2eb53eca270ed7832fcacb8 /lib/CodeGen
parenta57a36abe7d0b769a495ed886246db157aff4add (diff)
downloadexternal_llvm-0f193b8a6846dab25323788638e760ae03b7cd87.zip
external_llvm-0f193b8a6846dab25323788638e760ae03b7cd87.tar.gz
external_llvm-0f193b8a6846dab25323788638e760ae03b7cd87.tar.bz2
Use the right method to get the # elements in a CDS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp6
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index ff6da12..0e6c613 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1630,7 +1630,7 @@ static void EmitGlobalConstantDataSequential(const ConstantDataSequential *CDS,
// Otherwise, emit the values in successive locations.
unsigned ElementByteSize = CDS->getElementByteSize();
if (isa<IntegerType>(CDS->getElementType())) {
- for (unsigned i = 0, e = CDS->getType()->getNumElements(); i != e; ++i) {
+ for (unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
AP.OutStreamer.EmitIntValue(CDS->getElementAsInteger(i),
ElementByteSize, AddrSpace);
}
@@ -1643,7 +1643,7 @@ static void EmitGlobalConstantDataSequential(const ConstantDataSequential *CDS,
CDS->getElementType()->isDoubleTy());
if (ElementByteSize == 4) {
- for (unsigned i = 0, e = CDS->getType()->getNumElements(); i != e; ++i) {
+ for (unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
union {
float F;
uint32_t I;
@@ -1657,7 +1657,7 @@ static void EmitGlobalConstantDataSequential(const ConstantDataSequential *CDS,
return;
}
- for (unsigned i = 0, e = CDS->getType()->getNumElements(); i != e; ++i) {
+ for (unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
union {
double F;
uint64_t I;
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index cd9bec1..7731f7c 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1059,7 +1059,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
if (const ConstantDataSequential *CDS =
dyn_cast<ConstantDataSequential>(C)) {
SmallVector<SDValue, 4> Ops;
- for (unsigned i = 0, e = CDS->getType()->getNumElements(); i != e; ++i) {
+ for (unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
SDNode *Val = getValue(CDS->getElementAsConstant(i)).getNode();
// Add each leaf value from the operand to the Constants list
// to form a flattened list of all the values.