diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h --- a/llvm/include/llvm/MC/MCContext.h +++ b/llvm/include/llvm/MC/MCContext.h @@ -188,7 +188,7 @@ /// differences between temporary and non-temporary labels (primarily on /// Darwin). bool AllowTemporaryLabels = true; - bool UseNamesOnTempLabels = true; + bool UseNamesOnTempLabels = false; /// The Compile Unit ID that we are currently processing. unsigned DwarfCompileUnitID = 0; diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -157,9 +157,6 @@ if (!MCE || !MAB) return true; - // Don't waste memory on names of temp labels. - Context.setUseNamesOnTempLabels(false); - Triple T(getTargetTriple().str()); AsmStreamer.reset(getTarget().createMCObjectStreamer( T, Context, std::unique_ptr(MAB), diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -79,6 +79,8 @@ InstPrinter->setCommentStream(CommentStream); if (Assembler->getBackendPtr()) setAllowAutoPadding(Assembler->getBackend().allowAutoPadding()); + + Context.setUseNamesOnTempLabels(true); } MCAssembler &getAssembler() { return *Assembler; } diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -474,9 +474,6 @@ } else { assert(FileType == OFT_ObjectFile && "Invalid file type!"); - // Don't waste memory on names of temp labels. - Ctx.setUseNamesOnTempLabels(false); - if (!Out->os().supportsSeeking()) { BOS = std::make_unique(Out->os()); OS = BOS.get(); diff --git a/llvm/tools/llvm-ml/llvm-ml.cpp b/llvm/tools/llvm-ml/llvm-ml.cpp --- a/llvm/tools/llvm-ml/llvm-ml.cpp +++ b/llvm/tools/llvm-ml/llvm-ml.cpp @@ -333,9 +333,6 @@ } else { assert(FileType == OFT_ObjectFile && "Invalid file type!"); - // Don't waste memory on names of temp labels. - Ctx.setUseNamesOnTempLabels(false); - if (!Out->os().supportsSeeking()) { BOS = std::make_unique(Out->os()); OS = BOS.get();