summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* For the purposes of overload resolution, consider a conversion from anDouglas Gregor2011-04-151-1/+1
| | | | | | | | | Objective-C pointer to void* as a "conversion to void*". This allows us to prefer an Objective-C object pointer conversion to a superclass object pointer over an Objective-C object pointer conversion to cv-void*. Fixes PR9735. llvm-svn: 129603
* Forbid the use of C++ new/delete to allocate/free objects within anDouglas Gregor2011-04-151-2/+8
| | | | | | | | | | address space. I could see that this functionality would be useful, but not in its current form (where the address space is ignored): rather, we'd want to encode the address space into the parameter list passed to operator new/operator delete somehow, which would require a bunch more semantic analysis. llvm-svn: 129593
* Parse GNU-style attributes prior to the type-id/new-type-id in a C++Douglas Gregor2011-04-151-0/+4
| | | | | | "new" expression. This matches GCC's parser. Test is forthcoming. llvm-svn: 129592
* Fixes a crash when generating dependency file stuffFariborz Jahanian2011-04-151-1/+1
| | | | | | and output file is not writable. // rdar://9286457. llvm-svn: 129587
* Implement appropriate semantics for C++ casting and conversion whenDouglas Gregor2011-04-151-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | dealing with address-space- and GC-qualified pointers. Previously, these qualifiers were being treated just like cvr-qualifiers (in some cases) or were completely ignored, leading to uneven behavior. For example, const_cast would allow conversion between pointers to different address spaces. The new semantics are fairly simple: reinterpret_cast can be used to explicitly cast between pointers to different address spaces (including adding/removing addresss spaces), while static_cast/dynamic_cast/const_cast do not tolerate any changes in the address space. C-style casts can add/remove/change address spaces through the reinterpret_cast mechanism. Other non-CVR qualifiers (e.g., Objective-C GC qualifiers) work similarly. As part of this change, I tweaked the "casts away constness" diagnostic to use the term "casts away qualifiers". The term "constness" actually comes from the C++ standard, despite the fact that removing "volatile" also falls under that category. In Clang, we also have restrict, address spaces, ObjC GC attributes, etc., so the more general "qualifiers" is clearer. llvm-svn: 129583
* Allow shadowin of 'self' in objc methods inFariborz Jahanian2011-04-151-0/+10
| | | | | | | | cases where stand-alone ivar can be looked up in shadowed object. To fix gcc compatibility breakage. // rdar://9284603 llvm-svn: 129576
* Add __has_feature(cxx_range_for) check for C++11 range-based for loop.Richard Smith2011-04-151-0/+1
| | | | llvm-svn: 129573
* Add mm3dnow.h.Michael J. Spencer2011-04-152-0/+162
| | | | llvm-svn: 129572
* Add 3DNow! Intrinsics.Michael J. Spencer2011-04-151-0/+132
| | | | llvm-svn: 129570
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-1541-176/+394
| | | | llvm-svn: 129567
* Teach -ast-print how to print template template parameters.Richard Smith2011-04-151-3/+8
| | | | llvm-svn: 129565
* Fix mismatched delete.Benjamin Kramer2011-04-151-1/+1
| | | | llvm-svn: 129564
* Improve diagnostics on GNU attributes by warning about attributes that ↵Ted Kremenek2011-04-151-11/+12
| | | | | | should have no arguments or parameters. Patch by Michael Han! llvm-svn: 129560
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-1548-60/+60
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* C1X: implement static assertsPeter Collingbourne2011-04-154-6/+20
| | | | llvm-svn: 129555
* C1X: implement generic selectionsPeter Collingbourne2011-04-1523-52/+562
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* C1X: add a language standardPeter Collingbourne2011-04-154-1/+7
| | | | llvm-svn: 129553
* Do not expand the opencl pragma names. This is so you can also have a define ↵Tanya Lattner2011-04-141-1/+1
| | | | | | named the samed as the pragma and they do not interfere (ie. cl_khr_fp64). llvm-svn: 129549
* If the declaration of a C++ member function with an inline definitionDouglas Gregor2011-04-141-0/+8
| | | | | | | is so broken that Sema can't form a declaration for it, don't bother trying to parse the definition later. Fixes <rdar://problem/9221993>. llvm-svn: 129547
* When we transform a C++ exception declaration (e.g., for templateDouglas Gregor2011-04-142-8/+5
| | | | | | | | instantiation), be sure to add the transformed declaration into the current DeclContext. Also, remove the -Wuninitialized hack that works around this bug. Fixes <rdar://problem/9200676>. llvm-svn: 129544
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-1424-37/+929
| | | | | | draft standard (N3291). llvm-svn: 129541
* Detect when the string "<::" is found in code after a cast or template name ↵Richard Smith2011-04-141-0/+79
| | | | | | | | and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::". Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro. llvm-svn: 129540
* Match pointer of compatible vection types. Fariborz Jahanian2011-04-141-0/+8
| | | | | | // rdar://9208404 llvm-svn: 129536
* When determining the "usage" type of a declaration for the purposes of code Douglas Gregor2011-04-141-2/+33
| | | | | | | completion, look through block pointer and function pointer types to the result type of the block/function. Fixes <rdar://problem/9282583>. llvm-svn: 129535
* Implement ARM pcs attribute. Basically it's another way of calling ↵Anton Korobeynikov2011-04-149-9/+93
| | | | | | | | | | convention selection (AAPCS or AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86. In particular, all library functions should always be AAPCS regardless of floating point ABI used. llvm-svn: 129534
* Implement C++0x [lex.pptoken]p3's handling of <::.Richard Smith2011-04-141-0/+15
| | | | llvm-svn: 129525
* Parse an '@' in an Objective-C++ class member specification,Douglas Gregor2011-04-141-0/+11
| | | | | | | diagnosing it as an error rather than looping infinitely. Also, explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/9260136>. llvm-svn: 129521
* Chained PCH: Remember when additional specializations are added to a ↵Sebastian Redl2011-04-144-1/+27
| | | | | | function template from a previous PCH. Fixes the only crasher when using massive chains on Clang's Sema component. We still have some incomplete codegen there. llvm-svn: 129516
* Fix -H. It was pretty broken.Sebastian Redl2011-04-141-5/+9
| | | | llvm-svn: 129514
* The ASTReader created by -chain-include used the generated PCH buffers in ↵Sebastian Redl2011-04-141-2/+2
| | | | | | the wrong order. The effect was that all but the first chain-include files was ignored for subsequent compilations. llvm-svn: 129513
* Return the correct lastly populated block from ↵Ted Kremenek2011-04-141-2/+4
| | | | | | CFGBuilder::VisitUnaryExprOrTypeTraitExpr(). llvm-svn: 129499
* Replace a couple of divide-by-8s with divide-by-charwidths. No change inKen Dyck2011-04-141-2/+4
| | | | | | functionality intended. llvm-svn: 129496
* Re-fix r129481 and r129465 properly. Nulls fixits shouldn't be dropped inEli Friedman2011-04-141-4/+2
| | | | | | | DiagnosticBuilder::AddFixItHint: they will be dropped along with any other (possibly valid) fixits later. llvm-svn: 129495
* When creating an implicit member expression through a qualified-id, check ↵Argyrios Kyrtzidis2011-04-141-3/+15
| | | | | | | | | | that the class named by the nested-name-specifier is same or base of the class in which the member expression appears. It seems we also had an ill-formed test case, mon dieu! Fixes rdar://8576107. llvm-svn: 129493
* Replace a couple of divisions-by-'8' with divisions-by-charwidth. No changeKen Dyck2011-04-141-2/+2
| | | | | | in functionality intended. llvm-svn: 129491
* In C++, when initializing an array from a pascal string, it's OK if the arrayAnders Carlsson2011-04-141-0/+9
| | | | | | | is 1 element smaller than the string, because we can just strip off the last null character. This matches GCC. llvm-svn: 129490
* Add a flag to StringLiteral to keep track of whether the string is a pascal ↵Anders Carlsson2011-04-146-11/+17
| | | | | | string or not. llvm-svn: 129488
* Issue the 2nd fixit even if fix-it hint is supressed.Fariborz Jahanian2011-04-131-6/+5
| | | | | | // rdar://9091893 llvm-svn: 129481
* No fixit hint for builtin expressions which areFariborz Jahanian2011-04-131-6/+8
| | | | | | defined in a macro. // rdar://9091893 llvm-svn: 129465
* Removing the unaligned load tests from builtins-x86.c since they're ↵Bill Wendling2011-04-131-2/+0
| | | | | | generated by a regular 'load' now. llvm-svn: 129464
* From Vassil Vassilev: Give external source's last resort lookup a chance, ↵Axel Naumann2011-04-131-2/+2
| | | | | | even if an identifier could resolve to a builtin. llvm-svn: 129438
* Remove comment that snuck in there.Bill Wendling2011-04-131-1/+1
| | | | llvm-svn: 129434
* It looks like the FreeBSD buildbot needs this for the builtins-x86.c test.Bill Wendling2011-04-131-0/+2
| | | | llvm-svn: 129433
* Teach -Wuninitialized about C++'s typeid expression, including both theChandler Carruth2011-04-131-0/+12
| | | | | | | | | | | evaluated and unevaluated contexts. Add some testing of sizeof and typeid. Both of the typeid tests added here were triggering warnings previously. Now the one false positive is suppressed without suppressing the warning on actually buggy code. llvm-svn: 129431
* Collect the options applicable to the Rewriter methods into a ↵Argyrios Kyrtzidis2011-04-131-8/+10
| | | | | | RewriterOptions struct. llvm-svn: 129430
* Just use a native "load" instead of translating the builtin later. Clang canBill Wendling2011-04-133-4/+2
| | | | | | | | | take it! I wasn't able to get __builtin_ia32_loaddqu to transform into an unaligned load...I'll have to look into it further. llvm-svn: 129427
* Still not used to put the * next to the variable name.Francois Pichet2011-04-131-1/+1
| | | | llvm-svn: 129426
* In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to ↵Francois Pichet2011-04-131-1/+32
| | | | | | | | | | | | | | | | | | the type of one of the base classes then downgrade the missing typename error to a warning. Up to now this is the only case I found where MSVC doesn't require "typename" at class scope. Really strange! This fixes 1 error when parsing the MSVC 2008 header files. Example: template<class T> class A { public: typedef int TYPE; }; template<class T> class B : public A<T> { public: A<T>::TYPE a; // no typename required because A<T> is a base class. }; llvm-svn: 129425
* Use EmitCallOrInvoke in EmitBadTypeidCall and EmitBadCastCall.Anders Carlsson2011-04-131-16/+6
| | | | llvm-svn: 129424
* Convert the unaligned load builtins to the first-class versions.Bill Wendling2011-04-131-0/+13
| | | | llvm-svn: 129420
OpenPOWER on IntegriCloud