Code Size: Outline copy addr instruction

This commit is contained in:
Joe Shajrawi
2017-10-28 12:42:05 -07:00
parent 24f74f25b5
commit f4db36426c
22 changed files with 466 additions and 229 deletions

View File

@@ -36,7 +36,7 @@ IRGenFunction::IRGenFunction(IRGenModule &IGM, llvm::Function *Fn,
Optional<SILLocation> DbgLoc)
: IGM(IGM), Builder(IGM.getLLVMContext(),
IGM.DebugInfo && !IGM.Context.LangOpts.DebuggerSupport),
CurFn(Fn), DbgScope(DbgScope) {
CurFn(Fn), DbgScope(DbgScope), inOutlinedFunction(false) {
// Make sure the instructions in this function are attached its debug scope.
if (IGM.DebugInfo) {
@@ -422,3 +422,10 @@ Address IRGenFunction::emitAddressAtOffset(llvm::Value *base, Offset offset,
auto slotPtr = emitByteOffsetGEP(base, offsetValue, objectTy);
return Address(slotPtr, objectAlignment);
}
bool IRGenFunction::isInOutlinedFunction() { return inOutlinedFunction; }
void IRGenFunction::setInOutlinedFunction() {
assert(!isInOutlinedFunction() && "Expected inOutlinedFunction to be false");
inOutlinedFunction = true;
}