[cfe-users] A question regarding formatting of function try-block

2018-09-24 Thread Jakob van Bethlehem via cfe-users
Dear all,

Recently we introduced clang-format into our company, for formatting
c++-code. After some fine-tuning of the settings, we're extremely happy
with it. Today I came across a bit of code that uses a function try-block -
not a very-often use feature of C++, but sometimes usefuly, however, I
don't really like what clang-format is doing, and I'm having trouble
figuring out how to tell clang-format what to do.

So, here is the header of the function that has the problem:

HlPropertiesParser::HlPropertiesParserError
HlPropertiesParser::readPropertiesDataFromFile(
const std::wstring& filename,
std::vector& hlPropertyRules,
std::wstring& errorMsg)
try
{
  /// code

Of course down below will be the closing brace of the function, and a
number of catch-clauses. When I now run clang-format on it, it will move
the 'try' after the closing bracket like so:

HlPropertiesParser::HlPropertiesParserError
HlPropertiesParser::readPropertiesDataFromFile(
const std::wstring& filename,
std::vector& hlPropertyRules,
std::wstring& errorMsg) try
{

It looks as if clang-format considers this like a const- or noexcept
specifier. However, I would really like to tell clang-format to put the
'try' on the next line, preferably even always at the start of the line. Is
there a style option that will let be achieve this?

Sincerely,
Jakob van Bethlehem
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] Default compiler flags

2018-09-24 Thread David Blaikie via cfe-users
Don't know of any quick way to do that in LLVM - I guess companies/folks
who do this go into the source code in Clang's driver and mess with it.

- Dave

On Mon, Sep 17, 2018 at 10:10 PM Alexander Biddulph via cfe-users <
cfe-users@lists.llvm.org> wrote:

> I am trying to compile clang/llvm to target a specific CPU architecture
> (Intel Broadwell for instance). The intention here is that every time this
> specific compiler is run it will only ever generate code for that specific
> CPU.
>
> To achieve this I would like to "bake-in" some command line arguments into
> the built compiler (things like -march), but still allow the user to
> provide extra command line arguments that may override the "baked-in"
> defaults.
>
> GCC provides a spec file to achieve this, but I can't find something
> equivalent for clang/llvm. Does such a thing exist for clang/llvm?
> ___
> cfe-users mailing list
> cfe-users@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users