[AsmPrinter] Remove const qualifier from EmitBasicBlockStart.
Overriders may want to modify state in it. AMDGPU wants to, but has to make its members mutable in order to do so. Besides, EmitBasicBlockEnd is not const, so why should Start be? Patch by Bevin Hansson. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D66341 llvm-svn: 369325
This commit is contained in:
parent
ce21c3e12c
commit
40da6be2bd
|
@ -400,7 +400,7 @@ public:
|
||||||
/// By default, this method prints the label for the specified
|
/// By default, this method prints the label for the specified
|
||||||
/// MachineBasicBlock, an alignment (if present) and a comment describing it
|
/// MachineBasicBlock, an alignment (if present) and a comment describing it
|
||||||
/// if appropriate.
|
/// if appropriate.
|
||||||
virtual void EmitBasicBlockStart(const MachineBasicBlock &MBB) const;
|
virtual void EmitBasicBlockStart(const MachineBasicBlock &MBB);
|
||||||
|
|
||||||
/// Targets can override this to emit stuff at the end of a basic block.
|
/// Targets can override this to emit stuff at the end of a basic block.
|
||||||
virtual void EmitBasicBlockEnd(const MachineBasicBlock &MBB);
|
virtual void EmitBasicBlockEnd(const MachineBasicBlock &MBB);
|
||||||
|
|
|
@ -2895,7 +2895,7 @@ void AsmPrinter::setupCodePaddingContext(const MachineBasicBlock &MBB,
|
||||||
/// EmitBasicBlockStart - This method prints the label for the specified
|
/// EmitBasicBlockStart - This method prints the label for the specified
|
||||||
/// MachineBasicBlock, an alignment (if present) and a comment describing
|
/// MachineBasicBlock, an alignment (if present) and a comment describing
|
||||||
/// it if appropriate.
|
/// it if appropriate.
|
||||||
void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) const {
|
void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) {
|
||||||
// End the previous funclet and start a new one.
|
// End the previous funclet and start a new one.
|
||||||
if (MBB.isEHFuncletEntry()) {
|
if (MBB.isEHFuncletEntry()) {
|
||||||
for (const HandlerInfo &HI : Handlers) {
|
for (const HandlerInfo &HI : Handlers) {
|
||||||
|
|
|
@ -273,7 +273,7 @@ void AMDGPUAsmPrinter::EmitFunctionEntryLabel() {
|
||||||
AsmPrinter::EmitFunctionEntryLabel();
|
AsmPrinter::EmitFunctionEntryLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMDGPUAsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) const {
|
void AMDGPUAsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) {
|
||||||
if (DumpCodeInstEmitter && !isBlockOnlyReachableByFallthrough(&MBB)) {
|
if (DumpCodeInstEmitter && !isBlockOnlyReachableByFallthrough(&MBB)) {
|
||||||
// Write a line for the basic block label if it is not only fallthrough.
|
// Write a line for the basic block label if it is not only fallthrough.
|
||||||
DisasmLines.push_back(
|
DisasmLines.push_back(
|
||||||
|
|
|
@ -125,7 +125,7 @@ public:
|
||||||
|
|
||||||
void EmitFunctionEntryLabel() override;
|
void EmitFunctionEntryLabel() override;
|
||||||
|
|
||||||
void EmitBasicBlockStart(const MachineBasicBlock &MBB) const override;
|
void EmitBasicBlockStart(const MachineBasicBlock &MBB) override;
|
||||||
|
|
||||||
void EmitGlobalVariable(const GlobalVariable *GV) override;
|
void EmitGlobalVariable(const GlobalVariable *GV) override;
|
||||||
|
|
||||||
|
@ -140,8 +140,8 @@ public:
|
||||||
const char *ExtraCode, raw_ostream &O) override;
|
const char *ExtraCode, raw_ostream &O) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
mutable std::vector<std::string> DisasmLines, HexLines;
|
std::vector<std::string> DisasmLines, HexLines;
|
||||||
mutable size_t DisasmLineMaxLen;
|
size_t DisasmLineMaxLen;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
|
@ -434,7 +434,7 @@ bool NVPTXAsmPrinter::isLoopHeaderOfNoUnroll(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NVPTXAsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) const {
|
void NVPTXAsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) {
|
||||||
AsmPrinter::EmitBasicBlockStart(MBB);
|
AsmPrinter::EmitBasicBlockStart(MBB);
|
||||||
if (isLoopHeaderOfNoUnroll(MBB))
|
if (isLoopHeaderOfNoUnroll(MBB))
|
||||||
OutStreamer->EmitRawText(StringRef("\t.pragma \"nounroll\";\n"));
|
OutStreamer->EmitRawText(StringRef("\t.pragma \"nounroll\";\n"));
|
||||||
|
|
|
@ -200,7 +200,7 @@ private:
|
||||||
const Function *F;
|
const Function *F;
|
||||||
std::string CurrentFnName;
|
std::string CurrentFnName;
|
||||||
|
|
||||||
void EmitBasicBlockStart(const MachineBasicBlock &MBB) const override;
|
void EmitBasicBlockStart(const MachineBasicBlock &MBB) override;
|
||||||
void EmitFunctionEntryLabel() override;
|
void EmitFunctionEntryLabel() override;
|
||||||
void EmitFunctionBodyStart() override;
|
void EmitFunctionBodyStart() override;
|
||||||
void EmitFunctionBodyEnd() override;
|
void EmitFunctionBodyEnd() override;
|
||||||
|
|
Loading…
Reference in New Issue