Commit Graph

10 Commits

Author SHA1 Message Date
Alex Lorenz cb9db59aef [DeclPrinter] Honor TerseOutput for constructors
Patch by Nikolai Kosjar!

Differential Revision: https://reviews.llvm.org/D39957


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 01:28:25 +00:00
Alex Lorenz 506a43a28e [ASTPrinter] Print nested name specifiers for out-of-line functions
rdar://31501863


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299962 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 16:46:03 +00:00
Charles Li 186d5807d8 [Test] Make Lit tests C++11 compatible - nounwind noexcept
C++11 destructors are nothrow by default.

Differential Revision: https://reviews.llvm.org/D29859


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 17:56:30 +00:00
Serge Pavlov 8323711b07 Make output of -ast-print a valid C++ code.
Output generated by option -ast-print looks like C/C++ code, and it
really is for plain C. For C++ the produced output was not valid C++
code, but the differences were small. With this change the output
is fixed and can be compiled. Tests are changed so that output produced
by -ast-print is compiled again with the same flags and both outputs are
compared.

Option -ast-print is extensively used in clang tests but it itself
was tested poorly, existing tests only checked that compiler did not
crash. There are unit tests in file DeclPrinterTest.cpp, but they test
only terse output mode.

Differential Revision: https://reviews.llvm.org/D26452


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 08:49:37 +00:00
Benjamin Kramer c148531050 Pretty Printer: Print constexpr and ref qualifiers. Don't print return types on destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202181 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 18:49:49 +00:00
Manuel Klimek 36fab8d70e Do not add newline in empty blocks.
void f() {}
now gets formatted in one line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 13:24:24 +00:00
Dmitri Gribenko 27c2cb24d5 Comment to XML conversion: no, we don't want to print instantiations for the
<Declaration> tag


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 18:45:48 +00:00
Manuel Klimek de7685487c Fix parsing of variable declarations directly after a class / struct.
Previous indent:
class A {
}
a;
void f() {
};

With this patch:
class A {
} a;
void f() {
}
;

The patch introduces a production for classes and structs, and parses
the rest of the line to the semicolon after the class scope.
This allowed us to remove a long-standing wart in the parser that would
just much the semicolon after any block.
Due to this suboptimal formating some tests were broken.

Some unrelated formatting tests broke; those hit a bug in the ast
printing, and need to be fixed separately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 18:10:23 +00:00
Fariborz Jahanian d4ae6535a6 Fixes couple of friend declaration -ast-print bug
found by running -ast-print on all-std-headers.cpp
which caused it to go into infinite loop. Now
-ast-print prints all declarations found in 
all-std-headers.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170928 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-21 21:43:05 +00:00
Fariborz Jahanian 8920eb7a95 Testing C++ declarations embedded in
<declaration> tag of Comment XML and 
added support for friend declaration printing.
This is wip. // rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169346 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05 00:38:44 +00:00