Skip to content

Commit cafbd7f

Browse files
committed
tweak a few things for future sret work
Signed-off-by: Jade Abraham <[email protected]>
1 parent fd62658 commit cafbd7f

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

compiler/codegen/cg-expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@ static GenRet codegenCallExprInner(GenRet function,
29302930
}
29312931
}
29322932

2933-
if (CGI == nullptr && fnType != nullptr &&
2933+
if (CGI == nullptr && fnType != nullptr &&
29342934
fnType->getReturnType()->isVoidTy() &&
29352935
fnType->getNumParams() >= 1 &&
29362936
func && func->hasStructRetAttr())

compiler/codegen/cg-symbol.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,6 @@ codegenFunctionTypeLLVMImpl(
23132313
// because retArg must be either the first or second arg
23142314
// this will require more investigation
23152315
// if (formalInfo->isRetArg() &&
2316-
// isAggregateType(formalInfo->type()) &&
23172316
// llvm::isa<llvm::StructType>(valType)) {
23182317
// auto ptrType = formalInfo->type()->codegen().type;
23192318
// llvmAttachStructRetAttr(b, ptrType);
@@ -2364,7 +2363,6 @@ codegenFunctionTypeLLVMImpl(
23642363
// because retArg must be either the first or second arg
23652364
// this will require more investigation
23662365
// if (formalInfo->isRetArg() &&
2367-
// isAggregateType(formalInfo->type()) &&
23682366
// llvm::isa<llvm::StructType>(valType)) {
23692367
// auto ptrType = formalInfo->type()->codegen().type;
23702368
// llvmAttachStructRetAttr(b, ptrType);

compiler/llvm/llvmDebug.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,11 +1238,11 @@ llvm::DISubroutineType* DebugData::getFunctionType(FnSymbol *function) {
12381238
if (arg->name == astr__ln || arg->name == astr__fn)
12391239
continue;
12401240

1241-
auto ty = getType(arg->type);
12421241
if (isReturnByRef && arg->hasFlag(FLAG_RETARG)) {
1243-
retType = ty;
1242+
retType = getType(arg->type->getValType());
12441243
continue;
12451244
}
1245+
auto ty = getType(arg->type);
12461246
if (isMethod && arg->name == astrThis) {
12471247
auto NewTy = ty->cloneWithFlags(ty->getFlags() |
12481248
llvm::DINode::FlagObjectPointer |
@@ -1421,6 +1421,14 @@ llvm::DIVariable* DebugData::constructFormalArg(ArgSymbol *argSym, unsigned ArgN
14211421
flags |= llvm::DINode::FlagObjectPointer | llvm::DINode::FlagArtificial;
14221422
}
14231423

1424+
if (argSym->name == astr__ln ||
1425+
argSym->name == astr__fn) {
1426+
return nullptr;
1427+
}
1428+
if (argSym->hasFlag(FLAG_RETARG)) {
1429+
return nullptr;
1430+
}
1431+
14241432
auto diParameterVariable = dibuilder->createParameterVariable(
14251433
defInfo.scope(),
14261434
name,

0 commit comments

Comments
 (0)