#include <set>
using namespace llvm;
-namespace {
- Statistic<> NumArgumentsEliminated("deadargelim",
- "Number of unread args removed");
- Statistic<> NumRetValsEliminated("deadargelim",
- "Number of unused return values removed");
+STATISTIC(NumArgumentsEliminated, "Number of unread args removed");
+STATISTIC(NumRetValsEliminated , "Number of unused return values removed");
+namespace {
/// DAE - The dead argument elimination pass.
///
class DAE : public ModulePass {
// Work around LLVM bug PR56: the CWriter cannot emit varargs functions which
// have zero fixed arguments.
//
- // FIXME: once this bug is fixed in the CWriter, this hack should be removed.
- //
bool ExtraArgHack = false;
if (Params.empty() && FTy->isVarArg()) {
ExtraArgHack = true;
Args.push_back(*AI);
if (ExtraArgHack)
- Args.push_back(Constant::getNullValue(Type::IntTy));
+ Args.push_back(UndefValue::get(Type::IntTy));
// Push any varargs arguments on the list
for (; AI != CS.arg_end(); ++AI)