Skip to content

Commit 13e8c78

Browse files
andykaylorlanza
authored andcommitted
[CIR] Remove ABI handling from CIRGen call handling (llvm#1604)
Remove all the code the manages ABI info for arguments and return values in the initial CIR codegen. We prefer for the CIR to represent the types as they appear in the source code, with ABI handling being deferred until the lowering phase or calling convention transform. The ABI handling being removed here was brought over from the classic codegen, but none of the effects being computed made it into the CIR so this change is effectively NFC. This change leaves the `CIRGenFunctionInfoArgInfo` with just one member. That can be cleaned up in a later patch.
1 parent 09ac8d7 commit 13e8c78

File tree

9 files changed

+94
-491
lines changed

9 files changed

+94
-491
lines changed

clang/lib/CIR/CodeGen/ABIInfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class ABIInfo {
3434
CIRGenCXXABI &getCXXABI() const;
3535
clang::ASTContext &getContext() const;
3636

37-
virtual void computeInfo(CIRGenFunctionInfo &FI) const = 0;
38-
3937
virtual bool allowBFloatArgsAndRet() const { return false; }
4038

4139
// Implement the Type::IsPromotableIntegerType for ABI specific needs. The

clang/lib/CIR/CodeGen/CIRAsm.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -521,20 +521,6 @@ mlir::LogicalResult CIRGenFunction::emitAsmStmt(const AsmStmt &S) {
521521
}
522522
} // iterate over output operands
523523

524-
// If this is a Microsoft-style asm blob, store the return registers (EAX:EDX)
525-
// to the return value slot. Only do this when returning in registers.
526-
if (isa<MSAsmStmt>(&S)) {
527-
const cir::ABIArgInfo &RetAI = CurFnInfo->getReturnInfo();
528-
if (RetAI.isDirect() || RetAI.isExtend()) {
529-
// Make a fake lvalue for the return value slot.
530-
LValue ReturnSlot = makeAddrLValue(ReturnValue, FnRetTy);
531-
CGM.getTargetCIRGenInfo().addReturnRegisterOutputs(
532-
*this, ReturnSlot, Constraints, ResultRegTypes, ResultTruncRegTypes,
533-
ResultRegDests, AsmString, S.getNumOutputs());
534-
SawAsmBlock = true;
535-
}
536-
}
537-
538524
for (unsigned i = 0, e = S.getNumInputs(); i != e; i++) {
539525
const Expr *InputExpr = S.getInputExpr(i);
540526

0 commit comments

Comments
 (0)