Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
50745bf0
Commit
50745bf0
authored
15 years ago
by
Daniel Dunbar
Browse files
Options
Downloads
Patches
Plain Diff
Provide slightly more refined error message when trying to lookup a target, and
none are registered. llvm-svn: 76181
parent
c960b3e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/lib/Support/TargetRegistry.cpp
+18
-1
18 additions, 1 deletion
llvm/lib/Support/TargetRegistry.cpp
with
18 additions
and
1 deletion
llvm/lib/Support/TargetRegistry.cpp
+
18
−
1
View file @
50745bf0
...
...
@@ -21,6 +21,11 @@ TargetRegistry::iterator TargetRegistry::begin() {
const
Target
*
TargetRegistry
::
getClosestStaticTargetForTriple
(
const
std
::
string
&
TT
,
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
;
unsigned
BestQuality
=
0
;
for
(
iterator
it
=
begin
(),
ie
=
end
();
it
!=
ie
;
++
it
)
{
...
...
@@ -35,7 +40,7 @@ TargetRegistry::getClosestStaticTargetForTriple(const std::string &TT,
}
if
(
!
Best
)
{
Error
=
"No available targets are compatible with this
modu
le"
;
Error
=
"No available targets are compatible with this
trip
le"
;
return
0
;
}
...
...
@@ -53,6 +58,12 @@ TargetRegistry::getClosestStaticTargetForTriple(const std::string &TT,
const
Target
*
TargetRegistry
::
getClosestStaticTargetForModule
(
const
Module
&
M
,
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
;
unsigned
BestQuality
=
0
;
for
(
iterator
it
=
begin
(),
ie
=
end
();
it
!=
ie
;
++
it
)
{
...
...
@@ -84,6 +95,12 @@ TargetRegistry::getClosestStaticTargetForModule(const Module &M,
const
Target
*
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
;
unsigned
BestQuality
=
0
;
for
(
iterator
it
=
begin
(),
ie
=
end
();
it
!=
ie
;
++
it
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment