#include "Support/hash_map"
#include <functional>
#include <algorithm>
-
-namespace llvm {
+using namespace llvm;
//----------------------------------------------------------------------------
// Global constants used in marking Cilk functions and function calls.
return true;
}
-} // End llvm namespace
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumMerged("constmerge", "Number of global constants merged");
RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
}
-Pass *createConstantMergePass() { return new ConstantMerge(); }
+Pass *llvm::createConstantMergePass() { return new ConstantMerge(); }
bool ConstantMerge::run(Module &M) {
std::map<Constant*, GlobalVariable*> CMap;
return MadeChanges;
}
-} // End llvm namespace
#include "Support/Statistic.h"
#include "Support/iterator"
#include <set>
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumArgumentsEliminated("deadargelim",
/// createDeadArgEliminationPass - This pass removes arguments from functions
/// which are not used by the body of the function.
///
-Pass *createDeadArgEliminationPass() { return new DAE(); }
-Pass *createDeadArgHackingPass() { return new DAH(); }
+Pass *llvm::createDeadArgEliminationPass() { return new DAE(); }
+Pass *llvm::createDeadArgHackingPass() { return new DAH(); }
static inline bool CallPassesValueThoughVararg(Instruction *Call,
const Value *Arg) {
RemoveDeadArgumentsFromFunction(*DeadRetVal.begin());
return true;
}
-
-} // End llvm namespace
-
#include "llvm/SymbolTable.h"
#include "llvm/DerivedTypes.h"
#include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
struct DTE : public Pass {
NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
}
-Pass *createDeadTypeEliminationPass() {
+Pass *llvm::createDeadTypeEliminationPass() {
return new DTE();
}
return Changed;
}
-
-} // End llvm namespace
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+
#include "llvm/Transforms/IPO.h"
#include "llvm/Pass.h"
#include "llvm/Module.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
class FunctionExtractorPass : public Pass {
RegisterPass<FunctionExtractorPass> X("extract", "Function Extractor");
}
-Pass *createFunctionExtractionPass(Function *F) {
+Pass *llvm::createFunctionExtractionPass(Function *F) {
return new FunctionExtractorPass(F);
}
-
-} // End llvm namespace
#include "llvm/Pass.h"
#include "Support/Statistic.h"
#include <set>
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumFunctions("globaldce","Number of functions removed");
RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");
}
-Pass *createGlobalDCEPass() { return new GlobalDCE(); }
+Pass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
bool GlobalDCE::run(Module &M) {
bool Changed = false;
return true;
}
-} // End llvm namespace
#include "llvm/Constants.h"
#include "llvm/Support/CallSite.h"
#include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumArgumentsProped("ipconstprop",
RegisterOpt<IPCP> X("ipconstprop", "Interprocedural constant propagation");
}
-Pass *createIPConstantPropagationPass() { return new IPCP(); }
+Pass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
bool IPCP::run(Module &M) {
bool Changed = false;
Value *V = ArgumentConstants[i].first;
if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
V = CPR->getValue();
+
AI->replaceAllUsesWith(V);
++NumArgumentsProped;
MadeChange = true;
return MadeChange;
}
-} // End llvm namespace
#include "Support/Statistic.h"
#include <fstream>
#include <set>
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumFunctions("internalize", "Number of functions internalized");
RegisterOpt<InternalizePass> X("internalize", "Internalize Global Symbols");
} // end anonymous namespace
-Pass *createInternalizePass() {
+Pass *llvm::createInternalizePass() {
return new InternalizePass();
}
-
-} // End llvm namespace
// pass invokable via the "opt" command at will.
//===----------------------------------------------------------------------===//
+#include "llvm/Transforms/IPO.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "Support/Statistic.h"
#include "Support/StringExtras.h"
#include "Support/VectorExtras.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> LongJmpsTransformed("lowersetjmp",
"", &UI);
}
-Pass* createLowerSetJmpPass()
+Pass* llvm::createLowerSetJmpPass()
{
return new LowerSetJmp();
}
-} // End llvm namespace
#include "Support/hash_map"
#include <functional>
#include <algorithm>
-
-namespace llvm {
+using namespace llvm;
//----------------------------------------------------------------------------
// Global constants used in marking Cilk functions and function calls.
return true;
}
-} // End llvm namespace
//
//===----------------------------------------------------------------------===//
+#include "llvm/Transforms/IPO.h"
#include "llvm/CallGraphSCCPass.h"
#include "llvm/Function.h"
#include "llvm/Intrinsics.h"
#include "llvm/Analysis/CallGraph.h"
#include "Support/Statistic.h"
#include <set>
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumRemoved("prune-eh", "Number of invokes removed");
RegisterOpt<PruneEH> X("prune-eh", "Remove unused exception handling info");
}
-Pass *createPruneEHPass() { return new PruneEH(); }
+Pass *llvm::createPruneEHPass() { return new PruneEH(); }
bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
return MadeChange;
}
-} // End llvm namespace
#include "llvm/Pass.h"
#include "llvm/Support/CallSite.h"
#include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumRaised("raiseallocs", "Number of allocations raised");
// createRaiseAllocationsPass - The interface to this file...
-Pass *createRaiseAllocationsPass() {
+Pass *llvm::createRaiseAllocationsPass() {
return new RaiseAllocations();
}
return Changed;
}
-} // End llvm namespace