[cfe-dev] Clang Format API

Marcus Johnson via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 1 03:36:54 PDT 2018


I'm trying to extend Clang Format to align the types in a function.

for example:

uint64_t A = 0ULL;

uint8_t B  = 0ULL;

B needs 2 spaces after the type for the variable B to be in the same column
as A.

and I'm not sure where to begin with Clang's API.

Here are my questions:

1: Where does Clang store each variables type.

2: What does clang do for typedef'd types? for both custom types (like a
struct in C), and for common types that have been defined as another
underlying type, like uint64_t (generally) being typedef'd as unsigned long
long?

Cuz I need the user visible type name, not the underlying type's type.

3: where is the pointer alignment stored? especially for the
DerivePointerAlignment option in Clang Format?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180801/1c21a8be/attachment.html>


More information about the cfe-dev mailing list