[PATCH] D20541: [esan|cfrag] Create the cfrag variable for the runtime

Qin Zhao via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 15:32:14 PDT 2016

zhaoqin added a comment.

In http://reviews.llvm.org/D20541#438443, @aizatsky wrote:

> > Do you want me to have a general GV layout for different Tool?
> No, I don't think you need a general layout. But you can have a base struct with ToolType at least. This way you'll guarantee that ToolType would always be a first field => no confusion would happened.

Yes, I agree that would be better.  What I worried is how to implement so.
As you can see at line 213, the Struct Type is declared upfront and then we create the new globalvariable with that type and fill in the value at line 220.
I can think of two ways to do so:

1. general layout as I described before
2. creating a struct ToolHeader or something to put beginning of each tool specific struct. Then it still rely on each tool putting that header struct at beginning.


More information about the llvm-commits mailing list