[PATCH] Add a jumptable attribute and support for creating jump-instruction tables

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue May 20 19:20:26 PDT 2014


>> Also, as I was working on these fixes, I found a problem with GlobalAlias:
>> it doesn't support replaceUsesOfWithOnConstant, and it cannot target
>> declaration-only functions. So, I've added some special-case handling for
>> GlobalAlias statements that target jumptable functions. I've also added a
>> new test case for "alias".
>
>
> Rafael, could you take a look at how this interacts with global aliases?
>

So, parachuting down the middle of the code review. Apologies if I
misunderstand something.

Alias to declarations are not allowed because there is no way to
represent them in the object files. Once we get to assembly an alias
is just another name for a "position" in the file, not a linker
directive, so it can only point to something that exists in the file.

How are you hitting aliases to undefined? My understanding from
browsing the changes to LangRef is that any function with the
jumptable attribute gets replaced with a position in a table and that
position is always a definition, no?

When you say that replaceUsesOfWithOnConstant doesn't work with
aliases you mean that you cannot pass an alias as the From argument?
That should be just an oversight, I don't think there is any
fundamental reason why that would not work. What is the issues that
you are seeing?

Cheers,
Rafael



More information about the llvm-commits mailing list