diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-07-14 05:52:33 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-07-14 05:52:33 +0000 |
| commit | 177a3008e1eb46a14f29ffaf008488be5c38bbe8 (patch) | |
| tree | 10a36574de0ab55210056728d1dae28b8b06958b /llvm/lib | |
| parent | eab49263b5179f6a2d88c8467d17237f417060a5 (diff) | |
| download | bcm5719-llvm-177a3008e1eb46a14f29ffaf008488be5c38bbe8.tar.gz bcm5719-llvm-177a3008e1eb46a14f29ffaf008488be5c38bbe8.zip | |
wrap long lines, remove some code from a non-assert build.
llvm-svn: 53545
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index ea7769a1159..d771d053ad8 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -340,6 +340,7 @@ static bool LinkTypes(Module *Dest, const Module *Src, std::string *Err) { return false; } +#ifndef NDEBUG static void PrintMap(const std::map<const Value*, Value*> &M) { for (std::map<const Value*, Value*>::const_iterator I = M.begin(), E =M.end(); I != E; ++I) { @@ -350,6 +351,7 @@ static void PrintMap(const std::map<const Value*, Value*> &M) { cerr << "\n"; } } +#endif // 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) Ops.push_back(cast<Constant>(RemapOperand(CE->getOperand(i),ValueMap))); Result = CE->getWithOperands(Ops); - } else if (isa<GlobalValue>(CPV)) { - assert(0 && "Unmapped global?"); } else { + assert(!isa<GlobalValue>(CPV) && "Unmapped global?"); assert(0 && "Unknown type of derived type constant value!"); } } else if (isa<InlineAsm>(In)) { @@ -403,12 +404,13 @@ static Value *RemapOperand(const Value *In, return Result; } - +#ifndef NDEBUG cerr << "LinkModules ValueMap: \n"; PrintMap(ValueMap); cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n"; assert(0 && "Couldn't remap value!"); +#endif return 0; } @@ -533,8 +535,8 @@ static bool LinkGlobals(Module *Dest, const Module *Src, std::multimap<std::string, GlobalVariable *> &AppendingVars, std::string *Err) { // 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(); - I != E; ++I) { + for (Module::const_global_iterator I = Src->global_begin(), + E = Src->global_end(); I != E; ++I) { const GlobalVariable *SGV = I; GlobalValue *DGV = 0; |

