summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* MemoryBuffer::getSTDIN may return a null pointer if an error occurs.Dan Gohman2010-05-271-1/+1
| | | | llvm-svn: 104856
* Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all ↵Daniel Dunbar2010-05-272-0/+6
| | | | | | instructions when using -integrated-as. llvm-svn: 104807
* AST: Add AlignMac68kAttr, not yet used.Daniel Dunbar2010-05-272-0/+4
| | | | llvm-svn: 104800
* AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.Daniel Dunbar2010-05-272-3/+3
| | | | llvm-svn: 104795
* Predefine the '__clang_analyzer__' macro when using '-analyze'.Ted Kremenek2010-05-261-0/+5
| | | | llvm-svn: 104742
* Only enable code patterns (e.g., try { statements } catch (...) {Douglas Gregor2010-05-252-2/+8
| | | | | | statements }) in the code-completion results if explicitly requested. llvm-svn: 104637
* Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not theDaniel Dunbar2010-05-252-0/+11
| | | | | | .s printer or .o writer. llvm-svn: 104623
* Refactoring of block-pointer type rewrite.Fariborz Jahanian2010-05-251-37/+25
| | | | llvm-svn: 104614
* Patch to rewrite block pointers as arguments toFariborz Jahanian2010-05-251-2/+57
| | | | | | methods. (Radar 7987817). llvm-svn: 104608
* when too many errors are emitted, and we produce:Chris Lattner2010-05-241-0/+2
| | | | | | | | fatal error: too many errors emitted, stopping now [-ferror-limit=] Tell the user that this is controlled with -ferror-limit=, like above. llvm-svn: 104528
* Fix a rewriting bug where a local static objective-cFariborz Jahanian2010-05-241-0/+6
| | | | | | pointer is copied into a block. Fixes radar 7924024. llvm-svn: 104526
* Fix an objective-c rewriter bug when pre-processed file's Fariborz Jahanian2010-05-241-3/+5
| | | | | | | class declaration's @end is not followed by a new-line. (radar 7946975). llvm-svn: 104512
* Propagate access specifiers to anonymous union members nested within classes.John McCall2010-05-211-1/+2
| | | | | | Fixes <rdar://problem/7987650>. llvm-svn: 104376
* Driver: Move some argument lookup utilities into driver::ArgList.Daniel Dunbar2010-05-201-72/+43
| | | | llvm-svn: 104237
* Added basic source locations to Elaborated and DependentName types.Abramo Bagnara2010-05-192-2/+8
| | | | llvm-svn: 104169
* Add clang support for IBOutletCollection.Ted Kremenek2010-05-192-0/+13
| | | | llvm-svn: 104135
* Add support for Microsoft's __thiscall, from Steven Watanabe!Douglas Gregor2010-05-181-0/+1
| | | | llvm-svn: 104026
* "The attached patch allows clang to find the headersDouglas Gregor2010-05-181-9/+33
| | | | | | | for Visual Studio 2010. It also adds a registry search for the Express edition,", from Steven Watanabe! llvm-svn: 104015
* Add option '-analyzer-max-loop', which specifies the maximum Zhongxing Xu2010-05-182-1/+2
| | | | | | number of times the analyzer will go through a loop. llvm-svn: 104007
* Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointedJohn McCall2010-05-171-7/+7
| | | | | | out. The remaining ones are okay. llvm-svn: 103973
* Moved clang-builtin include dir position to immediately precede C includes.mike-m2010-05-161-21/+22
| | | | | | This aligns with how gcc compiler does things. llvm-svn: 103912
* Emit a type record for TYPE_OBJC_OBJECT in the PCH file. I'm notJohn McCall2010-05-161-0/+1
| | | | | | entirely sure what this does, to be honest. llvm-svn: 103895
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-152-27/+22
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Implement semantic analysis and an AST representation for the namedDouglas Gregor2010-05-154-0/+5
| | | | | | | | | | | | return value optimization. Sema marks return statements with their NRVO candidates (which may or may not end up using the NRVO), then, at the end of a function body, computes and marks those variables that can be allocated into the return slot. I've checked this locally with some debugging statements (not committed), but there won't be any tests until CodeGen comes along. llvm-svn: 103865
* Recognize when the named return value optimization applies in aDouglas Gregor2010-05-152-0/+2
| | | | | | | | | | "return" statement and mark the corresponding CXXConstructExpr as elidable. Teach CodeGen that eliding a temporary is different from eliding an object construction. This is just a baby step toward NRVO. llvm-svn: 103849
* Revert r103770, "Added basic source locations to Elaborated and DependentNameDaniel Dunbar2010-05-142-4/+2
| | | | | | types.", it is breaking Clang bootstrap. llvm-svn: 103775
* Added basic source locations to Elaborated and DependentName types.Abramo Bagnara2010-05-142-2/+4
| | | | llvm-svn: 103770
* Rework when and how vtables are emitted, by tracking where vtables areDouglas Gregor2010-05-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key function definition). Previously, we were effectively tracking "potential definitions" rather than uses, so we were a bit too eager about emitting vtables for classes without key functions. The new scheme: - For every use of a vtable, Sema calls MarkVTableUsed() to indicate the use. For example, this occurs when calling a virtual member function of the class, defining a constructor of that class type, dynamic_cast'ing from that type to a derived class, casting to/through a virtual base class, etc. - For every definition of a vtable, Sema calls MarkVTableUsed() to indicate the definition. This happens at the end of the translation unit for classes whose key function has been defined (so we can delay computation of the key function; see PR6564), and will also occur with explicit template instantiation definitions. - For every vtable defined/used, we mark all of the virtual member functions of that vtable as defined/used, unless we know that the key function is in another translation unit. This instantiates virtual member functions when needed. - At the end of the translation unit, Sema tells CodeGen (via the ASTConsumer) which vtables must be defined (CodeGen will define them) and which may be used (for which CodeGen will define the vtables lazily). From a language perspective, both the old and the new schemes are permissible: we're allowed to instantiate virtual member functions whenever we want per the standard. However, all other C++ compilers were more lazy than we were, and our eagerness was both a performance issue (we instantiated too much) and a portability problem (we broke Boost test cases, which now pass). Notes: (1) There's a ton of churn in the tests, because the order in which vtables get emitted to IR has changed. I've tried to isolate some of the larger tests from these issues. (2) Some diagnostics related to implicitly-instantiated/implicitly-defined virtual member functions have moved to the point of first use/definition. It's better this way. (3) I could use a review of the places where we MarkVTableUsed, to see if I missed any place where the language effectively requires a vtable. Fixes PR7114 and PR6564. llvm-svn: 103718
* "this patch properly addresses escaping < and > which might appearChris Lattner2010-05-121-1/+2
| | | | | | | | | | | (e.g. for C++ operators) in the xml dump. I also re-enabled the unit test for ast-print-xml (or so I think) at least, make test didn't fail..." patch by Sebastien Binet! llvm-svn: 103671
* Merged Elaborated and QualifiedName types.Abramo Bagnara2010-05-114-29/+22
| | | | llvm-svn: 103517
* 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
OpenPOWER on IntegriCloud