[PATCH] D11777: [Target/X86] Allow LowerVAARG to work on FreeBSD, too.

Charles Davis via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 17:43:27 PDT 2015


> On Aug 10, 2015, at 10:35 AM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
> 
> On Wed, Aug 05, 2015 at 08:56:22PM +0000, Charles Davis wrote:
>> This change enables the `va_arg` instruction to work on
>> FreeBSD/amd64, too. It's needed to prevent test failures after D1622
>> lands. Since FreeBSD/amd64 largely follows the System V ABI for x86-64
>> (like Linux/x86-64), I don't see any reason why this wouldn't work.
> 
> Makes me wonder if the OS check is not just the wrong approach. So what
> does it actually want to have here?
(Sorry for the belated response.)

Now that I think about it, I’m considering gutting this `assert(3)` altogether—or at least replacing it with a check that the function containing the instruction has a C calling convention. I think that’s what we really want here: the backend only knows how to lower `va_arg` for the standard System V ABI, and D1622 additionally teaches it how to lower it for Win64, too.

I’m going to update D1622 with my proposed change. If anybody objects (because e.g. it would break something), speak up now!

Chip



More information about the llvm-commits mailing list