summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Implement ARM pcs attribute. Basically it's another way of calling ↵Anton Korobeynikov2011-04-144-0/+22
| | | | | | | | | | 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
* Chained PCH: Remember when additional specializations are added to a ↵Sebastian Redl2011-04-142-1/+8
| | | | | | 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
* Add a flag to StringLiteral to keep track of whether the string is a pascal ↵Anders Carlsson2011-04-141-1/+2
| | | | | | string or not. llvm-svn: 129488
* Fix a regression where the initializer implementsFariborz Jahanian2011-04-121-4/+4
| | | | | | | the initialized's protocol and yet clang warns. objective-c issue, // rdar://9267196 llvm-svn: 129363
* After some discussion with Doug, we decided that it made a lot more senseJohn McCall2011-04-123-8/+7
| | | | | | | | | for __unknown_anytype resolution to destructively modify the AST. So that's what it does now, which significantly simplifies some of the implementation. Normal member calls work pretty cleanly now, and I added support for propagating unknown-ness through &. llvm-svn: 129331
* More __unknown_anytype work.John McCall2011-04-112-0/+4
| | | | llvm-svn: 129269
* Remove CK_DynamicToNull.Anders Carlsson2011-04-112-4/+0
| | | | llvm-svn: 129265
* Add CXXDynamicCastExpr::isAlwaysNull() which will be replacing the cast kind ↵Anders Carlsson2011-04-111-0/+30
| | | | | | I added. llvm-svn: 129263
* As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind whichAnders Carlsson2011-04-102-0/+4
| | | | | | | | | | | | | | | | | | represents a dynamic cast where we know that the result is always null. For example: struct A { virtual ~A(); }; struct B final : A { }; struct C { }; bool f(B* b) { return dynamic_cast<C*>(b); } llvm-svn: 129256
* PR8369: make __attribute((regparm(0))) work correctly. Original patch byEli Friedman2011-04-092-1/+4
| | | | | | pageexec@freemail.hu, tweaks by me. llvm-svn: 129206
* Warn for any kind of initialization if initializer does notFariborz Jahanian2011-04-081-4/+41
| | | | | | | implement lhs's protocols. // rdar://9091389. llvm-svn: 129142
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-078-0/+12
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* Fix lookup for class messages sent to qualified-classFariborz Jahanian2011-04-061-0/+10
| | | | | | | types such that protocols are seached first. Fixes // rdar://9224670 llvm-svn: 129016
* Do not use IR marker for LLVM intrinsicsPeter Collingbourne2011-04-061-2/+3
| | | | llvm-svn: 129001
* Apply a bug-fix patch from Marcin Kowalczyk to the source locations forChandler Carruth2011-04-021-1/+3
| | | | | | | | | | | a couple of operator overloads which form interesting expressions in the AST. I added test cases for both bugs with the c-index-test's token annotation feature. Also, thanks to John McCall for confirming that this is the correct solution. llvm-svn: 128768
* Begin reworking static analyzer support for C++ method calls. The current ↵Ted Kremenek2011-03-301-2/+13
| | | | | | | | | | | logic was divorced from how we process ordinary function calls, had a tremendous about of redundancy, and relied strictly on inlining behavior (which was incomplete) to provide semantics instead of falling back to the conservative analysis we use for C functions. This is a significant step into making C++ analyzer support more useful. llvm-svn: 128557
* More coherent diagnostic attempting to assign to a member of a const object ↵Fariborz Jahanian2011-03-261-1/+5
| | | | | | | | returned from an objective-c message: // rdar://9005189 llvm-svn: 128348
* Make helpers static.Benjamin Kramer2011-03-261-1/+1
| | | | llvm-svn: 128339
* On Mac OS X, the presence of an 'availability' attribute for thatDouglas Gregor2011-03-261-54/+70
| | | | | | | | | platform implies default visibility. To achieve these, refactor our lookup of explicit visibility so that we search for both an explicit VisibilityAttr and an appropriate AvailabilityAttr, favoring the VisibilityAttr if it is present. llvm-svn: 128336
* Extend the new 'availability' attribute with support for anDouglas Gregor2011-03-261-0/+11
| | | | | | | 'unavailable' argument, which specifies that the declaration to which the attribute appertains is unavailable on that platform. llvm-svn: 128329
* Silly mistake in integer constant folding cleanup.Eli Friedman2011-03-251-1/+1
| | | | llvm-svn: 128297
* Fix some clang warnings.Anders Carlsson2011-03-251-3/+3
| | | | llvm-svn: 128272
* Switch constant evaluation of float casts over to cast kinds.Eli Friedman2011-03-251-3/+13
| | | | llvm-svn: 128251
* Cleanup integral and vector constant evaluation of casts to use cast kinds.Eli Friedman2011-03-251-87/+105
| | | | llvm-svn: 128250
* remove a dead variable.Chris Lattner2011-03-231-1/+0
| | | | llvm-svn: 128141
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-233-2/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Fix a test case and teach ClearLinkageCache() to clear the linkage ofJohn McCall2011-03-221-1/+3
| | | | | | | a function template decl's pattern, which was suddenly exposed by my last patch. llvm-svn: 128073
* File-scope static functions need to be mangled with 'L' so thatJohn McCall2011-03-221-4/+6
| | | | | | | | they don't collide with file-scope extern functions from the same translation unit. This is basically a matter of applying the same logic to FunctionDecls as we were previously applying to VarDecls. llvm-svn: 128072
* Simplify crash recovery cleanup registration.Ted Kremenek2011-03-221-3/+2
| | | | llvm-svn: 128057
* Recover memory from RecordLayoutBuilders during crashes.Ted Kremenek2011-03-191-1/+6
| | | | llvm-svn: 127931
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-5/+24
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Fixed inconsistency when adding TemplateParameterListsInfo.Abramo Bagnara2011-03-181-10/+46
| | | | llvm-svn: 127876
* Use ElaboratedType also for C.Abramo Bagnara2011-03-161-1/+6
| | | | llvm-svn: 127755
* Support for printing/dumping static assertsPeter Collingbourne2011-03-162-0/+15
| | | | llvm-svn: 127744
* Added missing methods to get Designators source range.Abramo Bagnara2011-03-161-0/+8
| | | | llvm-svn: 127735
* Block return type of the initialized must beFariborz Jahanian2011-03-141-6/+8
| | | | | | | | be more speciaclized than that of the initializer, when matching protocol qualifier list. // rdar:// 9118343. llvm-svn: 127585
* Instead of storing an ASTContext* in FunctionProtoTypes with computed ↵Sebastian Redl2011-03-134-26/+22
| | | | | | noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall. llvm-svn: 127568
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-128-42/+113
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-118-46/+104
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* Overload IntExprEvaluator::Success() with a function that takes a CharUnitsKen Dyck2011-03-111-5/+10
| | | | | | parameter to tidy up the places where the expression is a size. llvm-svn: 127454
* Instead of round up sizes to '8', round them up to the alignment of the charKen Dyck2011-03-101-2/+4
| | | | | | type. llvm-svn: 127391
* Round up the non-virtual size to the next char instead of rounding down.Ken Dyck2011-03-101-2/+3
| | | | llvm-svn: 127390
* Fixed InnerLocStart.Abramo Bagnara2011-03-095-61/+69
| | | | llvm-svn: 127330
* Teach libclang's token-annotation logic about context-sensitiveDouglas Gregor2011-03-082-7/+12
| | | | | | keywords for Objective-C+ and C++0x. llvm-svn: 127253
* Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source ↵Abramo Bagnara2011-03-084-15/+101
| | | | | | range for declarations using postfix types. llvm-svn: 127251
* Fixed NamespaceDecl source range.Abramo Bagnara2011-03-082-4/+6
| | | | llvm-svn: 127242
* Fixed bitfields source range.Abramo Bagnara2011-03-081-0/+5
| | | | llvm-svn: 127237
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-086-58/+77
| | | | llvm-svn: 127225
* The conditional needs to be pushed before the branch. Make the test lessJohn McCall2011-03-071-0/+4
| | | | | | trivial to check this. Adjust for style. llvm-svn: 127151
* Completed source ranges fixes for all classes inheriting from TypeDecl.Abramo Bagnara2011-03-061-4/+4
| | | | llvm-svn: 127120
OpenPOWER on IntegriCloud