Changeset View
Changeset View
Standalone View
Standalone View
lib/CodeGen/CGExpr.cpp
Show First 20 Lines • Show All 3,000 Lines • ▼ Show 20 Lines | |||||
static llvm::Value *emitArraySubscriptGEP(CodeGenFunction &CGF, | static llvm::Value *emitArraySubscriptGEP(CodeGenFunction &CGF, | ||||
llvm::Value *ptr, | llvm::Value *ptr, | ||||
ArrayRef<llvm::Value*> indices, | ArrayRef<llvm::Value*> indices, | ||||
bool inbounds, | bool inbounds, | ||||
bool signedIndices, | bool signedIndices, | ||||
SourceLocation loc, | SourceLocation loc, | ||||
const llvm::Twine &name = "arrayidx") { | const llvm::Twine &name = "arrayidx") { | ||||
if (inbounds) { | if (inbounds) { | ||||
return CGF.EmitCheckedInBoundsGEP(ptr, indices, signedIndices, loc, name); | return CGF.EmitCheckedInBoundsGEP( | ||||
ptr, indices, signedIndices, CodeGenFunction::IsSubtraction, loc, name); | |||||
aprantl: Might want to define an
`enum { NotSubtraction = false, IsSubtraction = true }` in the header. | |||||
} else { | } else { | ||||
return CGF.Builder.CreateGEP(ptr, indices, name); | return CGF.Builder.CreateGEP(ptr, indices, name); | ||||
} | } | ||||
} | } | ||||
static CharUnits getArrayElementAlign(CharUnits arrayAlign, | static CharUnits getArrayElementAlign(CharUnits arrayAlign, | ||||
llvm::Value *idx, | llvm::Value *idx, | ||||
CharUnits eltSize) { | CharUnits eltSize) { | ||||
▲ Show 20 Lines • Show All 1,569 Lines • Show Last 20 Lines |
Might want to define an
enum { NotSubtraction = false, IsSubtraction = true } in the header. We do this in other places.