mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-08 17:11:33 +00:00
One last pass of DataLayout variable renaming.
llvm-svn: 201834
This commit is contained in:
parent
612886fc8c
commit
f193902918
@ -293,8 +293,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
|
||||
PM.add(TLI);
|
||||
|
||||
// Add the target data from the target machine, if it exists, or the module.
|
||||
if (const DataLayout *TD = Target.getDataLayout())
|
||||
PM.add(new DataLayout(*TD));
|
||||
if (const DataLayout *DL = Target.getDataLayout())
|
||||
PM.add(new DataLayout(*DL));
|
||||
else
|
||||
PM.add(new DataLayout(mod));
|
||||
|
||||
|
@ -425,15 +425,15 @@ int main(int argc, char **argv) {
|
||||
Passes.add(TLI);
|
||||
|
||||
// Add an appropriate DataLayout instance for this module.
|
||||
DataLayout *TD = 0;
|
||||
DataLayout *DL = 0;
|
||||
const std::string &ModuleDataLayout = M.get()->getDataLayout();
|
||||
if (!ModuleDataLayout.empty())
|
||||
TD = new DataLayout(ModuleDataLayout);
|
||||
DL = new DataLayout(ModuleDataLayout);
|
||||
else if (!DefaultDataLayout.empty())
|
||||
TD = new DataLayout(DefaultDataLayout);
|
||||
DL = new DataLayout(DefaultDataLayout);
|
||||
|
||||
if (TD)
|
||||
Passes.add(TD);
|
||||
if (DL)
|
||||
Passes.add(DL);
|
||||
|
||||
Triple ModuleTriple(M->getTargetTriple());
|
||||
TargetMachine *Machine = 0;
|
||||
@ -448,8 +448,8 @@ int main(int argc, char **argv) {
|
||||
OwningPtr<FunctionPassManager> FPasses;
|
||||
if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) {
|
||||
FPasses.reset(new FunctionPassManager(M.get()));
|
||||
if (TD)
|
||||
FPasses->add(new DataLayout(*TD));
|
||||
if (DL)
|
||||
FPasses->add(new DataLayout(*DL));
|
||||
if (TM.get())
|
||||
TM->addAnalysisPasses(*FPasses);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user