llvm.org GIT mirror llvm / 500233a
Bitcasting two or from aggregate types is not permitted. Update LangRef.html, and teach the verifier to check bitcast instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55921 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
2 changed file(s) with 11 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
17281728 was stored to memory and read back as TYPE. In other words, no bits change
17291729 with this operator, just the type. This can be used for conversion of
17301730 vector types to any other type, as long as they have the same bit width. For
1731 pointers it is only valid to cast to another pointer type.
1731 pointers it is only valid to cast to another pointer type. It is not valid
1732 to bitcast to or from an aggregate type.
17321733
17331734
17341735
getelementptr ( CSTPTR, IDX0, IDX1, ... )
38073808
Arguments:
38083809
38093810

The 'bitcast' instruction takes a value to cast, which must be

3810 a first class value, and a type to cast it to, which must also be a
3811 href="#t_firstclass">first class type. The bit sizes of value
3811 a non-aggregate first class value, and a type to cast it to, which must also be
3812 a non-aggregate first class type. The bit sizes of
3813 value
38123814 and the destination type, ty2, must be identical. If the source
38133815 type is a pointer, the destination type must also be a pointer. This
38143816 instruction supports bitwise conversion of vectors to integers and to vectors
881881 Assert1(isa(DestTy) == isa(DestTy),
882882 "Bitcast requires both operands to be pointer or neither", &I);
883883 Assert1(SrcBitSize == DestBitSize, "Bitcast requies types of same width", &I);
884
885 // Disallow aggregates.
886 Assert1(!SrcTy->isAggregateType(),
887 "Bitcast operand must not be aggregate", &I);
888 Assert1(!DestTy->isAggregateType(),
889 "Bitcast type must not be aggregate", &I);
884890
885891 visitInstruction(I);
886892 }