[llvm-commits] [llvm] r172550 - /llvm/trunk/lib/Linker/LinkModules.cpp
Daniel Dunbar
daniel at zuster.org
Tue Jan 15 12:52:09 PST 2013
Author: ddunbar
Date: Tue Jan 15 14:52:09 2013
New Revision: 172550
URL: http://llvm.org/viewvc/llvm-project?rev=172550&view=rev
Log:
[Linker] Drop asserts that are embedded in cast<> and now checked by the verifier.
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=172550&r1=172549&r2=172550&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Jan 15 14:52:09 2013
@@ -1001,19 +1001,10 @@
for (unsigned I = 0, E = ModFlags->getNumOperands(); I != E; ++I) {
MDNode *Op = ModFlags->getOperand(I);
- assert(Op->getNumOperands() == 3 && "Invalid module flag metadata!");
- assert(isa<ConstantInt>(Op->getOperand(0)) &&
- "Module flag's first operand must be an integer!");
- assert(isa<MDString>(Op->getOperand(1)) &&
- "Module flag's second operand must be an MDString!");
-
ConstantInt *Behavior = cast<ConstantInt>(Op->getOperand(0));
MDString *ID = cast<MDString>(Op->getOperand(1));
Value *Val = Op->getOperand(2);
switch (Behavior->getZExtValue()) {
- default:
- assert(false && "Invalid behavior in module flag metadata!");
- break;
case Module::Error: {
MDNode *&ErrNode = ErrorNode[ID];
if (!ErrNode) ErrNode = Op;
@@ -1126,8 +1117,6 @@
for (SmallSetVector<MDNode*, 8>::iterator
II = Set.begin(), IE = Set.end(); II != IE; ++II) {
MDNode *Node = *II;
- assert(isa<MDNode>(Node->getOperand(2)) &&
- "Module flag's third operand must be an MDNode!");
MDNode *Val = cast<MDNode>(Node->getOperand(2));
MDString *ReqID = cast<MDString>(Val->getOperand(0));
More information about the llvm-commits
mailing list