summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* fix _mm_shuffle_pd too, thanks to Joel Falcou for pointing this out.Chris Lattner2010-05-151-2/+3
| | | | llvm-svn: 103873
* When applying the named return value optimization, we still need toDouglas Gregor2010-05-151-2/+5
| | | | | | | destroy the variable along the exceptional edge; it's only during normal execution that we avoid destroying this variable. llvm-svn: 103872
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-1533-426/+415
| | | | | | | | | | | | | | | | | | | | | 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 a simple form of the C++ named return value optimization forDouglas Gregor2010-05-153-24/+44
| | | | | | | | | return statements. We perform NRVO only when all of the return statements in the function return the same variable. Fixes some link failures in Boost.Interprocess (which is relying on NRVO), and probably improves performance for some C++ applications. llvm-svn: 103867
* Implement semantic analysis and an AST representation for the namedDouglas Gregor2010-05-159-77/+153
| | | | | | | | | | | | 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
* add type casts to _mm_shuffle_ps so the front-end appliesChris Lattner2010-05-151-1/+2
| | | | | | | implicit conversions where needed. This fixes an error reported on cfe-dev, not really worth a testcase though. llvm-svn: 103864
* Recognize when the named return value optimization applies in aDouglas Gregor2010-05-158-74/+117
| | | | | | | | | | "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
* C++/ABI/x86_64: Member pointers should be classified as INTEGER.Daniel Dunbar2010-05-151-0/+5
| | | | llvm-svn: 103843
* C++/ABI/i386: Member function pointers should be passed by value.Daniel Dunbar2010-05-151-2/+3
| | | | llvm-svn: 103842
* Driver: Make -fverbose-asm the default for platforms where the integratedDaniel Dunbar2010-05-141-1/+8
| | | | | | assembler defaults to on. llvm-svn: 103825
* Patch to fix a crash on incomplete class declaration.Fariborz Jahanian2010-05-141-3/+7
| | | | | | Radar 7923673. llvm-svn: 103812
* Emit an lvalue dynamic_cast even if the result is not used. AnotherDouglas Gregor2010-05-141-1/+15
| | | | | | part (or possibly all) of PR7132. llvm-svn: 103810
* When a failed dynamic_cast<T&> (which is an lvalue) results in aDouglas Gregor2010-05-141-3/+11
| | | | | | | | throw, it should use invoke when needed. The fixes the Boost.Statechrt failures that motivated PR7132, but there are a few side issues to tackle as well. llvm-svn: 103803
* Remove an unused function.Anders Carlsson2010-05-142-8/+0
| | | | llvm-svn: 103793
* Move ContainsPointerToDataMember to CodeGenTypes. No functionality change.Anders Carlsson2010-05-143-25/+29
| | | | llvm-svn: 103792
* Implement new default property synthesis rules. Essentially, no longerFariborz Jahanian2010-05-143-9/+77
| | | | | | | | | user directive is needed to force a property implementation. It is decided based on those propeties which are declared in the class (or in its protocols) but not those which must be default implemented by one of its super classes. Implements radar 7923851. llvm-svn: 103787
* Improve error recovery in C/ObjC when the first argument of a functionChris Lattner2010-05-141-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declarator is incorrect. Not being a typename causes the parser to dive down into the K&R identifier list handling stuff, which is almost never the right thing to do. Before: r.c:3:17: error: expected ')' void bar(intptr y); ^ r.c:3:9: note: to match this '(' void bar(intptr y); ^ r.c:3:10: error: a parameter list without types is only allowed in a function definition void bar(intptr y); ^ After: r.c:3:10: error: unknown type name 'intptr'; did you mean 'intptr_t'? void bar(intptr y); ^~~~~~ intptr_t r.c:1:13: note: 'intptr_t' declared here typedef int intptr_t; ^ This fixes rdar://7980651 - poor recovery for bad type in the first arg of a C function llvm-svn: 103783
* Refactor ParseFunctionDeclaratorIdentifierList to have the firstChris Lattner2010-05-141-11/+18
| | | | | | | identifier in the identifier list consumed before it is called. No functionality change. llvm-svn: 103781
* Added Expr::EvaluateAsAnyLValue.Abramo Bagnara2010-05-141-5/+21
| | | | llvm-svn: 103780
* Fix thinko in yesterday's fix.Devang Patel2010-05-141-1/+1
| | | | | | Providing linkage name for function static variable confuses gdb, so don't do that. llvm-svn: 103779
* Revert r103770, "Added basic source locations to Elaborated and DependentNameDaniel Dunbar2010-05-145-106/+24
| | | | | | types.", it is breaking Clang bootstrap. llvm-svn: 103775
* Make sure that value-initialized pointers to data members are initialized ↵Anders Carlsson2010-05-141-1/+1
| | | | | | correctly. llvm-svn: 103771
* Added basic source locations to Elaborated and DependentName types.Abramo Bagnara2010-05-145-24/+106
| | | | llvm-svn: 103770
* Namespaces can only be defined at global or namespace scope. Fixes PR6596.Douglas Gregor2010-05-141-0/+8
| | | | llvm-svn: 103767
* Make sure to search semantic scopes and appropriate template-parameterDouglas Gregor2010-05-141-16/+48
| | | | | | | scopes during unqualified name lookup that has fallen out to namespace scope. Fixes PR7133. llvm-svn: 103766
* A vtable is used if the key function is defined... even if that keyDouglas Gregor2010-05-141-2/+1
| | | | | | | function's definition is an out-of-class definition marked "inline". Fixes an assertion in WebKit. llvm-svn: 103763
* C++/Darwin/x86: Teach IRgen it can pass reference types in registers.Daniel Dunbar2010-05-141-2/+2
| | | | llvm-svn: 103761
* Driver: Enable -integrated-as by default, at least for Darwin/x86 without ↵Daniel Dunbar2010-05-142-3/+15
| | | | | | | | -static. - How else will we figure out what is broken, eh? llvm-svn: 103759
* Fix context in class static variable's debugging information entry.Devang Patel2010-05-131-4/+13
| | | | | | This fixes bunch of failures in gdb testsuite. llvm-svn: 103745
* Disable the available_externally optimization for inline virtualDouglas Gregor2010-05-131-11/+0
| | | | | | | | | | | | methods for which the key function is guaranteed to be in another translation unit. Unfortunately, this guarantee isn't the case when dealing with shared libraries that fail to export these virtual method definitions. I'm reopening PR6747 so we can consider this again at a later point in time. llvm-svn: 103741
* Objective-C++ Sema. Fix a bug in instantiation of receivers.Fariborz Jahanian2010-05-131-1/+6
| | | | | | Completes radar 7963410. llvm-svn: 103719
* Rework when and how vtables are emitted, by tracking where vtables areDouglas Gregor2010-05-1316-219/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Don't add a null successor to a CFGBlock when the contents of an ↵Ted Kremenek2010-05-131-2/+1
| | | | | | | | @synchronized statement is empty. Fixes <rdar://problem/7979430>. llvm-svn: 103717
* Teach the AKA calculation to look at sugar on the pointee type for pointers andChandler Carruth2010-05-131-64/+69
| | | | | | | | references. This is a WIP as we should handle function pointers, etc. Reshuffle the code to do this to facilitate recursing in this manner, and to check for the type already being printed first rather than last. llvm-svn: 103712
* Rebuild builtin_id * as an ObjCObjectPointerType, where builtin_id is theJohn McCall2010-05-131-5/+13
| | | | | | magic type that 'id' is a pointer to. llvm-svn: 103708
* Relax an assertion. Various cases could lead to non-symbol values.Zhongxing Xu2010-05-131-1/+4
| | | | llvm-svn: 103707
* When performing template argument deduction, match Objective C pointersJohn McCall2010-05-131-3/+9
| | | | | | against pointer patterns. llvm-svn: 103706
* Delete a dead function at sabre's request.Chandler Carruth2010-05-131-11/+0
| | | | llvm-svn: 103705
* Update the types for warning option subgroup arrays to 'short', we have moreChandler Carruth2010-05-131-4/+4
| | | | | | | than 127 groups so this was already failing given -fsigned-char. A subsequent to commit to TableGen will generate shorts for the arrays themselves. llvm-svn: 103703
* add a couple of key functions for classes without them.Chris Lattner2010-05-132-1/+5
| | | | llvm-svn: 103688
* If given location is invalid then use current location.Devang Patel2010-05-122-107/+58
| | | | | | | | | This fixes recent regressions reported by gdb testsuite. Tighter verification of debug info generated by FE found these regressions. Refactor code to extract line number and column number from SourceLocation. llvm-svn: 103678
* Objective-C++ Sema. Support for conversion of a C++Fariborz Jahanian2010-05-123-0/+34
| | | | | | | class object used as a receiver to an objective-c pointer via a converwsion function. wip. llvm-svn: 103672
* "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
* improve comments.Chris Lattner2010-05-121-3/+3
| | | | llvm-svn: 103670
* Driver/Darwin/i386: Don't allow compiling C++ with -fapple-kext, we don't ↵Daniel Dunbar2010-05-121-1/+11
| | | | | | support the necessary ABI yet. llvm-svn: 103632
* Simplify.Daniel Dunbar2010-05-121-3/+3
| | | | llvm-svn: 103631
* Objective-C++ Sema - Allow static_cast of one objc pointer toFariborz Jahanian2010-05-121-1/+5
| | | | | | another. llvm-svn: 103630
* Whenever we instantiate a function definition or class, enter a newDouglas Gregor2010-05-122-0/+4
| | | | | | | potentially-evaluated expression context, to ensure that used declarations get properly marked. Fixes PR7123. llvm-svn: 103624
* When we emit an error during the implicit definition of a specialDouglas Gregor2010-05-122-5/+41
| | | | | | | | member function (default constructor, copy constructor, copy assignment operator, destructor), emit a note showing where that implicit definition was required. llvm-svn: 103619
* Improve commentary on the indirect-goto jump scope checker and extractJohn McCall2010-05-121-69/+76
| | | | | | a convenience routine to find the innermost common ancestor of two scopes. llvm-svn: 103565
OpenPOWER on IntegriCloud