wrap long lines, remove some code from a non-assert build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53545 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2008-07-14 05:52:33 +00:00
parent bbedb0e408
commit 0bb8757997

View File

@@ -340,6 +340,7 @@ static bool LinkTypes(Module *Dest, const Module *Src, std::string *Err) {
return false; return false;
} }
#ifndef NDEBUG
static void PrintMap(const std::map<const Value*, Value*> &M) { static void PrintMap(const std::map<const Value*, Value*> &M) {
for (std::map<const Value*, Value*>::const_iterator I = M.begin(), E =M.end(); for (std::map<const Value*, Value*>::const_iterator I = M.begin(), E =M.end();
I != E; ++I) { I != E; ++I) {
@@ -350,6 +351,7 @@ static void PrintMap(const std::map<const Value*, Value*> &M) {
cerr << "\n"; cerr << "\n";
} }
} }
#endif
// RemapOperand - Use ValueMap to convert constants from one module to another. // RemapOperand - Use ValueMap to convert constants from one module to another.
@@ -388,9 +390,8 @@ static Value *RemapOperand(const Value *In,
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i)
Ops.push_back(cast<Constant>(RemapOperand(CE->getOperand(i),ValueMap))); Ops.push_back(cast<Constant>(RemapOperand(CE->getOperand(i),ValueMap)));
Result = CE->getWithOperands(Ops); Result = CE->getWithOperands(Ops);
} else if (isa<GlobalValue>(CPV)) {
assert(0 && "Unmapped global?");
} else { } else {
assert(!isa<GlobalValue>(CPV) && "Unmapped global?");
assert(0 && "Unknown type of derived type constant value!"); assert(0 && "Unknown type of derived type constant value!");
} }
} else if (isa<InlineAsm>(In)) { } else if (isa<InlineAsm>(In)) {
@@ -403,12 +404,13 @@ static Value *RemapOperand(const Value *In,
return Result; return Result;
} }
#ifndef NDEBUG
cerr << "LinkModules ValueMap: \n"; cerr << "LinkModules ValueMap: \n";
PrintMap(ValueMap); PrintMap(ValueMap);
cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n"; cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n";
assert(0 && "Couldn't remap value!"); assert(0 && "Couldn't remap value!");
#endif
return 0; return 0;
} }
@@ -533,8 +535,8 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
std::multimap<std::string, GlobalVariable *> &AppendingVars, std::multimap<std::string, GlobalVariable *> &AppendingVars,
std::string *Err) { std::string *Err) {
// Loop over all of the globals in the src module, mapping them over as we go // Loop over all of the globals in the src module, mapping them over as we go
for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end(); for (Module::const_global_iterator I = Src->global_begin(),
I != E; ++I) { E = Src->global_end(); I != E; ++I) {
const GlobalVariable *SGV = I; const GlobalVariable *SGV = I;
GlobalValue *DGV = 0; GlobalValue *DGV = 0;