#include "llvm/Bytecode/Reader.h"
#include "llvm/Assembly/Parser.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Target/TargetData.h"
#include "llvm/Support/PassNameParser.h"
#include "Support/Timer.h"
#include <algorithm>
//
PassManager Passes;
+ // Add an appropriate TargetData instance for this module...
+ Passes.add(new TargetData("analyze", CurMod));
+
// Make sure the input LLVM is well formed.
Passes.add(createVerifierPass());
}
PassManager PM;
+ // Make sure that the appropriate target data is always used...
+ PM.add(new TargetData("bugpoint", Program));
+
for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
if (Passes[i]->getNormalCtor())
PM.add(Passes[i]->getNormalCtor()());
addPass(PM, createGlobalDCEPass()); // Kill unused uinit g-vars
addPass(PM, createDeadTypeEliminationPass()); // Eliminate dead types
addPass(PM, createConstantMergePass()); // Merge dup global constants
- addPass(PM, createVerifierPass()); // Verify that input is correct
addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs
+ addPass(PM, createVerifierPass()); // Verify that input is correct
addPass(PM, createDeadInstEliminationPass()); // Remove Dead code/vars
addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst
addPass(PM, createIndVarSimplifyPass()); // Simplify indvars
//
PassManager Passes;
+ // Add an appropriate TargetData instance for this module...
+ Passes.add(new TargetData("gccas", M.get()));
+
// Add all of the transformation passes to the pass manager to do the cleanup
// and optimization of the GCC output.
//
#include "llvm/PassManager.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/WriteBytecodePass.h"
+#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "Support/CommandLine.h"
//
PassManager Passes;
+ // Add an appropriate TargetData instance for this module...
+ Passes.add(new TargetData("gccas", Composite.get()));
+
// Linking modules together can lead to duplicated global constants, only keep
// one copy of each constant...
//
//
PassManager Passes;
+ // Add an appropriate TargetData instance for this module...
+ Passes.add(new TargetData("opt", M.get()));
+
// Create a new optimization pass for each one specified on the command line
for (unsigned i = 0; i < OptimizationList.size(); ++i) {
const PassInfo *Opt = OptimizationList[i];