diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-06-01 19:57:37 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-06-01 19:57:37 +0000 |
commit | 8e2537be2325a9a04eb61220329581f0f6805e79 (patch) | |
tree | 7fb5024f1a98a8e7c2e2406c86fcc22fed0cc032 /lib/Target/Alpha/AlphaCodeEmitter.cpp | |
parent | 845290803be4879599bb9a9ec8617d7ad17be326 (diff) | |
download | external_llvm-8e2537be2325a9a04eb61220329581f0f6805e79.zip external_llvm-8e2537be2325a9a04eb61220329581f0f6805e79.tar.gz external_llvm-8e2537be2325a9a04eb61220329581f0f6805e79.tar.bz2 |
Fix new CodeEmitter stuff to follow LLVM codying style. Patch by Aaron Gray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaCodeEmitter.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaCodeEmitter.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/Target/Alpha/AlphaCodeEmitter.cpp b/lib/Target/Alpha/AlphaCodeEmitter.cpp index ab3682b..f50f007 100644 --- a/lib/Target/Alpha/AlphaCodeEmitter.cpp +++ b/lib/Target/Alpha/AlphaCodeEmitter.cpp @@ -32,7 +32,7 @@ namespace { class AlphaCodeEmitter { MachineCodeEmitter &MCE; public: - AlphaCodeEmitter( MachineCodeEmitter &mce) : MCE(mce) {} + AlphaCodeEmitter(MachineCodeEmitter &mce) : MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the /// CodeEmitterGenerator using TableGen, produces the binary encoding for @@ -42,25 +42,25 @@ namespace { /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr - unsigned getMachineOpValue(const MachineInstr &MI, const MachineOperand &MO); + unsigned getMachineOpValue(const MachineInstr &MI, + const MachineOperand &MO); }; - template <class machineCodeEmitter> + template <class CodeEmitter> class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass, public AlphaCodeEmitter { const AlphaInstrInfo *II; - TargetMachine &TM; - machineCodeEmitter &MCE; + TargetMachine &TM; + CodeEmitter &MCE; public: static char ID; - explicit Emitter(TargetMachine &tm, machineCodeEmitter &mce) - : MachineFunctionPass(&ID), AlphaCodeEmitter( mce), + explicit Emitter(TargetMachine &tm, CodeEmitter &mce) + : MachineFunctionPass(&ID), AlphaCodeEmitter(mce), II(0), TM(tm), MCE(mce) {} - Emitter(TargetMachine &tm, machineCodeEmitter &mce, - const AlphaInstrInfo& ii) - : MachineFunctionPass(&ID), AlphaCodeEmitter( mce), + Emitter(TargetMachine &tm, CodeEmitter &mce, const AlphaInstrInfo& ii) + : MachineFunctionPass(&ID), AlphaCodeEmitter(mce), II(&ii), TM(tm), MCE(mce) {} bool runOnMachineFunction(MachineFunction &MF); @@ -75,25 +75,25 @@ namespace { void emitBasicBlock(MachineBasicBlock &MBB); }; - template <class machineCodeEmitter> - char Emitter<machineCodeEmitter>::ID = 0; + template <class CodeEmitter> + char Emitter<CodeEmitter>::ID = 0; } -/// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha code -/// to the specified MCE object. +/// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha +/// code to the specified MCE object. -FunctionPass *llvm::createAlphaCodeEmitterPass( AlphaTargetMachine &TM, +FunctionPass *llvm::createAlphaCodeEmitterPass(AlphaTargetMachine &TM, MachineCodeEmitter &MCE) { return new Emitter<MachineCodeEmitter>(TM, MCE); } -FunctionPass *llvm::createAlphaJITCodeEmitterPass( AlphaTargetMachine &TM, - JITCodeEmitter &JCE) { +FunctionPass *llvm::createAlphaJITCodeEmitterPass(AlphaTargetMachine &TM, + JITCodeEmitter &JCE) { return new Emitter<JITCodeEmitter>(TM, JCE); } -template <class machineCodeEmitter> -bool Emitter<machineCodeEmitter>::runOnMachineFunction(MachineFunction &MF) { +template <class CodeEmitter> +bool Emitter<CodeEmitter>::runOnMachineFunction(MachineFunction &MF) { II = ((AlphaTargetMachine&)MF.getTarget()).getInstrInfo(); do { @@ -105,8 +105,8 @@ bool Emitter<machineCodeEmitter>::runOnMachineFunction(MachineFunction &MF) { return false; } -template <class machineCodeEmitter> -void Emitter<machineCodeEmitter>::emitBasicBlock(MachineBasicBlock &MBB) { +template <class CodeEmitter> +void Emitter<CodeEmitter>::emitBasicBlock(MachineBasicBlock &MBB) { MCE.StartMachineBasicBlock(&MBB); for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) { @@ -165,7 +165,7 @@ static unsigned getAlphaRegNumber(unsigned Reg) { } unsigned AlphaCodeEmitter::getMachineOpValue(const MachineInstr &MI, - const MachineOperand &MO) { + const MachineOperand &MO) { unsigned rv = 0; // Return value; defaults to 0 for unhandled cases // or things that get fixed up later by the JIT. |