diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
| commit | c192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch) | |
| tree | ac719b5984165053bf83d71142e4d96b609b9784 /lib/CodeGen/CodeGenTypes.cpp | |
| parent | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
| -rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index e0f926cabd71..a4a8654eb36b 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -154,14 +154,16 @@ isSafeToConvert(const RecordDecl *RD, CodeGenTypes &CGT, static bool isSafeToConvert(QualType T, CodeGenTypes &CGT, llvm::SmallPtrSet<const RecordDecl*, 16> &AlreadyChecked) { - T = T.getCanonicalType(); - + // Strip off atomic type sugar. + if (const auto *AT = T->getAs<AtomicType>()) + T = AT->getValueType(); + // If this is a record, check it. - if (const RecordType *RT = dyn_cast<RecordType>(T)) + if (const auto *RT = T->getAs<RecordType>()) return isSafeToConvert(RT->getDecl(), CGT, AlreadyChecked); - + // If this is an array, check the elements, which are embedded inline. - if (const ArrayType *AT = dyn_cast<ArrayType>(T)) + if (const auto *AT = CGT.getContext().getAsArrayType(T)) return isSafeToConvert(AT->getElementType(), CGT, AlreadyChecked); // Otherwise, there is no concern about transforming this. We only care about |
