forked from OSchip/llvm-project
Fixed a bug where generation of read-barriers caused
crash in ir-gen. llvm-svn: 66302
This commit is contained in:
parent
a74a29771f
commit
f5d0613ce9
|
@ -1015,6 +1015,9 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc,
|
|||
LHS, RHS, "cmp");
|
||||
} else {
|
||||
// Unsigned integers and pointers.
|
||||
// Casting becomes necessary with -fobjc-gc as one or the other my turn
|
||||
// into an 'id' type due to generation of read barriers.
|
||||
RHS = Builder.CreateBitCast(RHS, LHS->getType());
|
||||
Result = Builder.CreateICmp((llvm::ICmpInst::Predicate)UICmpOpc,
|
||||
LHS, RHS, "cmp");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
// RUN: clang -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
|
||||
|
||||
@interface PBXTarget
|
||||
{
|
||||
|
||||
PBXTarget * __weak _lastKnownTarget;
|
||||
PBXTarget * __weak _KnownTarget;
|
||||
PBXTarget * result;
|
||||
}
|
||||
- Meth;
|
||||
@end
|
||||
|
||||
@implementation PBXTarget
|
||||
- Meth {
|
||||
if (_lastKnownTarget != result)
|
||||
foo();
|
||||
if (result != _lastKnownTarget)
|
||||
foo();
|
||||
|
||||
if (_lastKnownTarget != _KnownTarget)
|
||||
foo();
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue