summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Pass StringRefs by value.Benjamin Kramer2010-07-146-20/+20
| | | | llvm-svn: 108375
* When there are extra or missing template parameter lists in a templateDouglas Gregor2010-07-144-9/+96
| | | | | | | | | | 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-142-5/+65
| | | | llvm-svn: 108363
* Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.Sebastian Redl2010-07-143-11/+24
| | | | llvm-svn: 108354
* Driver: When re'execing clang, use path to the main executable instead ofDaniel Dunbar2010-07-143-6/+17
| | | | | | | 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-143-57/+53
| | | | llvm-svn: 108345
* Don't error when doing default property synthesis Fariborz Jahanian2010-07-142-0/+16
| | | | | | 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-145-49/+137
| | | | llvm-svn: 108340
* Only filter out names reserved for the implementation (e.g., __blah orDouglas Gregor2010-07-143-6/+15
| | | | | | | _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-142-1/+13
| | | | | | as well. Fixes radar 7975788. llvm-svn: 108333
* Fix the mangling of template template arguments, which do not alwaysJohn McCall2010-07-142-4/+62
| | | | | | | | follow <name>; instead they follow <type>, which has <name> as a subset. Fixes PR7446. llvm-svn: 108326
* Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.Chandler Carruth2010-07-1411-15/+29
| | | | | | | | | This flag and warning match GCC semantics. Also, move it to -Wextra as this is a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to the tests which no longer by default emit the warning. Added explicit test cases for both C and C++ behavior with the warning turned on. llvm-svn: 108325
* Add test case that was causing an infinite loop when reading PCH files. The ↵Douglas Gregor2010-07-141-0/+4
| | | | | | test works with ToT Clang already llvm-svn: 108318
* 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
* Fix typo in test programDouglas Gregor2010-07-141-1/+1
| | | | llvm-svn: 108298
* Driver/Darwin: Pass -pie/-no_pie to the linker when -fpie/-fno-pie and friendsDaniel Dunbar2010-07-135-2/+44
| | | | | | are explicitly given. llvm-svn: 108297
* Add missing testcases for lvalue bitcastsDouglas Gregor2010-07-131-0/+114
| | | | llvm-svn: 108296
* 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-138-3/+29
| | | | | | | | | | | | | | | | 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
* Add __builtin_snprintf.Nick Lewycky2010-07-131-0/+1
| | | | llvm-svn: 108290
* 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-134-24/+116
| | | | | | | 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-132-11/+21
| | | | | | in class extensions (radar 8171968). llvm-svn: 108283
* Switch the __cxa_free_exception cleanup to be lazy.John McCall2010-07-132-19/+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-1312-94/+469
| | | | | | | | | | | | | | | 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
* Add two small utility functions to PCHReader that the writer will use. WIP.Sebastian Redl2010-07-131-0/+10
| | | | llvm-svn: 108267
* More block instantiation stuff. Set variable/param DeclContextFariborz Jahanian2010-07-134-4/+33
| | | | | | 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-139-10/+35
| | | | | | | | | | | 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-1311-25/+60
| | | | | | | | | | | | | | | | (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-132-1/+27
| | | | llvm-svn: 108245
* Properly add to 32Douglas Gregor2010-07-131-1/+1
| | | | llvm-svn: 108243
* Downgrade the "when type is in parentheses, array cannot have dynamicDouglas Gregor2010-07-1312-47/+96
| | | | | | | | | | | | 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-138-121/+109
| | | | | | | | | | | 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-134-9/+31
| | | | | | | | | | | | 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-132-3/+18
| | | | | | | 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-1324-38/+143
| | | | | | | | | | | | | | | | | 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-133-0/+13
| | | | llvm-svn: 108233
* Check in this -Wconversion C++ test case that's been sitting on my machineJohn McCall2010-07-131-0/+45
| | | | | | for awhile. llvm-svn: 108232
* Complain when an unnamed enumeration has no enumerations (inDouglas Gregor2010-07-133-1/+13
| | | | | | C++). Fixes PR7466. llvm-svn: 108231
* Reinstate the optimization suppressing available_externally functionsDouglas Gregor2010-07-137-16/+37
| | | | | | | | at -O0. The only change from the previous patch is that we don't try to generate virtual method thunks for an available_externally function. llvm-svn: 108230
* const qualify debug info for "this" for const methods.Devang Patel2010-07-131-0/+7
| | | | llvm-svn: 108220
* Instantiate attributes when first building an instantiatedFariborz Jahanian2010-07-133-19/+3
| | | | | | VarDecl. llvm-svn: 108218
* Provide a special diagnostic for attempts to explicitly specializeDouglas Gregor2010-07-133-6/+31
| | | | | | | | class templates within class scope (which is ill-formed), and recover by dropping the explicit specialization entirely. Fixes the infinite loop in PR7622. llvm-svn: 108217
* Fix a documentation paste-o and eliminate a useless function parameter, both ↵Douglas Gregor2010-07-123-6/+4
| | | | | | found by Sebastian llvm-svn: 108214
* We should not be recursing over the shadow definitions in UsingDecl --Craig Silverstein2010-07-121-5/+0
| | | | | | they're not something the user typed (at least, not here). llvm-svn: 108212
* Produce an error on encountering a pointer or reference to a qualified ↵Sebastian Redl2010-07-123-0/+24
| | | | | | function type. Fixes PR7470. llvm-svn: 108209
OpenPOWER on IntegriCloud