This is an archive of the discontinued LLVM Phabricator instance.

If we don't recognise the target, explicitly specify the executable that can list targets.
ClosedPublic

Authored by Wilfred on Jan 9 2016, 10:45 AM.

Details

Summary

LLVMGetTargetFromTriple is part of the C API, but ultimately calls TargetRegistry::lookupTarget.

However, the error string from this function seems to assume that it's being used inside llc. As a result, callers of LLVMGetTargetFromTriple are forced to ignore the error string. This is unfortunate because the other values, e.g. "no targets are registered" is useful feedback.

I'm open to suggestions as to the best wording here.

(I've just used git blame to pick reviewers, do let me know if I've picked the wrong people.)

Diff Detail

Event Timeline

Wilfred updated this revision to Diff 44406.Jan 9 2016, 10:45 AM
Wilfred retitled this revision from to If we don't recognise the target, explicitly specify the executable that can list targets..
Wilfred updated this object.
Wilfred set the repository for this revision to rL LLVM.
Wilfred added a subscriber: llvm-commits.
Wilfred updated this object.Jan 9 2016, 10:48 AM
Wilfred added reviewers: dblaikie, rafael.
mehdi_amini added inline comments.
lib/Support/TargetRegistry.cpp
77

While I agree that it is a problem to refer to a command line option in the library, it totally does not make sense to refer to llc here. I'd rather remove the references to command line flags entirely.

Wilfred updated this revision to Diff 45135.Jan 17 2016, 3:48 PM
Wilfred removed rL LLVM as the repository for this revision.

Updated wording following feedback.

mehdi_amini accepted this revision.Jan 17 2016, 3:51 PM
mehdi_amini added a reviewer: mehdi_amini.

LGTM

This revision is now accepted and ready to land.Jan 17 2016, 3:51 PM
rafael accepted this revision.Jan 18 2016, 6:29 AM
rafael edited edge metadata.

LGTM

I don't have commit rights, would you mind committing this patch?