mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add a comment about the "getelementptr null" trick.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77262 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
224251d18e
commit
f08583b532
@ -419,6 +419,7 @@ Constant* LLVMContext::getConstantExprInsertValue(Constant* Agg, Constant* Val,
|
||||
|
||||
Constant* LLVMContext::getConstantExprSizeOf(const Type* Ty) {
|
||||
// sizeof is implemented as: (i64) gep (Ty*)null, 1
|
||||
// Note that a non-inbounds gep is used, as null isn't within any object.
|
||||
Constant *GEPIdx = ConstantInt::get(Type::Int32Ty, 1);
|
||||
Constant *GEP = getConstantExprGetElementPtr(
|
||||
getNullValue(getPointerTypeUnqual(Ty)), &GEPIdx, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user