Skip to content

Commit 2df45ce

Browse files
committed
Change remaining targets
1 parent aa52b73 commit 2df45ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+209
-26
lines changed

llvm/lib/Target/ARC/ARC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ FunctionPass *createARCISelDag(ARCTargetMachine &TM, CodeGenOptLevel OptLevel);
2727
FunctionPass *createARCExpandPseudosPass();
2828
FunctionPass *createARCOptAddrMode();
2929
FunctionPass *createARCBranchFinalizePass();
30+
void initializeARCAsmPrinterPass(PassRegistry &);
3031
void initializeARCDAGToDAGISelLegacyPass(PassRegistry &);
3132

3233
} // end namespace llvm

llvm/lib/Target/ARC/ARCAsmPrinter.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ class ARCAsmPrinter : public AsmPrinter {
3535
ARCMCInstLower MCInstLowering;
3636

3737
public:
38+
static char ID;
39+
3840
explicit ARCAsmPrinter(TargetMachine &TM,
3941
std::unique_ptr<MCStreamer> Streamer)
40-
: AsmPrinter(TM, std::move(Streamer)),
42+
: AsmPrinter(TM, std::move(Streamer), ID),
4143
MCInstLowering(&OutContext, *this) {}
4244

4345
StringRef getPassName() const override { return "ARC Assembly Printer"; }
@@ -72,6 +74,11 @@ bool ARCAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
7274
return AsmPrinter::runOnMachineFunction(MF);
7375
}
7476

