summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ↵Ted Kremenek2010-05-101-1/+1
| | | | | | ASTContext's allocator. Fixes <rdar://problem/7961605>. llvm-svn: 103421
* Improved -ast-print-xml for C++, from Sebastien Binet!Douglas Gregor2010-05-102-4/+72
| | | | llvm-svn: 103412
* pch'ify CXXNewExpr and CXXZeroInitValueExprChris Lattner2010-05-102-2/+85
| | | | llvm-svn: 103390
* pchify CXXTemporary, CXXBindTemporaryExpr, and Chris Lattner2010-05-104-3/+67
| | | | | | CXXExprWithTemporaries. llvm-svn: 103387
* pch'ify default argument definitions and uses.Chris Lattner2010-05-093-4/+34
| | | | llvm-svn: 103376
* pch'ify 'this' and 'throw'Chris Lattner2010-05-092-0/+36
| | | | llvm-svn: 103375
* pch'ify typeid.Chris Lattner2010-05-092-0/+33
| | | | llvm-svn: 103374
* pchify CXXMemberCallExpr correctly. Before it would serializeChris Lattner2010-05-092-0/+10
| | | | | | | and deserialize as a CallExpr which is close, but ends up deserializing with the wrong stmt class. llvm-svn: 103371
* When we encounter a non-dependent type during template instantiation,Douglas Gregor2010-05-071-0/+6
| | | | | | | mark any declarations we see inside of that type as "referenced". Fixes PR7079. llvm-svn: 103323
* Introduce a recursive AST visitor that makes it trivial to recursivelyDouglas Gregor2010-05-071-1/+4
| | | | | | | | walk an entire AST, including all of the types, declarations, statements, and expressions, and allowing one to easily override the behavior of the walk at any particular node kind. llvm-svn: 103308
* add PCH support for a bunch of C++ Decls, patch byChris Lattner2010-05-074-31/+550
| | | | | | Andrew Sutton! llvm-svn: 103301
* Add missing #includeDouglas Gregor2010-05-071-0/+1
| | | | llvm-svn: 103260
* Add a stub frontend action for BoostCon, for next week's workshop.Douglas Gregor2010-05-073-0/+33
| | | | llvm-svn: 103258
* Rework our handling of temporary objects within the conditions ofDouglas Gregor2010-05-061-1/+2
| | | | | | | | | | | | | | | | | | | if/switch/while/do/for statements. Previously, we would end up either: (1) Forgetting to destroy temporaries created in the condition (!), (2) Destroying the temporaries created in the condition *before* converting the condition to a boolean value (or, in the case of a switch statement, to an integral or enumeral value), or (3) In a for statement, destroying the condition's temporaries at the end of the increment expression (!). We now destroy temporaries in conditions at the right times. This required some tweaking of the Parse/Sema interaction, since the parser was building full expressions too early in many places. Fixes PR7067. llvm-svn: 103187
* Reverted part of r103177 (repositioning of clang-builtin include/)mike-m2010-05-061-18/+20
| | | | | | which breaks clang-i686-xp-msvc9 test-clang. llvm-svn: 103180
* Reposition clang-builtin include/ to immediately precede /usr/include/,mike-m2010-05-061-64/+78
| | | | | | | | | | matching gcc compiler. Fixes #include_next <...> shenanigans that lead to file-not-found failures with <cstddef> on libstdc++ 4.3.[012]. Updated C++ include header search paths for various Debian/Ubuntu and Fedora linux distros. llvm-svn: 103177
* Remember the number of positive and negative bits used by the enumerators ofJohn McCall2010-05-062-0/+4
| | | | | | | an enum in the enum decl itself. Use some spare bits from TagDecl for this purpose. llvm-svn: 103173
* Make -analyzer-inline-call not a separate analysis. Instead it's a boolean Zhongxing Xu2010-05-062-1/+2
| | | | | | | flag now, and can be used with other analyses. Only turned it on for C++ methods for now. llvm-svn: 103160
* This patch deals with Sema Part of Setter/Getter synthesisFariborz Jahanian2010-05-052-0/+2
| | | | | | | of properties which are of C++ objects. Code Gen to follow (Radar 7468090). llvm-svn: 103123
* Test commit.mike-m2010-05-051-1/+1
| | | | llvm-svn: 103090
* Unbreak CMake build.Douglas Gregor2010-05-051-1/+2
| | | | llvm-svn: 103077
* fit in 80 colsChris Lattner2010-05-051-3/+6
| | | | llvm-svn: 103075
* add a new -fdiagnostics-show-category=none/id/name option, giving controlChris Lattner2010-05-042-2/+25
| | | | | | | | | | | | over choice of: t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat] t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1] t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String] dox to come. llvm-svn: 103056
* When -fdiagnostics-print-source-range-info is specified,Chris Lattner2010-05-041-4/+29
| | | | | | | | | | | | | | | | | | | | | | | print the diagnostic category number in the [] at the end of the line. For example: $ cat t.c #include <stdio.h> void foo() { printf("%s", 4); } $ clang t.c -fsyntax-only -fdiagnostics-print-source-range-info t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1] printf("%s", 4); ~^ ~ 1 warning generated. Clients that want category information can now pick the number out of the output, rdar://7928231. More coming. llvm-svn: 103053
* Introduce a limit on the depth of the macro instantiation backtraceDouglas Gregor2010-05-042-23/+74
| | | | | | | | | | | | | | printed in a diagnostic, similar to the limit we already have on the depth of the template instantiation backtrace. The macro instantiation backtrace is limited to 10 "instantiated from:" diagnostics; when it's longer than that, we'll show the first half, then say how many were suppressed, then show the second half. The limit can be changed with -fmacro-instantiation-limit=N, and turned off with N=0. This eliminates a lot of note spew with libraries making use of the Boost.Preprocess library. llvm-svn: 103014
* Workaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since ↵Ted Kremenek2010-05-031-2/+10
| | | | | | | | | they don't go in the DeclContext for the translation unit. This is to workaround a fundamental issue in how ObjC decls (within an @implementation) are parsed before the ObjCContainerDecl is available. llvm-svn: 102944
* Diagnose unused exception parameters under a different warning groupDouglas Gregor2010-05-032-0/+4
| | | | | | | | (-Wunused-exception-parameter) than normal variables, since it's more common to name and then ignore an exception parameter. This warning is neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>. llvm-svn: 102931
* Bump default template instantiation depth to 1024, as required by C++0xDouglas Gregor2010-05-011-1/+1
| | | | llvm-svn: 102847
* Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when aTed Kremenek2010-04-301-5/+2
| | | | | | fatal error has occurred. llvm-svn: 102778
* Remove unused trait.Zhongxing Xu2010-04-301-9/+0
| | | | llvm-svn: 102690
* Refactor the AnalysisConsumer to analyze functions after the whole Zhongxing Xu2010-04-301-125/+63
| | | | | | | | | | | | | | | | | | | | | | | | | translation unit is parsed. This enables us to inline some calls when still analyzing one function at a time. Actions are classified into Function, CXXMethod, ObjCMethod, ObjCImplementation. This does not hurt performance much. The analysis time for sqlite3.c: before: real 17m52.440s user 17m49.460s sys 0m2.010s after: real 18m0.500s user 17m56.900s sys 0m2.330s DisplayProgress option is broken now. -inine-call action is removed. It will be reenabled in another form, perhaps as an indenpendant option. llvm-svn: 102689
* Add Clang version inspection macros. Fixes PR6681.Douglas Gregor2010-04-301-1/+15
| | | | llvm-svn: 102686
* Remove a FIXME that is unlikely to be fixed (streaming code generation).Daniel Dunbar2010-04-291-20/+16
| | | | llvm-svn: 102623
* Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,Daniel Dunbar2010-04-292-10/+1
| | | | | | instead of NDEBUG. llvm-svn: 102622
* Teach __builtin_offsetof to compute the offsets of members of baseDouglas Gregor2010-04-292-0/+10
| | | | | | | | classes, since we only warn (not error) on offsetof() for non-POD types. We store the base path within the OffsetOfExpr itself, then evaluate the offsets within the constant evaluator. llvm-svn: 102571
* Completely reimplement __builtin_offsetof, based on a patch by RobertoDouglas Gregor2010-04-283-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amadini. This change introduces a new expression node type, OffsetOfExpr, that describes __builtin_offsetof. Previously, __builtin_offsetof was implemented using a unary operator whose subexpression involved various synthesized array-subscript and member-reference expressions, which was ugly and made it very hard to instantiate as a template. OffsetOfExpr represents the AST more faithfully, with proper type source information and a more compact representation. OffsetOfExpr also has support for dependent __builtin_offsetof expressions; it can be value-dependent, but will never be type-dependent (like sizeof or alignof). This commit introduces template instantiation for __builtin_offsetof as well. There are two major caveats to this patch: 1) CodeGen cannot handle the case where __builtin_offsetof is not a constant expression, so it produces an error. So, to avoid regressing in C, we retain the old UnaryOperator-based __builtin_offsetof implementation in C while using the shiny new OffsetOfExpr implementation in C++. The old implementation can go away once we have proper CodeGen support for this case, which we expect won't cause much trouble in C++. 2) __builtin_offsetof doesn't work well with non-POD class types, particularly when the designated field is found within a base class. I will address this in a subsequent patch. Fixes PR5880 and a bunch of assertions when building Boost.Python tests. llvm-svn: 102542
* add regex support for -verify mode. You can now do things likeChris Lattner2010-04-281-144/+319
| | | | | | | | expected-error-re {{someregex}} Patch by mike-m! llvm-svn: 102516
* More of Sema to implement initialization ofFariborz Jahanian2010-04-282-0/+2
| | | | | | ivar of c++ object types. llvm-svn: 102500
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-271-1/+2
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* fix PR6936: don't generate line marker directives when preprocessingChris Lattner2010-04-261-3/+9
| | | | | | | | .S files. "# 123" is passed through as-is, not treated as a line marker in this mode. No testcase, because it would be nasty and isn't worth it. llvm-svn: 102391
* Introduce Type::isStructureOrClassType(), which does the obviousDouglas Gregor2010-04-261-1/+1
| | | | | | | | thing. Audit all uses of Type::isStructure(), changing those calls to isStructureOrClassType() as needed (which is alsmost everywhere). Fixes the remaining failure in Boost.Utility/Swap. llvm-svn: 102386
* Make the static type of the exception variable in an Objective-CDouglas Gregor2010-04-262-2/+2
| | | | | | | @catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
* Switch this to new API.Nick Lewycky2010-04-241-1/+1
| | | | llvm-svn: 102280
* Add BasePath arguments to all cast expr constructors.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102258
* NeXT: Clean up dispatch method policy selection.Daniel Dunbar2010-04-241-3/+23
| | | | | | | | | | - Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}. - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp. - No intended functionality change. llvm-svn: 102255
* CastExpr should not hold a pointer to the base path. More cleanup.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102249
* Update prototypes.Benjamin Kramer2010-04-241-3/+4
| | | | llvm-svn: 102241
* Recommit r102215, this time being more careful to only set the "principalJohn McCall2010-04-241-0/+5
| | | | | | | declaration" (i.e. the only which will actually be looked up) to have the non-member-operator bit. llvm-svn: 102231
* Teach clang -fixit to modify files in-place, or -fixit=suffix to create newNick Lewycky2010-04-243-137/+40
| | | | | | files with the additional suffix in the middle. llvm-svn: 102230
* Revert r102215. This causes clang crash while compiling a test case from gdb ↵Devang Patel2010-04-241-5/+0
| | | | | | testsuite. llvm-svn: 102224
OpenPOWER on IntegriCloud