diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-25 17:30:31 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-25 17:30:31 +0000 |
commit | 935125126c4ffde74ef3a82959fde69ee8c6b648 (patch) | |
tree | c8f13ff32afa704ca5ae5ad3faf4650f9ea2f4c2 /llvm/tools | |
parent | 48f52e926d6e8273587f5befc997fc784b04855b (diff) | |
download | bcm5719-llvm-935125126c4ffde74ef3a82959fde69ee8c6b648.tar.gz bcm5719-llvm-935125126c4ffde74ef3a82959fde69ee8c6b648.zip |
Make DataLayout a plain object, not a pass.
Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM
don't don't handle passes to also use DataLayout.
llvm-svn: 202168
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llc/llc.cpp | 4 | ||||
-rw-r--r-- | llvm/tools/llvm-extract/llvm-extract.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/opt/opt.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp index 3c4336addba..5b311cb6173 100644 --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -299,9 +299,9 @@ static int compileModule(char **argv, LLVMContext &Context) { // Add the target data from the target machine, if it exists, or the module. if (const DataLayout *DL = Target.getDataLayout()) - PM.add(new DataLayout(*DL)); + PM.add(new DataLayoutPass(*DL)); else - PM.add(new DataLayout(mod)); + PM.add(new DataLayoutPass(mod)); // Override default to generate verbose assembly. Target.setAsmVerbosityDefault(true); diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp index 45c920ff3c1..b1c1f68f55f 100644 --- a/llvm/tools/llvm-extract/llvm-extract.cpp +++ b/llvm/tools/llvm-extract/llvm-extract.cpp @@ -254,7 +254,7 @@ int main(int argc, char **argv) { // In addition to deleting all other functions, we also want to spiff it // up a little bit. Do this now. PassManager Passes; - Passes.add(new DataLayout(M.get())); // Use correct DataLayout + Passes.add(new DataLayoutPass(M.get())); // Use correct DataLayout std::vector<GlobalValue*> Gvs(GVs.begin(), GVs.end()); diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 9ab43148dab..19adf78cd34 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -437,7 +437,7 @@ int main(int argc, char **argv) { DL = new DataLayout(DefaultDataLayout); if (DL) - Passes.add(DL); + Passes.add(new DataLayoutPass(*DL)); Triple ModuleTriple(M->getTargetTriple()); TargetMachine *Machine = 0; @@ -453,7 +453,7 @@ int main(int argc, char **argv) { if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) { FPasses.reset(new FunctionPassManager(M.get())); if (DL) - FPasses->add(new DataLayout(*DL)); + FPasses->add(new DataLayoutPass(*DL)); if (TM.get()) TM->addAnalysisPasses(*FPasses); |