Doxygenify comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman
2004-03-02 00:22:19 +00:00
parent 0256e4bbf9
commit ab5c6003d2
2 changed files with 46 additions and 50 deletions

View File

@ -97,9 +97,9 @@ static std::string getLLVMName(const std::string &Name) {
} }
// If the module has a symbol table, take all global types and stuff their /// fillTypeNameTable - If the module has a symbol table, take all global types
// names into the TypeNames map. /// and stuff their names into the TypeNames map.
// ///
static void fillTypeNameTable(const Module *M, static void fillTypeNameTable(const Module *M,
std::map<const Type *, std::string> &TypeNames) { std::map<const Type *, std::string> &TypeNames) {
if (!M) return; if (!M) return;
@ -381,10 +381,10 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
} }
// WriteAsOperand - Write the name of the specified value out to the specified /// WriteAsOperand - Write the name of the specified value out to the specified
// ostream. This can be useful when you just want to print int %reg126, not the /// ostream. This can be useful when you just want to print int %reg126, not
// whole instruction that generated it. /// the whole instruction that generated it.
// ///
static void WriteAsOperandInternal(std::ostream &Out, const Value *V, static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
bool PrintName, bool PrintName,
std::map<const Type*, std::string> &TypeTable, std::map<const Type*, std::string> &TypeTable,
@ -422,7 +422,6 @@ static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
} }
/// WriteAsOperand - Write the name of the specified value out to the specified /// WriteAsOperand - Write the name of the specified value out to the specified
/// ostream. This can be useful when you just want to print int %reg126, not /// ostream. This can be useful when you just want to print int %reg126, not
/// the whole instruction that generated it. /// the whole instruction that generated it.
@ -503,9 +502,9 @@ private :
}; };
} // end of anonymous namespace } // end of anonymous namespace
// printTypeAtLeastOneLevel - Print out one level of the possibly complex type /// printTypeAtLeastOneLevel - Print out one level of the possibly complex type
// without considering any symbolic types that we may have equal to it. /// without considering any symbolic types that we may have equal to it.
// ///
std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) {
if (const FunctionType *FTy = dyn_cast<FunctionType>(Ty)) { if (const FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
printType(FTy->getReturnType()) << " ("; printType(FTy->getReturnType()) << " (";
@ -602,9 +601,9 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
} }
// printSymbolTable - Run through symbol table looking for named constants /// printSymbolTable - Run through symbol table looking for named constants
// if a named constant is found, emit it's declaration... /// if a named constant is found, emit it's declaration...
// ///
void AssemblyWriter::printSymbolTable(const SymbolTable &ST) { void AssemblyWriter::printSymbolTable(const SymbolTable &ST) {
for (SymbolTable::const_iterator TI = ST.begin(); TI != ST.end(); ++TI) { for (SymbolTable::const_iterator TI = ST.begin(); TI != ST.end(); ++TI) {
SymbolTable::type_const_iterator I = ST.type_begin(TI->first); SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
@ -628,8 +627,8 @@ void AssemblyWriter::printSymbolTable(const SymbolTable &ST) {
} }
// printConstant - Print out a constant pool entry... /// printConstant - Print out a constant pool entry...
// ///
void AssemblyWriter::printConstant(const Constant *CPV) { void AssemblyWriter::printConstant(const Constant *CPV) {
// Don't print out unnamed constants, they will be inlined // Don't print out unnamed constants, they will be inlined
if (!CPV->hasName()) return; if (!CPV->hasName()) return;
@ -644,8 +643,8 @@ void AssemblyWriter::printConstant(const Constant *CPV) {
Out << "\n"; Out << "\n";
} }
// printFunction - Print all aspects of a function. /// printFunction - Print all aspects of a function.
// ///
void AssemblyWriter::printFunction(const Function *F) { void AssemblyWriter::printFunction(const Function *F) {
// Print out the return type and name... // Print out the return type and name...
Out << "\n"; Out << "\n";
@ -699,9 +698,9 @@ void AssemblyWriter::printFunction(const Function *F) {
Table.purgeFunction(); Table.purgeFunction();
} }
// printArgument - This member is called for every argument that /// printArgument - This member is called for every argument that is passed into
// is passed into the function. Simply print it out /// the function. Simply print it out
// ///
void AssemblyWriter::printArgument(const Argument *Arg) { void AssemblyWriter::printArgument(const Argument *Arg) {
// Insert commas as we go... the first arg doesn't get a comma // Insert commas as we go... the first arg doesn't get a comma
if (Arg != &Arg->getParent()->afront()) Out << ", "; if (Arg != &Arg->getParent()->afront()) Out << ", ";
@ -716,8 +715,8 @@ void AssemblyWriter::printArgument(const Argument *Arg) {
Out << "<badref>"; Out << "<badref>";
} }
// printBasicBlock - This member is called for each basic block in a method. /// printBasicBlock - This member is called for each basic block in a method.
// ///
void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
if (BB->hasName()) { // Print out the label if it exists... if (BB->hasName()) { // Print out the label if it exists...
Out << "\n" << BB->getName() << ":"; Out << "\n" << BB->getName() << ":";
@ -761,9 +760,9 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
} }
// printInfoComment - Print a little comment after the instruction indicating /// printInfoComment - Print a little comment after the instruction indicating
// which slot it occupies. /// which slot it occupies.
// ///
void AssemblyWriter::printInfoComment(const Value &V) { void AssemblyWriter::printInfoComment(const Value &V) {
if (V.getType() != Type::VoidTy) { if (V.getType() != Type::VoidTy) {
Out << "\t\t; <"; Out << "\t\t; <";
@ -778,8 +777,8 @@ void AssemblyWriter::printInfoComment(const Value &V) {
} }
} }
// printInstruction - This member is called for each Instruction in a method. /// printInstruction - This member is called for each Instruction in a method.
// ///
void AssemblyWriter::printInstruction(const Instruction &I) { void AssemblyWriter::printInstruction(const Instruction &I) {
if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out); if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out);

View File

@ -78,7 +78,6 @@ namespace { // Anonymous namespace for class
// If this is a real pass, in a pass manager, we must abort before // If this is a real pass, in a pass manager, we must abort before
// returning back to the pass manager, or else the pass manager may try to // returning back to the pass manager, or else the pass manager may try to
// run other passes on the broken module. // run other passes on the broken module.
//
if (RealPass) if (RealPass)
abortIfBroken(); abortIfBroken();
return false; return false;
@ -92,7 +91,6 @@ namespace { // Anonymous namespace for class
// If this is a real pass, in a pass manager, we must abort before // If this is a real pass, in a pass manager, we must abort before
// returning back to the pass manager, or else the pass manager may try to // returning back to the pass manager, or else the pass manager may try to
// run other passes on the broken module. // run other passes on the broken module.
//
if (RealPass) if (RealPass)
abortIfBroken(); abortIfBroken();
@ -118,9 +116,9 @@ namespace { // Anonymous namespace for class
AU.addRequired<DominatorSet>(); AU.addRequired<DominatorSet>();
} }
// abortIfBroken - If the module is broken and we are supposed to abort on /// abortIfBroken - If the module is broken and we are supposed to abort on
// this condition, do so. /// this condition, do so.
// ///
void abortIfBroken() const { void abortIfBroken() const {
if (Broken && AbortBroken) { if (Broken && AbortBroken) {
std::cerr << "Broken module found, compilation aborted!\n"; std::cerr << "Broken module found, compilation aborted!\n";
@ -167,7 +165,6 @@ namespace { // Anonymous namespace for class
// CheckFailed - A check failed, so print out the condition and the message // CheckFailed - A check failed, so print out the condition and the message
// that failed. This provides a nice place to put a breakpoint if you want // that failed. This provides a nice place to put a breakpoint if you want
// to see why something is not correct. // to see why something is not correct.
//
void CheckFailed(const std::string &Message, void CheckFailed(const std::string &Message,
const Value *V1 = 0, const Value *V2 = 0, const Value *V1 = 0, const Value *V2 = 0,
const Value *V3 = 0, const Value *V4 = 0) { const Value *V3 = 0, const Value *V4 = 0) {
@ -338,15 +335,16 @@ void Verifier::visitReturnInst(ReturnInst &RI) {
visitTerminatorInst(RI); visitTerminatorInst(RI);
} }
// visitUserOp1 - User defined operators shouldn't live beyond the lifetime of a /// visitUserOp1 - User defined operators shouldn't live beyond the lifetime of
// pass, if any exist, it's an error. /// a pass, if any exist, it's an error.
// ///
void Verifier::visitUserOp1(Instruction &I) { void Verifier::visitUserOp1(Instruction &I) {
Assert1(0, "User-defined operators should not live outside of a pass!", Assert1(0, "User-defined operators should not live outside of a pass!",
&I); &I);
} }
// visitPHINode - Ensure that a PHI node is well formed. /// visitPHINode - Ensure that a PHI node is well formed.
///
void Verifier::visitPHINode(PHINode &PN) { void Verifier::visitPHINode(PHINode &PN) {
// Ensure that the PHI nodes are all grouped together at the top of the block. // Ensure that the PHI nodes are all grouped together at the top of the block.
// This can be tested by checking whether the instruction before this is // This can be tested by checking whether the instruction before this is
@ -397,9 +395,9 @@ void Verifier::visitCallInst(CallInst &CI) {
visitInstruction(CI); visitInstruction(CI);
} }
// visitBinaryOperator - Check that both arguments to the binary operator are /// visitBinaryOperator - Check that both arguments to the binary operator are
// of the same type! /// of the same type!
// ///
void Verifier::visitBinaryOperator(BinaryOperator &B) { void Verifier::visitBinaryOperator(BinaryOperator &B) {
Assert1(B.getOperand(0)->getType() == B.getOperand(1)->getType(), Assert1(B.getOperand(0)->getType() == B.getOperand(1)->getType(),
"Both operands to a binary operator are not of the same type!", &B); "Both operands to a binary operator are not of the same type!", &B);
@ -465,8 +463,8 @@ void Verifier::visitStoreInst(StoreInst &SI) {
} }
// verifyInstruction - Verify that an instruction is well formed. /// verifyInstruction - Verify that an instruction is well formed.
// ///
void Verifier::visitInstruction(Instruction &I) { void Verifier::visitInstruction(Instruction &I) {
BasicBlock *BB = I.getParent(); BasicBlock *BB = I.getParent();
Assert1(BB, "Instruction not embedded in basic block!", &I); Assert1(BB, "Instruction not embedded in basic block!", &I);
@ -486,7 +484,6 @@ void Verifier::visitInstruction(Instruction &I) {
// Check that all uses of the instruction, if they are instructions // Check that all uses of the instruction, if they are instructions
// themselves, actually have parent basic blocks. If the use is not an // themselves, actually have parent basic blocks. If the use is not an
// instruction, it is an error! // instruction, it is an error!
//
for (User::use_iterator UI = I.use_begin(), UE = I.use_end(); for (User::use_iterator UI = I.use_begin(), UE = I.use_end();
UI != UE; ++UI) { UI != UE; ++UI) {
Assert1(isa<Instruction>(*UI), "Use of instruction is not an instruction!", Assert1(isa<Instruction>(*UI), "Use of instruction is not an instruction!",
@ -507,7 +504,6 @@ void Verifier::visitInstruction(Instruction &I) {
BasicBlock *OpBlock = Op->getParent(); BasicBlock *OpBlock = Op->getParent();
// Check that a definition dominates all of its uses. // Check that a definition dominates all of its uses.
//
if (!isa<PHINode>(I)) { if (!isa<PHINode>(I)) {
// Invoke results are only usable in the normal destination, not in the // Invoke results are only usable in the normal destination, not in the
// exceptional destination. // exceptional destination.
@ -531,6 +527,7 @@ void Verifier::visitInstruction(Instruction &I) {
} }
/// visitIntrinsicFunction - Allow intrinsics to be verified in different ways. /// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
///
void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
Function *IF = CI.getCalledFunction(); Function *IF = CI.getCalledFunction();
const FunctionType *FT = IF->getFunctionType(); const FunctionType *FT = IF->getFunctionType();
@ -626,9 +623,9 @@ bool llvm::verifyFunction(const Function &f) {
return V.Broken; return V.Broken;
} }
// verifyModule - Check a module for errors, printing messages on stderr. /// verifyModule - Check a module for errors, printing messages on stderr.
// Return true if the module is corrupt. /// Return true if the module is corrupt.
// ///
bool llvm::verifyModule(const Module &M) { bool llvm::verifyModule(const Module &M) {
PassManager PM; PassManager PM;
Verifier *V = new Verifier(); Verifier *V = new Verifier();