projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
704d134
)
Check for empty structs, and for consistency, zero-element arrays.
author
Bob Wilson
<bob.wilson@apple.com>
Thu, 13 Jan 2011 18:26:59 +0000
(18:26 +0000)
committer
Bob Wilson
<bob.wilson@apple.com>
Thu, 13 Jan 2011 18:26:59 +0000
(18:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123383
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/ScalarReplAggregates.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 0ec095749f9eac7232ccd6c0beaba56f0de48540..e248413f4380aac3f9cf79a1d3dea431a3e2e50d 100644
(file)
--- a/
lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/
lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@
-1084,12
+1084,12
@@
static bool isHomogeneousAggregate(const Type *T, unsigned &NumElts,
const Type *&EltTy) {
if (const ArrayType *AT = dyn_cast<ArrayType>(T)) {
NumElts = AT->getNumElements();
- EltTy =
AT->getElementType(
);
+ EltTy =
(NumElts == 0 ? 0 : AT->getElementType()
);
return true;
}
if (const StructType *ST = dyn_cast<StructType>(T)) {
NumElts = ST->getNumContainedTypes();
- EltTy =
ST->getContainedType(0
);
+ EltTy =
(NumElts == 0 ? 0 : ST->getContainedType(0)
);
for (unsigned n = 1; n < NumElts; ++n) {
if (ST->getContainedType(n) != EltTy)
return false;