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

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 09:00:26 PST 2016


mehdi_amini added a comment.

I don't have anything against this patch as is, but I don't know about the MSVC issue so I won't be able to help here.

In https://reviews.llvm.org/D26671#613437, @zturner wrote:

> I see.  My mild preference would be to remove as many C++isms as possible from exported interfaces.  So, in descending order of preference, this would be:
>
> 1. Make it return a `void*` instead of a `fltSemantics&`
> 2. Make these global free functions marked extern "C"


If you want a C-like API, you should extend the LLVM C API or write wrappers around the C++ API, I don't believe there is a wide agreement to "remove C++isms" from LLVM C++ APIs themselves (it is possible I misunderstood what you're suggesting here).



================
Comment at: llvm/include/llvm/ADT/APFloat.h:143
+  static const fltSemantics &PPCDoubleDouble();
+  static const fltSemantics &x87DoubleExtended();
 
----------------
Functions name in LLVM usually starts with a verb (getters start with  `get`).


https://reviews.llvm.org/D26671





More information about the llvm-commits mailing list