mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Convert to SymbolTable's new iteration interface. Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13753 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -184,14 +184,17 @@ namespace { // Anonymous namespace for class
|
||||
if (!V) return;
|
||||
if (isa<Instruction>(V)) {
|
||||
msgs << *V;
|
||||
} else if (const Type *Ty = dyn_cast<Type>(V)) {
|
||||
WriteTypeSymbolic(msgs, Ty, Mod);
|
||||
} else {
|
||||
WriteAsOperand (msgs, V, true, true, Mod);
|
||||
msgs << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void WriteType(const Type* T ) {
|
||||
if ( !T ) return;
|
||||
WriteTypeSymbolic(msgs, T, Mod );
|
||||
}
|
||||
|
||||
|
||||
// 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
|
||||
@@ -206,6 +209,14 @@ namespace { // Anonymous namespace for class
|
||||
WriteValue(V4);
|
||||
Broken = true;
|
||||
}
|
||||
|
||||
void CheckFailed( const std::string& Message, const Value* V1,
|
||||
const Type* T2, const Value* V3 = 0 ) {
|
||||
msgs << Message << "\n";
|
||||
WriteValue(V1);
|
||||
WriteType(T2);
|
||||
WriteValue(V3);
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<Verifier> X("verify", "Module Verifier");
|
||||
@@ -241,12 +252,13 @@ void Verifier::visitGlobalValue(GlobalValue &GV) {
|
||||
// verifySymbolTable - Verify that a function or module symbol table is ok
|
||||
//
|
||||
void Verifier::verifySymbolTable(SymbolTable &ST) {
|
||||
// Loop over all of the types in the symbol table...
|
||||
for (SymbolTable::iterator TI = ST.begin(), TE = ST.end(); TI != TE; ++TI)
|
||||
for (SymbolTable::type_iterator I = TI->second.begin(),
|
||||
E = TI->second.end(); I != E; ++I) {
|
||||
Value *V = I->second;
|
||||
|
||||
// Loop over all of the values in all type planes in the symbol table.
|
||||
for (SymbolTable::plane_const_iterator PI = ST.plane_begin(),
|
||||
PE = ST.plane_end(); PI != PE; ++PI)
|
||||
for (SymbolTable::value_const_iterator VI = PI->second.begin(),
|
||||
VE = PI->second.end(); VI != VE; ++VI) {
|
||||
Value *V = VI->second;
|
||||
// Check that there are no void typed values in the symbol table. Values
|
||||
// with a void type cannot be put into symbol tables because they cannot
|
||||
// have names!
|
||||
@@ -255,7 +267,6 @@ void Verifier::verifySymbolTable(SymbolTable &ST) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// visitFunction - Verify that a function is ok.
|
||||
//
|
||||
void Verifier::visitFunction(Function &F) {
|
||||
@@ -749,3 +760,5 @@ bool llvm::verifyModule(const Module &M, VerifierFailureAction action) {
|
||||
PM.run((Module&)M);
|
||||
return V->Broken;
|
||||
}
|
||||
|
||||
// vim: sw=2
|
||||
|
Reference in New Issue
Block a user