mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
provide an option to override the target triple in a module from the command
line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a637c32e38
commit
f33b8663bd
@ -48,6 +48,8 @@ static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
|
||||
static cl::opt<bool> Fast("fast",
|
||||
cl::desc("Generate code quickly, potentially sacrificing code quality"));
|
||||
|
||||
static cl::opt<std::string>
|
||||
TargetTriple("triple", cl::desc("Override target triple for module"));
|
||||
|
||||
static cl::opt<const TargetMachineRegistry::Entry*, false, TargetNameParser>
|
||||
MArch("march", cl::desc("Architecture to generate code for:"));
|
||||
@ -116,6 +118,10 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
Module &mod = *M.get();
|
||||
|
||||
// If we are supposed to override the target triple, do so now.
|
||||
if (!TargetTriple.empty())
|
||||
mod.setTargetTriple(TargetTriple);
|
||||
|
||||
// Allocate target machine. First, check whether the user has
|
||||
// explicitly specified an architecture to compile for.
|
||||
TargetMachine* (*TargetMachineAllocator)(const Module&,
|
||||
|
Loading…
Reference in New Issue
Block a user