[PATCH] D24834: Convert option tables to use llvm::ArrayRefs

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 10:34:53 PDT 2016


zturner added a comment.

Previously the option tables were declared as class statics and defined below the class.  And only a pointer was returned, so the compiler didn't have to know about the size of the array at compile time.

In order for the compiler to know that the OptionDefinition[] is actually an OptionDefinition[7], or whatever (which is necessary in order to set the internal size member of the ArrayRef), the definition has to come before the class.

A side benefit is that this gives the arrays internal linkage, which should improve link times.  A static class member still has external linkage.


https://reviews.llvm.org/D24834





More information about the llvm-commits mailing list