aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-29 17:04:54 +0000
committerChris Lattner <sabre@nondot.org>2010-07-29 17:04:54 +0000
commita7206c5367c2e5879fe6d9a07ed50aa003a56976 (patch)
tree5be98edbf9a3c18aac010e16c75e2dbc2152a59e /lib/CodeGen/TargetInfo.cpp
parentb1d58e3a625d027165ff1c084d367ee4281cae7a (diff)
fix PR7742 / rdar://8250764, a miscompilation of struct
return where the struct has a base but no fields. This was because the x86-64 abi logic was checking the wrong predicate in one place. This was introduced in r91874, which was a fix for PR5831, which lacked a CHECK line, so I verified and added it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r--lib/CodeGen/TargetInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 8729da9e17..0d8d3a9dff 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -1026,8 +1026,9 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase,
break;
}
- // If this record has no fields but isn't empty, classify as INTEGER.
- if (RD->field_empty() && Size)
+ // If this record has no fields, no bases, no vtable, but isn't empty,
+ // classify as INTEGER.
+ if (CXXRD->isEmpty() && Size)
Current = Integer;
}