]> granicus.if.org Git - clang/commit
clang-format: Add support for SEH __try / __except / __finally blocks.
authorNico Weber <nicolasweber@gmx.de>
Wed, 4 Feb 2015 15:26:27 +0000 (15:26 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 4 Feb 2015 15:26:27 +0000 (15:26 +0000)
commitd52fa386bb1b5c37877ea38a06e361868988ce8b
treeb7e549daffcfd5634bd2858ec797a2cf655d9d0e
parent0add82c2f294855cb463499dc7ef43db26b71e77
clang-format: Add support for SEH __try / __except / __finally blocks.

This lets clang-format format

    __try {
    } __except(0) {
    }

and

    __try {
    } __finally {
    }

correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set,
so this turns this on.  This also enables a few other keywords, but it
shouldn't overly perturb regular clang-format operation.  __except is a
context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to
a few more places.

Fixes PR22321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228148 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/UnwrappedLineFormatter.cpp
lib/Format/UnwrappedLineFormatter.h
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTest.cpp