Граф коммитов

40 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 0130f3cc4c Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 21:01:01 +00:00
John McCall 58e4677a94 Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation.  This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 21:48:59 +00:00
Anders Carlsson f88df8652e Make Decl::dump const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 21:58:53 +00:00
John McCall 183700f494 Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely.  Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 23:43:11 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
John McCall d7eff68dbb Ensure that the tag decls of friend decls aren't added to the friending class's
decl list, and remove some workarounds that were due to this.  Thanks to Eli for
pointing this out and providing the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 00:55:30 +00:00
Anders Carlsson 35eda446cd Add a workaround for decls that come from friend decls pointing to undeclared classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 20:47:47 +00:00
Anders Carlsson 018e9fead4 In DeclPrinter, assert when asked to print AS_None.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 20:36:12 +00:00
Anders Carlsson 0d59292581 Add printing of access specifiers to DeclPrinter. The formatting is pretty bad but it works :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 22:39:52 +00:00
Anders Carlsson f53eaa59c4 Improve support for using decls in the decl printer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 19:16:39 +00:00
Benjamin Kramer 6cb7c1a43b Replace cerr with errs().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 12:08:50 +00:00
Ted Kremenek 6217b80b7a Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 21:53:49 +00:00
Mike Stump fd350b5b4a Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:33:40 +00:00
Fariborz Jahanian 50b8eea3f3 More work toward initialization of objects
in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 17:57:02 +00:00
Fariborz Jahanian 393612e6c7 Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:36:06 +00:00
Ted Kremenek 35366a67ba Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 17:50:17 +00:00
Ted Kremenek 5cad1f7446 Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 01:20:38 +00:00
Ted Kremenek 1a1a6e2bd4 Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 19:58:26 +00:00
Fariborz Jahanian a8ded8be82 Fixed a stinko which caused an ast-print test failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 23:39:31 +00:00
Fariborz Jahanian 7b6248766d #ifdef'ed out -ast-print of destructors which caused
a test failure, until figuring out what caused the failure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 23:22:45 +00:00
Fariborz Jahanian 560de45ccb Added ASTs to destructor decl AST for default destruction of object's
base/members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 22:34:08 +00:00
Fariborz Jahanian 29146add4c Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:41:35 +00:00
Fariborz Jahanian 939afd89bb Fixes a minor bug in pretty printing of ctor defs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 23:31:10 +00:00
Fariborz Jahanian 66192aded8 Added pretty-printing support for constructor definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:18:13 +00:00
Douglas Gregor 5068ab6699 Look through vector types when determining the base type of a type for declarator printing. Bug found via the PCH tester
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 23:58:14 +00:00
Argyrios Kyrtzidis 17945a0f64 De-ASTContext-ify DeclContext.
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 02:36:12 +00:00
Argyrios Kyrtzidis 6fb0aee4f9 Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.
Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 02:35:26 +00:00
Argyrios Kyrtzidis f1d60eaf3f Remove the ASTContext parameter from the printing related methods of Decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 02:35:04 +00:00
Anders Carlsson 6d845ae1ba Keep track of whether a type parameter is actually a type parameter pack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 22:23:22 +00:00
Anders Carlsson 0487f66528 Minor improvements to template parameter writing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 05:37:43 +00:00
Douglas Gregor f757ae7115 Add a little FIXME for C++ class printing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-31 07:13:39 +00:00
Douglas Gregor 59e6357035 AST printing for C++ base classes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 06:58:37 +00:00
Douglas Gregor 6c9c940531 Pretty printing and improved representation for namespace alias declarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72616 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 06:48:27 +00:00
Eli Friedman 3d4a7c9bf8 Add a hack to prevent us from printing out the __builtin_va_list
declaration in -ast-print mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 06:35:22 +00:00
Douglas Gregor 8419fa3af9 Printing for using directives, e.g.,
using namespace std::debug;

Extended UsingDirectiveDecl to store the nested-name-specifier that
precedes the nominated namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 06:31:56 +00:00
Douglas Gregor 6620a628b0 Never suppress specifiers when printing the parameters of a function
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 05:39:39 +00:00
Eli Friedman 48d14a2222 Add a Stmt::printPretty overload which takes an ASTContext; start
transitioning callers over to pass one in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 05:03:24 +00:00
Eli Friedman 42f42c0dd5 Expose an API to print a group of decls (like "int a,b;").
Make StmtPrinter use DeclPrinter to print all declarations.  Merge 
declarations in the limited case of an unnamed TagDecl followed by one 
or more declarations using that TagDecl directly.  Change
SuppressTypeSpecifiers to the more general SuppressSpecifiers, and 
use it to suppress stuff like "typedef" and "extern".  Replace 
OwnedTag with SuppressTag, since it's more convenient to print 
declarations from DeclPrinter at the moment.  
improvements to declaration printing.  Fix pretty-printing for K&R 
function definitions and __builtin_va_arg.

We're now to the point where the pretty-printing output for non-trivial 
programs can actually be piped back into clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 04:20:30 +00:00
Douglas Gregor 64f650062f Clean up printing for Objective-C, designated initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 00:56:08 +00:00
Douglas Gregor 4fe0c8e9c7 Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 00:08:05 +00:00