77+
char ARCAsmPrinter::ID = 0;
78+
79+
INITIALIZE_PASS(ARCAsmPrinter, "arc-asm-printer", "ARC Assmebly Printer",
80+
false, false)
81+
7582
// Force static initialization.
7683
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCAsmPrinter() {
7784
RegisterAsmPrinter<ARCAsmPrinter> X(getTheARCTarget());

llvm/lib/Target/ARC/ARCTargetMachine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ MachineFunctionInfo *ARCTargetMachine::createMachineFunctionInfo(
9898
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCTarget() {
9999
RegisterTargetMachine<ARCTargetMachine> X(getTheARCTarget());
100100
PassRegistry &PR = *PassRegistry::getPassRegistry();
101+
initializeARCAsmPrinterPass(PR);
101102
initializeARCDAGToDAGISelLegacyPass(PR);
102103
}
103104

llvm/lib/Target/ARM/ARM.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ FunctionPass *createARMFixCortexA57AES1742098Pass();
6161
void LowerARMMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
6262
ARMAsmPrinter &AP);
6363

64+
void initializeARMAsmPrinterPass(PassRegistry &);
6465
void initializeARMBlockPlacementPass(PassRegistry &);
6566
void initializeARMBranchTargetsPass(PassRegistry &);
6667
void initializeARMConstantIslandsPass(PassRegistry &);

llvm/lib/Target/ARM/ARMAsmPrinter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ using namespace llvm;
5050

5151
ARMAsmPrinter::ARMAsmPrinter(TargetMachine &TM,
5252
std::unique_ptr<MCStreamer> Streamer)
53-
: AsmPrinter(TM, std::move(Streamer)), Subtarget(nullptr), AFI(nullptr),
53+
: AsmPrinter(TM, std::move(Streamer), ID), Subtarget(nullptr), AFI(nullptr),
5454
MCP(nullptr), InConstantPool(false), OptimizationGoals(-1) {}
5555

5656
void ARMAsmPrinter::emitFunctionBodyEnd() {
@@ -2434,6 +2434,11 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
24342434
EmitToStreamer(*OutStreamer, TmpInst);
24352435
}
24362436

2437+
char ARMAsmPrinter::ID = 0;
2438+
2439+
INITIALIZE_PASS(ARMAsmPrinter, "arm-asm-printer", "ARM Assembly Printer",
2440+
false, false)
2441+
24372442
//===----------------------------------------------------------------------===//
24382443
// Target Registry Stuff
24392444
//===----------------------------------------------------------------------===//

llvm/lib/Target/ARM/ARMAsmPrinter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ namespace ARM {
2929
}
3030

3131
class LLVM_LIBRARY_VISIBILITY ARMAsmPrinter : public AsmPrinter {
32+
public:
33+
static char ID;
3234

35+
private:
3336
/// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
3437
/// make the right decision when printing asm code for different targets.
3538
const ARMSubtarget *Subtarget;
@@ -152,6 +155,7 @@ class LLVM_LIBRARY_VISIBILITY ARMAsmPrinter : public AsmPrinter {
152155
/// the .s file.
153156
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
154157
};
158+
155159
} // end namespace llvm
156160

157161
#endif

llvm/lib/Target/ARM/ARMTargetMachine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() {
9191

9292
PassRegistry &Registry = *PassRegistry::getPassRegistry();
9393
initializeGlobalISel(Registry);
94+
initializeARMAsmPrinterPass(Registry);
9495
initializeARMLoadStoreOptPass(Registry);
9596
initializeARMPreAllocLoadStoreOptPass(Registry);
9697
initializeARMParallelDSPPass(Registry);

llvm/lib/Target/AVR/AVR.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ FunctionPass *createAVRExpandPseudoPass();
3131
FunctionPass *createAVRFrameAnalyzerPass();
3232
FunctionPass *createAVRBranchSelectionPass();
3333

34+
void initializeAVRAsmPrinterPass(PassRegistry &);
3435
void initializeAVRDAGToDAGISelLegacyPass(PassRegistry &);
3536
void initializeAVRExpandPseudoPass(PassRegistry &);
3637
void initializeAVRShiftExpandPass(PassRegistry &);

llvm/lib/Target/AVR/AVRAsmPrinter.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@
3939

4040
#define DEBUG_TYPE "avr-asm-printer"
4141

42-
namespace llvm {
42+
using namespace llvm;
43+
44+
namespace {
4345

4446
/// An AVR assembly code printer.
4547
class AVRAsmPrinter : public AsmPrinter {
4648
public:
4749
AVRAsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer)
48-
: AsmPrinter(TM, std::move(Streamer)), MRI(*TM.getMCRegisterInfo()) {}
50+
: AsmPrinter(TM, std::move(Streamer), ID), MRI(*TM.getMCRegisterInfo()) {}
4951

5052
StringRef getPassName() const override { return "AVR Assembly Printer"; }
5153

@@ -68,11 +70,15 @@ class AVRAsmPrinter : public AsmPrinter {
6870

6971
void emitStartOfAsmFile(Module &M) override;
7072

73+
static char ID;
74+
7175
private:
7276
const MCRegisterInfo &MRI;
7377
bool EmittedStructorSymbolAttrs = false;
7478
};
7579

80+
} // namespace
81+
7682
void AVRAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
7783
raw_ostream &O) {
7884
const MachineOperand &MO = MI->getOperand(OpNo);
@@ -324,8 +330,11 @@ void AVRAsmPrinter::emitStartOfAsmFile(Module &M) {
324330
MCConstantExpr::create(SubTM->getIORegRAMPZ(), MMI->getContext()));
325331
}
326332

327-
} // end of namespace llvm
333+
char AVRAsmPrinter::ID = 0;
334+
335+
INITIALIZE_PASS(AVRAsmPrinter, "avr-asm-printer", "AVR Assembly Printer",
336+
false, false)
328337

329338
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRAsmPrinter() {
330-
llvm::RegisterAsmPrinter<llvm::AVRAsmPrinter> X(llvm::getTheAVRTarget());
339+
llvm::RegisterAsmPrinter<AVRAsmPrinter> X(getTheAVRTarget());
331340
}

llvm/lib/Target/AVR/AVRTargetMachine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRTarget() {
9292
RegisterTargetMachine<AVRTargetMachine> X(getTheAVRTarget());
9393

9494
auto &PR = *PassRegistry::getPassRegistry();
95+
initializeAVRAsmPrinterPass(PR);
9596
initializeAVRExpandPseudoPass(PR);
9697
initializeAVRShiftExpandPass(PR);
9798
initializeAVRDAGToDAGISelLegacyPass(PR);

0 commit comments

Comments
 (0)