[PATCH] D75364: [clang-format] Handle macros in function params and return value

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 04:50:36 PDT 2020


MyDeveloperDay added a comment.

Did you try putting 'ElfW and 'M' in the list of TypenameMacros?

  ---
  Language: Cpp
  BasedOnStyle: LLVM
  TypenameMacros: ['ElfW']
  PointerAlignment: Left



  const ElfW(Addr)* foo(ElfW(Addr)* addr);
  const M(Addr) * foo(M(Addr) * addr);



  $ clang-format macros.cpp
  const ElfW(Addr)* foo(ElfW(Addr)* addr);
  const M(Addr) * foo(M(Addr) * addr);

Simply extend the list to include the macros you need

  TypenameMacros: ['ElfW','M']



  $ clang-format macros.cpp
  const ElfW(Addr)* foo(ElfW(Addr)* addr);
  const M(Addr)* foo(M(Addr)* addr);

F11683170: image.png <https://reviews.llvm.org/F11683170>


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75364/new/

https://reviews.llvm.org/D75364





More information about the cfe-commits mailing list