diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index cf4679fdac3..65ec21c92f3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1112,8 +1112,8 @@ void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeArray Args) { createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); } else { DIE &Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); - addType(Arg, DIType(Ty)); - if (DIType(Ty).isArtificial()) + addType(Arg, Ty); + if (Ty.isArtificial()) addFlag(Arg, dwarf::DW_AT_artificial); } }