The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
//===----------------------------------------------------------------------===//
|
|
// Instruction Selector Subtarget Control
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// This file defines a pass used to change the subtarget for the
|
|
// Mips Instruction selector.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "Mips.h"
|
|
#include "MipsTargetMachine.h"
|
|
#include "llvm/CodeGen/TargetPassConfig.h"
|
|
#include "llvm/Support/Debug.h"
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
using namespace llvm;
|
|
|
|
#define DEBUG_TYPE "mips-isel"
|
|
|
|
namespace {
|
|
class MipsModuleDAGToDAGISel : public MachineFunctionPass {
|
|
public:
|
|
static char ID;
|
|
|
|
MipsModuleDAGToDAGISel() : MachineFunctionPass(ID) {}
|
|
|
|
// Pass Name
|
|
StringRef getPassName() const override {
|
|
return "MIPS DAG->DAG Pattern Instruction Selection";
|
|
}
|
|
|
|
void getAnalysisUsage(AnalysisUsage &AU) const override {
|
|
AU.addRequired<TargetPassConfig>();
|
|
MachineFunctionPass::getAnalysisUsage(AU);
|
|
}
|
|
|
|
bool runOnMachineFunction(MachineFunction &MF) override;
|
|
};
|
|
|
|
char MipsModuleDAGToDAGISel::ID = 0;
|
|
}
|
|
|
|
bool MipsModuleDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
|
|
LLVM_DEBUG(errs() << "In MipsModuleDAGToDAGISel::runMachineFunction\n");
|
|
auto &TPC = getAnalysis<TargetPassConfig>();
|
|
auto &TM = TPC.getTM<MipsTargetMachine>();
|
|
TM.resetSubtarget(&MF);
|
|
return false;
|
|
}
|
|
|
|
llvm::FunctionPass *llvm::createMipsModuleISelDagPass() {
|
|
return new MipsModuleDAGToDAGISel();
|
|
}
|