mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Provide slightly more refined error message when trying to lookup a target, and
none are registered. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76181 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -21,6 +21,11 @@ TargetRegistry::iterator TargetRegistry::begin() {
|
|||||||
const Target *
|
const Target *
|
||||||
TargetRegistry::getClosestStaticTargetForTriple(const std::string &TT,
|
TargetRegistry::getClosestStaticTargetForTriple(const std::string &TT,
|
||||||
std::string &Error) {
|
std::string &Error) {
|
||||||
|
// Provide special warning when no targets are initialized.
|
||||||
|
if (begin() == end()) {
|
||||||
|
Error = "Unable to find target for this triple (no targets are registered)";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
const Target *Best = 0, *EquallyBest = 0;
|
const Target *Best = 0, *EquallyBest = 0;
|
||||||
unsigned BestQuality = 0;
|
unsigned BestQuality = 0;
|
||||||
for (iterator it = begin(), ie = end(); it != ie; ++it) {
|
for (iterator it = begin(), ie = end(); it != ie; ++it) {
|
||||||
@ -35,7 +40,7 @@ TargetRegistry::getClosestStaticTargetForTriple(const std::string &TT,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Best) {
|
if (!Best) {
|
||||||
Error = "No available targets are compatible with this module";
|
Error = "No available targets are compatible with this triple";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,6 +58,12 @@ TargetRegistry::getClosestStaticTargetForTriple(const std::string &TT,
|
|||||||
const Target *
|
const Target *
|
||||||
TargetRegistry::getClosestStaticTargetForModule(const Module &M,
|
TargetRegistry::getClosestStaticTargetForModule(const Module &M,
|
||||||
std::string &Error) {
|
std::string &Error) {
|
||||||
|
// Provide special warning when no targets are initialized.
|
||||||
|
if (begin() == end()) {
|
||||||
|
Error = "Unable to find target for this module (no targets are registered)";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const Target *Best = 0, *EquallyBest = 0;
|
const Target *Best = 0, *EquallyBest = 0;
|
||||||
unsigned BestQuality = 0;
|
unsigned BestQuality = 0;
|
||||||
for (iterator it = begin(), ie = end(); it != ie; ++it) {
|
for (iterator it = begin(), ie = end(); it != ie; ++it) {
|
||||||
@ -84,6 +95,12 @@ TargetRegistry::getClosestStaticTargetForModule(const Module &M,
|
|||||||
|
|
||||||
const Target *
|
const Target *
|
||||||
TargetRegistry::getClosestTargetForJIT(std::string &Error) {
|
TargetRegistry::getClosestTargetForJIT(std::string &Error) {
|
||||||
|
// Provide special warning when no targets are initialized.
|
||||||
|
if (begin() == end()) {
|
||||||
|
Error = "No JIT is available for this host (no targets are registered)";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const Target *Best = 0, *EquallyBest = 0;
|
const Target *Best = 0, *EquallyBest = 0;
|
||||||
unsigned BestQuality = 0;
|
unsigned BestQuality = 0;
|
||||||
for (iterator it = begin(), ie = end(); it != ie; ++it) {
|
for (iterator it = begin(), ie = end(); it != ie; ++it) {
|
||||||
|
Reference in New Issue
Block a user