mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Have opt set up a specific TargetLibraryInfo for modules
with a triple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125970 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a89894537
commit
2a66acafaf
@ -24,7 +24,9 @@
|
|||||||
#include "llvm/Analysis/RegionPass.h"
|
#include "llvm/Analysis/RegionPass.h"
|
||||||
#include "llvm/Analysis/CallGraph.h"
|
#include "llvm/Analysis/CallGraph.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
|
#include "llvm/Target/TargetLibraryInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#include "llvm/ADT/Triple.h"
|
||||||
#include "llvm/Support/PassNameParser.h"
|
#include "llvm/Support/PassNameParser.h"
|
||||||
#include "llvm/Support/Signals.h"
|
#include "llvm/Support/Signals.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
@ -525,11 +527,15 @@ int main(int argc, char **argv) {
|
|||||||
NoOutput = true;
|
NoOutput = true;
|
||||||
|
|
||||||
// Create a PassManager to hold and optimize the collection of passes we are
|
// Create a PassManager to hold and optimize the collection of passes we are
|
||||||
// about to build...
|
// about to build.
|
||||||
//
|
//
|
||||||
PassManager Passes;
|
PassManager Passes;
|
||||||
|
|
||||||
// Add an appropriate TargetData instance for this module...
|
// Add an appropriate TargetLibraryInfo pass for the module's triple.
|
||||||
|
if (!M->getTargetTriple().empty())
|
||||||
|
Passes.add(new TargetLibraryInfo(Triple(M->getTargetTriple())));
|
||||||
|
|
||||||
|
// Add an appropriate TargetData instance for this module.
|
||||||
TargetData *TD = 0;
|
TargetData *TD = 0;
|
||||||
const std::string &ModuleDataLayout = M.get()->getDataLayout();
|
const std::string &ModuleDataLayout = M.get()->getDataLayout();
|
||||||
if (!ModuleDataLayout.empty())
|
if (!ModuleDataLayout.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user