} else if (isa<ConstantPointerNull>(CV)) {
Out << "null";
+ } else if (isa<UndefValue>(CV)) {
+ Out << "undef";
+
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
Out << CE->getOpcodeName() << " (";
const Module* getModule() { return TheModule; }
-private :
+private:
void printModule(const Module *M);
void printSymbolTable(const SymbolTable &ST);
void printConstant(const Constant *CPV);
if (!M->getTargetTriple().empty())
Out << "target triple = \"" << M->getTargetTriple() << "\"\n";
- // Loop over the dependent libraries and emit them
- Module::lib_iterator LI= M->lib_begin();
- Module::lib_iterator LE= M->lib_end();
+ // Loop over the dependent libraries and emit them.
+ Module::lib_iterator LI = M->lib_begin();
+ Module::lib_iterator LE = M->lib_end();
if (LI != LE) {
- Out << "deplibs = [\n";
- while ( LI != LE ) {
- Out << "\"" << *LI << "\"";
+ Out << "deplibs = [ ";
+ while (LI != LE) {
+ Out << '"' << *LI << '"';
++LI;
- if ( LI != LE )
- Out << ",\n";
+ if (LI != LE)
+ Out << ", ";
}
Out << " ]\n";
}
-
- // Loop over the symbol table, emitting all named constants...
+
+ // Loop over the symbol table, emitting all named constants.
printSymbolTable(M->getSymbolTable());
for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
Out << "\nimplementation ; Functions:\n";
- // Output all of the functions...
+ // Output all of the functions.
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
printFunction(I);
}
case GlobalValue::WeakLinkage: Out << "weak "; break;
case GlobalValue::AppendingLinkage: Out << "appending "; break;
case GlobalValue::ExternalLinkage: break;
+ case GlobalValue::GhostLinkage:
+ std::cerr << "GhostLinkage not allowed in AsmWriter!\n";
+ abort();
}
Out << (GV->isConstant() ? "constant " : "global ");
case GlobalValue::WeakLinkage: Out << "weak "; break;
case GlobalValue::AppendingLinkage: Out << "appending "; break;
case GlobalValue::ExternalLinkage: break;
+ case GlobalValue::GhostLinkage:
+ std::cerr << "GhostLinkage not allowed in AsmWriter!\n";
+ abort();
}
printType(F->getReturnType()) << ' ';