mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[MC] Default MCContext::UseNamesOnTempLabels to false and only set it to true for MCAsmStreamer
Only MCAsmStreamer (assembly output) needs to keep names of temporary labels created by MCContext::createTempSymbol(). This change made the rL236642 optimization available for cc2as and probably some other users. This eliminates a behavior difference between llvm-mc -filetype=obj and cc1as, which caused https://reviews.llvm.org/D74006#1890487 Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D75097
This commit is contained in:
parent
4214138dd0
commit
a962b08ed4
@ -188,7 +188,7 @@ namespace llvm {
|
|||||||
/// differences between temporary and non-temporary labels (primarily on
|
/// differences between temporary and non-temporary labels (primarily on
|
||||||
/// Darwin).
|
/// Darwin).
|
||||||
bool AllowTemporaryLabels = true;
|
bool AllowTemporaryLabels = true;
|
||||||
bool UseNamesOnTempLabels = true;
|
bool UseNamesOnTempLabels = false;
|
||||||
|
|
||||||
/// The Compile Unit ID that we are currently processing.
|
/// The Compile Unit ID that we are currently processing.
|
||||||
unsigned DwarfCompileUnitID = 0;
|
unsigned DwarfCompileUnitID = 0;
|
||||||
|
@ -157,9 +157,6 @@ bool LLVMTargetMachine::addAsmPrinter(PassManagerBase &PM,
|
|||||||
if (!MCE || !MAB)
|
if (!MCE || !MAB)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Don't waste memory on names of temp labels.
|
|
||||||
Context.setUseNamesOnTempLabels(false);
|
|
||||||
|
|
||||||
Triple T(getTargetTriple().str());
|
Triple T(getTargetTriple().str());
|
||||||
AsmStreamer.reset(getTarget().createMCObjectStreamer(
|
AsmStreamer.reset(getTarget().createMCObjectStreamer(
|
||||||
T, Context, std::unique_ptr<MCAsmBackend>(MAB),
|
T, Context, std::unique_ptr<MCAsmBackend>(MAB),
|
||||||
|
@ -79,6 +79,8 @@ public:
|
|||||||
InstPrinter->setCommentStream(CommentStream);
|
InstPrinter->setCommentStream(CommentStream);
|
||||||
if (Assembler->getBackendPtr())
|
if (Assembler->getBackendPtr())
|
||||||
setAllowAutoPadding(Assembler->getBackend().allowAutoPadding());
|
setAllowAutoPadding(Assembler->getBackend().allowAutoPadding());
|
||||||
|
|
||||||
|
Context.setUseNamesOnTempLabels(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
MCAssembler &getAssembler() { return *Assembler; }
|
MCAssembler &getAssembler() { return *Assembler; }
|
||||||
|
@ -474,9 +474,6 @@ int main(int argc, char **argv) {
|
|||||||
} else {
|
} else {
|
||||||
assert(FileType == OFT_ObjectFile && "Invalid file type!");
|
assert(FileType == OFT_ObjectFile && "Invalid file type!");
|
||||||
|
|
||||||
// Don't waste memory on names of temp labels.
|
|
||||||
Ctx.setUseNamesOnTempLabels(false);
|
|
||||||
|
|
||||||
if (!Out->os().supportsSeeking()) {
|
if (!Out->os().supportsSeeking()) {
|
||||||
BOS = std::make_unique<buffer_ostream>(Out->os());
|
BOS = std::make_unique<buffer_ostream>(Out->os());
|
||||||
OS = BOS.get();
|
OS = BOS.get();
|
||||||
|
@ -333,9 +333,6 @@ int main(int argc, char **argv) {
|
|||||||
} else {
|
} else {
|
||||||
assert(FileType == OFT_ObjectFile && "Invalid file type!");
|
assert(FileType == OFT_ObjectFile && "Invalid file type!");
|
||||||
|
|
||||||
// Don't waste memory on names of temp labels.
|
|
||||||
Ctx.setUseNamesOnTempLabels(false);
|
|
||||||
|
|
||||||
if (!Out->os().supportsSeeking()) {
|
if (!Out->os().supportsSeeking()) {
|
||||||
BOS = std::make_unique<buffer_ostream>(Out->os());
|
BOS = std::make_unique<buffer_ostream>(Out->os());
|
||||||
OS = BOS.get();
|
OS = BOS.get();
|
||||||
|
Loading…
Reference in New Issue
Block a user