Doxygenified some comments, reduced extraneous space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10501 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman
2003-12-17 22:06:08 +00:00
parent d71295a684
commit c3402cd735

View File

@@ -94,13 +94,11 @@ static GetElementPtrInst* getGlobalAddr(Value* ptr, Instruction& insertBefore) {
: NULL; : NULL;
} }
// Wrapper on Constant::classof to use in find_if
// Wrapper on Constant::classof to use in find_if :-(
inline static bool nonConstant(const Use& U) { inline static bool nonConstant(const Use& U) {
return ! isa<Constant>(U); return ! isa<Constant>(U);
} }
static Instruction* DecomposeConstantExpr(ConstantExpr* CE, static Instruction* DecomposeConstantExpr(ConstantExpr* CE,
Instruction& insertBefore) Instruction& insertBefore)
{ {
@@ -177,15 +175,15 @@ PreSelection::visitOneOperand(Instruction &I, Value* Op, unsigned opNum,
} }
} }
// visitOperands() transforms individual operands of all instructions: /// visitOperands - transform individual operands of all instructions:
// -- Load "large" int constants into a virtual register. What is large /// -- Load "large" int constants into a virtual register. What is large
// depends on the type of instruction and on the target architecture. /// depends on the type of instruction and on the target architecture.
// -- For any constants that cannot be put in an immediate field, /// -- For any constants that cannot be put in an immediate field,
// load address into virtual register first, and then load the constant. /// load address into virtual register first, and then load the constant.
// ///
// firstOp and lastOp can be used to skip leading and trailing operands. /// firstOp and lastOp can be used to skip leading and trailing operands.
// If lastOp is 0, it defaults to #operands or #incoming Phi values. /// If lastOp is 0, it defaults to #operands or #incoming Phi values.
// ///
inline void PreSelection::visitOperands(Instruction &I, int firstOp) { inline void PreSelection::visitOperands(Instruction &I, int firstOp) {
// For any instruction other than PHI, copies go just before the instr. // For any instruction other than PHI, copies go just before the instr.
for (unsigned i = firstOp, e = I.getNumOperands(); i != e; ++i) for (unsigned i = firstOp, e = I.getNumOperands(); i != e; ++i)
@@ -205,15 +203,12 @@ void PreSelection::visitPHINode(PHINode &PN) {
// do not call visitOperands! // do not call visitOperands!
} }
// Common work for *all* instructions. This needs to be called explicitly // Common work for *all* instructions. This needs to be called explicitly
// by other visit<InstructionType> functions. // by other visit<InstructionType> functions.
inline void PreSelection::visitInstruction(Instruction &I) { inline void PreSelection::visitInstruction(Instruction &I) {
visitOperands(I); // Perform operand transformations visitOperands(I); // Perform operand transformations
} }
// GetElementPtr instructions: check if pointer is a global // GetElementPtr instructions: check if pointer is a global
void PreSelection::visitGetElementPtrInst(GetElementPtrInst &I) { void PreSelection::visitGetElementPtrInst(GetElementPtrInst &I) {
Instruction* curI = &I; Instruction* curI = &I;
@@ -239,10 +234,8 @@ void PreSelection::visitCallInst(CallInst &I) {
visitOperands(I, (/*firstOp=*/ I.getCalledFunction()? 1 : 0)); visitOperands(I, (/*firstOp=*/ I.getCalledFunction()? 1 : 0));
} }
//===----------------------------------------------------------------------===// /// createPreSelectionPass - Public entry point for the PreSelection pass
// createPreSelectionPass - Public entrypoint for pre-selection pass ///
// and this file as a whole...
//
FunctionPass* createPreSelectionPass(const TargetMachine &TM) { FunctionPass* createPreSelectionPass(const TargetMachine &TM) {
return new PreSelection(TM); return new PreSelection(TM);
} }