mirror of
https://github.com/intel/llvm.git
synced 2026-01-28 01:04:49 +08:00
Fix another byref bug. This should hopefully get QuickLookPlugins building successfully.
llvm-svn: 81681
This commit is contained in:
@@ -270,18 +270,18 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const ValueDecl *D) {
|
||||
llvm::RoundUpToAlignment(CurrentOffsetInBytes, Align);
|
||||
|
||||
unsigned NumPaddingBytes = AlignedOffsetInBytes - CurrentOffsetInBytes;
|
||||
assert(NumPaddingBytes > 0 && "Can't append any padding!");
|
||||
if (NumPaddingBytes > 0) {
|
||||
const llvm::Type *Ty = llvm::Type::getInt8Ty(VMContext);
|
||||
// FIXME: We need a sema error for alignment larger than the minimum of the
|
||||
// maximal stack alignmint and the alignment of malloc on the system.
|
||||
if (NumPaddingBytes > 1)
|
||||
Ty = llvm::ArrayType::get(Ty, NumPaddingBytes);
|
||||
|
||||
const llvm::Type *Ty = llvm::Type::getInt8Ty(VMContext);
|
||||
// FIXME: We need a sema error for alignment larger than the minimum of the
|
||||
// maximal stack alignmint and the alignment of malloc on the system.
|
||||
if (NumPaddingBytes > 1)
|
||||
Ty = llvm::ArrayType::get(Ty, NumPaddingBytes);
|
||||
|
||||
Types.push_back(Ty);
|
||||
Types.push_back(Ty);
|
||||
|
||||
// We want a packed struct.
|
||||
Packed = true;
|
||||
// We want a packed struct.
|
||||
Packed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// T x;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// RUN: clang-cc -emit-llvm -o -
|
||||
// RUN: clang-cc -emit-llvm -o - -triple x86_64-apple-darwin10 &&
|
||||
// RUN: clang-cc -emit-llvm -o - -triple i386-apple-darwin10
|
||||
typedef int __attribute__((aligned(32))) ai;
|
||||
|
||||
void f() {
|
||||
@@ -9,3 +10,10 @@ void f() {
|
||||
}();
|
||||
}
|
||||
|
||||
void g() {
|
||||
__block double a = 10;
|
||||
|
||||
^{
|
||||
a = 20;
|
||||
}();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user