summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* When we're performing tentative parsing to determine whether theDouglas Gregor2010-07-151-15/+8
| | | | | | | | | | | | | | | | parser is looking at a declaration or an expression, use a '=' to conclude that we are parsing a declaration. This is wrong. However, our previous approach of finding a comma after the '=' is also wrong, because the ',' could be part of a template-argument-list. So, for now we're going to use the same wrong heuristic as GCC and Visual C++, because less real-world code is likely to be broken this way. I've opened PR7655 to keep track of our wrongness; note also the XFAIL'd test. Fixes <rdar://problem/8193163>. llvm-svn: 108459
* Reinstate the scalar-cast-to-const-reference improvements, this timeDouglas Gregor2010-07-151-12/+43
| | | | | | | | | with the proper spelling of "non-class prvalue". Silly me, I think class rvalues were xvalues rather than prvalues! Hah hah hah. llvm-svn: 108443
* Make the "unused result" warning a warning about run-time behavior, soDouglas Gregor2010-07-151-1/+1
| | | | | | that we don't warn when there isn't going to be any computation anyway. llvm-svn: 108442
* Revert r108431 and r108433 (the cast-to-const-reference fixes), whichDouglas Gregor2010-07-151-42/+12
| | | | | | broke nightlytest. llvm-svn: 108439
* Revert 108220 and subsequent patch. Devang Patel2010-07-151-12/+0
| | | | | | This is not required (I am not 100% sure why) but method.exp from gdb testsuite flagged regression due to this patch. llvm-svn: 108434
* Spell isPRValue() properly.Douglas Gregor2010-07-151-2/+1
| | | | llvm-svn: 108433
* Teach CodeGenFunction::EmitCastLValue() to handle casts to an lvalueDouglas Gregor2010-07-151-12/+43
| | | | | | | | that involve binding a reference to a pure rvalue temporary (e.g., not a class temporary), by creating a new temporary and copying the result there. Fixes PR6024. llvm-svn: 108431
* CK_BitCast is not an lvalue bitcast any longerDouglas Gregor2010-07-151-1/+0
| | | | llvm-svn: 108428
* Driver/Darwin: Resolve deployment target defaulting to be more predictable;Daniel Dunbar2010-07-151-13/+4
| | | | | | assume we are targetting OS X unless an explicit option is given. llvm-svn: 108426
* CodeGen: Tweak ABI handling for Minix, patch by Kees van Reeuwijk!Daniel Dunbar2010-07-151-1/+0
| | | | llvm-svn: 108423
* restrict the && -> & warning to cover a case daniel noted.Chris Lattner2010-07-151-0/+4
| | | | | | | Don't warn about "logically bool" expressions on the RHS, even if they fold to a constant. llvm-svn: 108388
* Add a callback interface that allows interested parties to get notified ↵Sebastian Redl2010-07-144-34/+50
| | | | | | whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP llvm-svn: 108383
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-146-32/+48
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug llvm-svn: 108379
* There is another implementation of PCHReaderListener around. Update it to ↵Sebastian Redl2010-07-141-3/+5
| | | | | | the new interface. llvm-svn: 108377
* When determining whether an overload set with explicit templateDouglas Gregor2010-07-141-1/+2
| | | | | | | arguments only resolves to a single specialization, make sure to look through using declarations. Fixes PR7641. llvm-svn: 108376
* Pass StringRefs by value.Benjamin Kramer2010-07-144-8/+8
| | | | llvm-svn: 108375
* When there are extra or missing template parameter lists in a templateDouglas Gregor2010-07-143-9/+37
| | | | | | | | | | definition, we're likely going to end up breaking the invariants of the template system, e.g., that the depths of template parameter lists match up with the nesting template of the template. So, make sure we mark such ill-formed declarations as invalid or don't even build them at all. llvm-svn: 108372
* Add lvalue-bitcast support for complex numbers.Douglas Gregor2010-07-141-5/+16
| | | | llvm-svn: 108363
* Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.Sebastian Redl2010-07-141-1/+3
| | | | llvm-svn: 108354
* Driver: When re'execing clang, use path to the main executable instead ofDaniel Dunbar2010-07-142-6/+9
| | | | | | | looking up Clang in the normal search paths (which may end up finding the wrong clang). llvm-svn: 108346
* Driver: Remove some unused arguments.Daniel Dunbar2010-07-142-54/+51
| | | | llvm-svn: 108345
* Don't error when doing default property synthesis Fariborz Jahanian2010-07-141-0/+4
| | | | | | and some are already synthesized by user declaration. llvm-svn: 108341
* Make PCHReader cope with PCH files containing more than one predefines buffer.Sebastian Redl2010-07-141-35/+116
| | | | llvm-svn: 108340
* Only filter out names reserved for the implementation (e.g., __blah orDouglas Gregor2010-07-141-2/+5
| | | | | | | _Foo) from code-completion results when they come from a system header. llvm-svn: 108338
* Consider obective-c pointer arguments as valid sentinel argsFariborz Jahanian2010-07-141-1/+1
| | | | | | as well. Fixes radar 7975788. llvm-svn: 108333
* Fix the mangling of template template arguments, which do not alwaysJohn McCall2010-07-141-3/+50
| | | | | | | | follow <name>; instead they follow <type>, which has <name> as a subset. Fixes PR7446. llvm-svn: 108326
* Remove a few mangling FIXMEs:John McCall2010-07-141-5/+0
| | | | | | | | - TSTs whose template is a template template parameter already work - we don't provide an imaginary type, so we can't mangle one - we don't need a generic FIXME for vendor type qualifiers llvm-svn: 108317
* Implement the standard mangling for array-subscript expressions, and implementJohn McCall2010-07-141-15/+180
| | | | | | | the current proposals from David Vandervoorde for new, delete, throw, typeid, imaginary literals, string literals, and null literals. llvm-svn: 108315
* Driver/Darwin: Pass -pie/-no_pie to the linker when -fpie/-fno-pie and friendsDaniel Dunbar2010-07-132-2/+28
| | | | | | are explicitly given. llvm-svn: 108297
* Work around an obnoxious GCC warning by changing semantics in a hopefully-John McCall2010-07-132-8/+15
| | | | | | harmless way. llvm-svn: 108295
* Introduce a new cast kind for an "lvalue bitcast", which handlesDouglas Gregor2010-07-137-3/+24
| | | | | | | | | | | | | | | | reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g., int i; reinterpret_cast<short&>(i); The IR generated for this is essentially the same as for *reinterpret_cast<short*>(&i). Fixes PR6437, PR7593, and PR7344. llvm-svn: 108294
* Switch the __cxa_rethrow cleanup to be lazy.John McCall2010-07-131-6/+12
| | | | llvm-svn: 108288
* Allow for the possibility that __cxa_end_catch might throw for a catch-all blockJohn McCall2010-07-133-20/+80
| | | | | | | or a catch of a record type by value or reference. Also convert this to a lazy cleanup. llvm-svn: 108287
* Check on property attributes which are declaredFariborz Jahanian2010-07-131-11/+15
| | | | | | in class extensions (radar 8171968). llvm-svn: 108283
* Switch the __cxa_free_exception cleanup to be lazy.John McCall2010-07-131-16/+32
| | | | llvm-svn: 108276
* Set DeclContext of ParamVarDecl only. No needFariborz Jahanian2010-07-132-5/+1
| | | | | | | to set that of VarDecl for block variables (they are already set). Per Doug's comment. llvm-svn: 108273
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-138-75/+449
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* More block instantiation stuff. Set variable/param DeclContextFariborz Jahanian2010-07-133-4/+7
| | | | | | to block context when first instantiating them. llvm-svn: 108266
* Add a warning to catch a bug recently caught by code review, like this:Chris Lattner2010-07-132-3/+17
| | | | | | | | | | | t2.c:2:12: warning: use of logical && with constant operand; switch to bitwise & or remove constant [-Wlogical-bitwise-confusion] return x && 4; ^ ~ wording improvement suggestions are welcome. llvm-svn: 108260
* 80 column issues.Chris Lattner2010-07-131-7/+9
| | | | llvm-svn: 108257
* Whenever we're creating an expression that is typically an rvalueDouglas Gregor2010-07-138-19/+28
| | | | | | | | | | | | | | | | (e.g., a call, cast, etc.), immediately adjust the expression's type to strip cv-qualifiers off of all non-class types (in C++) or all types (in C). This effectively extends my previous fix for PR7463, which was restricted to calls, to other kinds of expressions within similar characteristics. I've audited every use of getNonReferenceType() in the code base, switching to the newly-renamed getNonLValueExprType() where necessary. Big thanks to Eli for pointing out just how incomplete my original fix for PR7463 actually was. We've been handling cv-qualifiers on rvalues wrong for a very, very long time. Fixes PR7463. llvm-svn: 108253
* Silence Doug's favorite GCC warning.Chandler Carruth2010-07-131-1/+1
| | | | llvm-svn: 108247
* Add volatile qualifiers for "this".Devang Patel2010-07-131-1/+7
| | | | llvm-svn: 108245
* Downgrade the "when type is in parentheses, array cannot have dynamicDouglas Gregor2010-07-138-34/+33
| | | | | | | | | | | | size" error for code like new (int [size]) to a warning, add a Fix-It to remove the parentheses, and make this diagnostic work properly when it occurs in a template instantiation. <rdar://problem/8018245>. llvm-svn: 108242
* Modify the pragma handlers to accept and use StringRefs instead of ↵Argyrios Kyrtzidis2010-07-136-108/+88
| | | | | | | | | | | IdentifierInfos. When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded). We can avoid this if we just use StringRefs for the pragmas. As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified. llvm-svn: 108237
* Improve diagnostics for the "type qualifier on return type has noDouglas Gregor2010-07-131-7/+24
| | | | | | | | | | | | effect warning" by printing the qualifiers we saw and correctly pluralizing the message, e.g., test/SemaCXX/conditional-expr.cpp:295:3: warning: 'const volatile' type qualifiers on return type have no effect const volatile Enum g2() { ^~~~~ ~~~~~~~~ llvm-svn: 108236
* When computing the canonical profile of a DeclRefExpr or MemberExpr,Douglas Gregor2010-07-131-3/+6
| | | | | | | don't include the nested-name-specifier or template arguments: they were only relevant when resolving the declaration. Fixes PR7460. llvm-svn: 108235
* When forming a function call or message send expression, be sure toDouglas Gregor2010-07-1312-27/+71
| | | | | | | | | | | | | | | | | strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234
* Diagnose typedef of an operator name. Fixes PR7462Douglas Gregor2010-07-131-0/+6
| | | | llvm-svn: 108233
* Complain when an unnamed enumeration has no enumerations (inDouglas Gregor2010-07-131-0/+8
| | | | | | C++). Fixes PR7466. llvm-svn: 108231
OpenPOWER on IntegriCloud