Commit Graph

17 Commits

Author SHA1 Message Date
Richard Smith 46dd5bba44 Take PrintingPolicy::SuppressUnwrittenScope into account when printing the
qualified name of a NamedDecl. Patch by Volodymyr Sapsai!

llvm-svn: 209924
2014-05-30 22:16:51 +00:00
James Dennett 0492ef0e0b Fix a crash (assertion failure) in EvaluateAsRValue.
Summary:
Gracefully fail to evaluate a constant expression if its type is
unknown, rather than failing an assertion trying to access the type.

Reviewers: klimek

Reviewed By: klimek

CC: chandlerc, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3075

llvm-svn: 203950
2014-03-14 17:44:10 +00:00
Richard Smith 023d2ca451 Add a unittest for the ExternalASTSource.
llvm-svn: 203525
2014-03-11 01:18:47 +00:00
Richard Smith 664b32b814 Revert accidentally-committed file.
llvm-svn: 203318
2014-03-08 00:04:19 +00:00
Richard Smith 9bca298f6d Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'
blocks when building in C mode, and serialize and deserialize the attribute.

llvm-svn: 203317
2014-03-08 00:03:56 +00:00
NAKAMURA Takumi ac85179219 [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each CMakeLists.txt.
llvm-svn: 196916
2013-12-10 12:40:37 +00:00
David Blaikie 67fc79f9ea Revert "Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile""
This reverts commit b18b043a5a37f76803d89467e46bcac286c0ecae.

Reapply with fix for the configure+make build (missing include of
ASTContext.h).

llvm-svn: 186257
2013-07-13 19:23:35 +00:00
David Blaikie 3c0e97ca7a Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile"
This reverts commit r186253.

This is failing to link under Configure+Make on the buildbots for
reasons I don't immediately understand.

llvm-svn: 186255
2013-07-13 18:54:56 +00:00
David Blaikie 4cffb8ed5c PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile
Fix some uninstantiable code in ASTVector::insert. I've added a
cheap-and-dirty compile test for this, because I don't have the time to
figure out a nice way to get a real ASTContext to implement executable
tests - but we probably should have them for this ADT.

llvm-svn: 186253
2013-07-13 18:08:59 +00:00
Samuel Benzaquen f226e97dff Enhancements for the DynTypedNode
Added ASTNodeKind as a standalone way to represent node kinds and their hierarchy.
This change is to support ongoing work on D815.

Reviewers: klimek

CC: cfe-commits
llvm-svn: 184331
2013-06-19 18:45:24 +00:00
Manuel Klimek a732899cb4 Fix memory leak for APValues that do memory allocation.
This patch ensures that APValues are deallocated with the ASTContext by
registering a deallocation function for APValues to the ASTContext.

Original version of the patch by James Dennett.

llvm-svn: 183101
2013-06-03 13:51:33 +00:00
Manuel Klimek d4be4084b4 First step towards adding a parent map to the ASTContext.
This does not yet implement the LimitNode approach discussed.

The impact of this is an O(n) in the number of nodes in the AST
reduction of complexity for certain kinds of matchers (as otherwise the
parent map gets recreated for every new MatchFinder).

See FIXMEs in the comments for the direction of future work.

llvm-svn: 176251
2013-02-28 13:21:39 +00:00
Manuel Klimek e6de22d3dc Add unit tests for source locations of AST nodes.
Patch by Philip Craig.

llvm-svn: 167470
2012-11-06 17:31:40 +00:00
Dmitri Gribenko 24bef9a4e9 As a followup for r164303, add some tests for printing literals that test
printing directly rather than through a complicated machinery of ObjC rewriter.

llvm-svn: 164477
2012-09-23 20:29:07 +00:00
Dmitri Gribenko 309856ae9f DeclPrinter: add terse output mode and lots of tests
Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output
from DeclPrinter.  The motivation is to use DeclPrinter to print declarations
in user-friendly format, without overwhelming user with inner detail of the
declaration being printed.

Also add many tests for DeclPrinter.  There are quite a few things that we
print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests
check our output against incorrect output, so that we can fix/refactor/rewrite
the DeclPrinter later.

llvm-svn: 162245
2012-08-20 23:39:06 +00:00
Dmitri Gribenko e3942ef9a4 add AST unittests to CMake build system
llvm-svn: 160640
2012-07-23 20:11:34 +00:00
Dmitri Gribenko 5188c4b9cc Implement a lexer for structured comments.
llvm-svn: 159223
2012-06-26 20:39:18 +00:00