diff options
| author | James Y Knight <jyknight@google.com> | 2019-01-10 16:07:20 +0000 |
|---|---|---|
| committer | James Y Knight <jyknight@google.com> | 2019-01-10 16:07:20 +0000 |
| commit | 62df5eed16a07c4dd183c71d69d6858b5fa19652 (patch) | |
| tree | e9d9c43424b364b6ed2ee4524e26e16ab34e7047 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 20c7844f50a2f2c555bfc6d9b3d2376a6f154511 (diff) | |
| download | bcm5719-llvm-62df5eed16a07c4dd183c71d69d6858b5fa19652.tar.gz bcm5719-llvm-62df5eed16a07c4dd183c71d69d6858b5fa19652.zip | |
[opaque pointer types] Remove some calls to generic Type subtype accessors.
That is, remove many of the calls to Type::getNumContainedTypes(),
Type::subtypes(), and Type::getContainedType(N).
I'm not intending to remove these accessors -- they are
useful/necessary in some cases. However, removing the pointee type
from pointers would potentially break some uses, and reducing the
number of calls makes it easier to audit.
llvm-svn: 350835
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index d64b96b3874..93500844af4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -7915,19 +7915,19 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) { unsigned numRet; ArrayRef<Type *> ResultTypes; SmallVector<SDValue, 1> ResultValues(1); - if (CSResultType->isSingleValueType()) { - numRet = 1; - ResultValues[0] = Val; - ResultTypes = makeArrayRef(CSResultType); - } else { - numRet = CSResultType->getNumContainedTypes(); + if (StructType *StructResult = dyn_cast<StructType>(CSResultType)) { + numRet = StructResult->getNumElements(); assert(Val->getNumOperands() == numRet && "Mismatch in number of output operands in asm result"); - ResultTypes = CSResultType->subtypes(); + ResultTypes = StructResult->elements(); ArrayRef<SDUse> ValueUses = Val->ops(); ResultValues.resize(numRet); std::transform(ValueUses.begin(), ValueUses.end(), ResultValues.begin(), [](const SDUse &u) -> SDValue { return u.get(); }); + } else { + numRet = 1; + ResultValues[0] = Val; + ResultTypes = makeArrayRef(CSResultType); } SmallVector<EVT, 1> ResultVTs(numRet); for (unsigned i = 0; i < numRet; i++) { |

