Add bool to DebugLocDwarfExpression to control emitting comments.

DebugLocDwarfExpression::EmitOp was creating temporary strings by concatenating Twine's.

When emitting to object files, these comments are thrown away.

This commit adds a boolean to the constructor of the DwarfExpression to control whether it will actually emit
any comments.  This prevents it from even generating the temporary comments which would have been thrown away anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Pete Cooper
2015-05-20 19:50:03 +00:00
parent 96273f6cbe
commit c212d49d75
4 changed files with 17 additions and 6 deletions

View File

@ -47,7 +47,7 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
DIEDwarfExpression::DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU,
DIELoc &DIE)
: DwarfExpression(*AP.MF->getSubtarget().getRegisterInfo(),
AP.getDwarfDebug()->getDwarfVersion()),
AP.getDwarfDebug()->getDwarfVersion(), false),
AP(AP), DU(DU), DIE(DIE) {}
void DIEDwarfExpression::EmitOp(uint8_t Op, const char* Comment) {