Factor commonality in triple match routines into helper template for registering

classes, and migrate existing targets over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77126 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2009-07-26 05:03:33 +00:00
parent 8c2f1d7e44
commit 8977d087c6
14 changed files with 46 additions and 233 deletions

View File

@ -39,7 +39,7 @@ IncludeDirs("I", cl::desc("Directory of include files"),
cl::value_desc("directory"), cl::Prefix);
static cl::opt<std::string>
Triple("triple", cl::desc("Target triple to assemble for,"
TripleName("triple", cl::desc("Target triple to assemble for,"
"see -version for available targets"),
cl::init(LLVM_HOSTTRIPLE));
@ -147,12 +147,12 @@ static int AssembleInput(const char *ProgName) {
// Get the target specific parser.
std::string Error;
const Target *TheTarget =
TargetRegistry::lookupTarget(Triple,
TargetRegistry::lookupTarget(TripleName,
/*FallbackToHost=*/true,
/*RequireJIT=*/false,
Error);
if (TheTarget == 0) {
errs() << ProgName << ": error: unable to get target for '" << Triple
errs() << ProgName << ": error: unable to get target for '" << TripleName
<< "', see --version and --triple.\n";
return 1;
}