[PATCH] D26671: Replace APFloatBase static fltSemantics data members with getter functions

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 12:22:35 PST 2016


zturner added a comment.

I don't know anything about the code in question, but from a purely design perspective, it looks like `fltSemantics` is only forward declared in the header, and as such no external client can ever use a `fltSemantics` for anything meaningful anyway.  So it looks like it's intended to be an opaque data structure only useful within the confines of `APFloat.cpp`.

If this is the case, why don't we remove the forward declarations entirely, and write something like: `typedef void* FLT_SEMANTICS`, get rid of all the getters and convert them back into data members, and have the data members declared as actual declared in `APFloat.h` as being of type `FLT_SEMANTICS` (feel free to choose a different name).

Returning pointers across DLL boundaries is fine, and this way you don 't even need to export anything.


https://reviews.llvm.org/D26671





More information about the llvm-commits mailing list