[llvm-commits] [PATCH] Re-introduce llvm::sys::getHostTriple() function.

Peter Collingbourne peter at pcc.me.uk
Fri Jan 4 13:13:28 PST 2013


On Fri, Jan 04, 2013 at 08:59:15PM +0100, Joerg Sonnenberger wrote:
> If I have a 32bit binary, if anything, JIT should
> default to 32bit code. That is not the same as the default triple when
> building a cross-compiler.

Completely agreed.  They are two different concepts.

> It is also not correct to query the system
> platform, since at least for NetBSD/amd64 running a i386 binary, it will
> say amd64.

Agreed here as well.

> As such, I don't see how introducing getHostTriple provides
> an improvement over using the default target.

The improvement is that having two functions exposes the two different
concepts, allowing each to be used when appropriate.

I think you are trying to argue that the host triple is not exactly
the same concept as "some triple that will work for JITing functions
to be called by the current process".  If we define the host triple
to mean whatever is reported by config.guess or similar tools, I would
agree (the getHostTriple function introduced by this patch attempts
to produce the latter).  Perhaps a different name should be chosen
for this function (getDefaultJITTriple?)  This would also clarify
the function's purpose.

Thanks,
-- 
Peter



More information about the llvm-commits mailing list