summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-10/+15
| | | | | | No (intended) functionality change. llvm-svn: 176726
* Improve LLDB's implicit cast-to-id to work with C++11 auto and any ↵Douglas Gregor2013-03-071-11/+25
| | | | | | Objective-C object type <rdar://problem/13338107>. llvm-svn: 176665
* When possible, move __block variables to the heap rather than copying them.Douglas Gregor2013-03-071-4/+4
| | | | | | Fixes <rdar://problem/13330126>. llvm-svn: 176663
* Add a hasExternalLinkage helper. No functionality change.Rafael Espindola2013-03-071-6/+6
| | | | llvm-svn: 176607
* PR15390: If a function returns a pointer to a function, that function typeRichard Smith2013-03-061-9/+5
| | | | | | | can't have default arguments even though it's a parameter-declaration-clause in a function declaration. llvm-svn: 176542
* Silence a number of static analyzer warnings with assertions and such.Jordan Rose2013-03-051-1/+1
| | | | | | No functionality change. llvm-svn: 176469
* Process #pragma weak only after we know the linkage of the function or variableRafael Espindola2013-03-021-0/+2
| | | | | | we are looking at. llvm-svn: 176414
* Fix assertion failure when a field is given an address space.Matt Arsenault2013-02-261-2/+7
| | | | llvm-svn: 176122
* Make sure pragmas don't attach visibility attributes to auto variables withRafael Espindola2013-02-221-6/+7
| | | | | | internal linkage. llvm-svn: 175903
* Fix MergeFunctionDecl implicit CC for static methods.Timur Iskhodzhanov2013-02-221-2/+3
| | | | | | Patch by Alexander Zinenko! llvm-svn: 175890
* Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out ofRichard Smith2013-02-221-23/+173
| | | | | | | | the normal attribute-merging path, because we can't merge alignment attributes without knowing the complete set of alignment attributes which apply to a particular declaration. llvm-svn: 175861
* [libclang] Fix a crash with invalid code, while skip function bodies is enabled.Argyrios Kyrtzidis2013-02-221-2/+2
| | | | llvm-svn: 175860
* Add a new 'type_visibility' attribute to allow users toJohn McCall2013-02-201-0/+3
| | | | | | | | | | | | | | control the visibility of a type for the purposes of RTTI and template argument restrictions independently of how visibility propagates to its non-type member declarations. Also fix r175326 to not ignore template argument visibility on a template explicit instantiation when a member has an explicit attribute but the instantiation does not. The type_visibility work is rdar://11880378 llvm-svn: 175587
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-23/+23
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* Make helper functions static.Benjamin Kramer2013-02-151-2/+2
| | | | llvm-svn: 175265
* merge hasCLanguageLinkage and isExternC. Keep the shorter name.Rafael Espindola2013-02-141-2/+2
| | | | | | | | | | I added hasCLanguageLinkage while fixing some language linkage bugs some time ago so that I wouldn't have to check all users of isExternC. It turned out to be a much longer detour than expected, but this patch finally merges the two again. The isExternC function now implements just the standard notion of having C language linkage. llvm-svn: 175119
* Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fixRafael Espindola2013-02-141-2/+18
| | | | | | | | | | | | | | | some cases where functions with no language linkage were being treated as having C language linkage. In particular, don't warn in extern "C" { static NonPod foo(); } Since getLanguageLinkage checks the language linkage, the linkage computation cannot use the language linkage. Break the loop by checking just the context in the linkage computation. llvm-svn: 175117
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+8
| | | | | | restrictions. llvm-svn: 174601
* For ModuleLoader::makeModuleVisible() also pass the source location where theArgyrios Kyrtzidis2013-02-011-1/+1
| | | | | | module import occurred. llvm-svn: 174191
* Add a new -Wundefined-inline warning for inline functions which are used but notNick Lewycky2013-02-011-5/+27
| | | | | | defined. Fixes PR14993! llvm-svn: 174158
* Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.Richard Smith2013-02-011-1/+14
| | | | | | Also support alignas(0), which C++11 and C11 require us to ignore. llvm-svn: 174157
* Remove elements from Sema.UndefinedInternals as functions are defined. AlsoNick Lewycky2013-01-311-0/+7
| | | | | | | filter the elements before emitting them into a PCH. No user-visible functionality change, except that PCH files may be smaller? llvm-svn: 174034
* Clarify the diagnostic for -Wnested-anon-types.Richard Smith2013-01-311-1/+2
| | | | llvm-svn: 174032
* Add OpenCL error that a kernel function must have void return type. Includes ↵Tanya Lattner2013-01-301-1/+8
| | | | | | a test case. llvm-svn: 173963
* Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith2013-01-301-0/+10
| | | | | | an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-301-3/+0
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* Move -Wstatic-float-init fixit into a note & don't recover as if constexprDavid Blaikie2013-01-291-9/+6
| | | | llvm-svn: 173841
* Don't fixit/recover from -Wstatic-float-init when it's not an error.David Blaikie2013-01-291-5/+9
| | | | | | | Fix to change r173414 that lead to Clang changing const to constexpr even under -Wno-static-float-init. llvm-svn: 173835
* Mark a struct definition in an objc container with the ↵Argyrios Kyrtzidis2013-01-291-1/+5
| | | | | | | | | | | TopLevelDeclInObjCContainer bit. Fixes accurately getting a cursor inside an objc container containing a struct definition, from a PCH/preamble file. rdar://12584613 llvm-svn: 173811
* Add a diagnostic for an OpenCL kernel with a pointer pointer argument.Joey Gouly2013-01-291-7/+16
| | | | | | Also refactor the surrounding code a little. llvm-svn: 173791
* PR15100: look through type sugar when determining whether we have one of theRichard Smith2013-01-291-1/+2
| | | | | | forms of 'main' which we accept as an extension. llvm-svn: 173758
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-281-4/+38
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* Undo my re-wording of the "ARC forbids Objective-C objects in ..."Douglas Gregor2013-01-281-1/+1
| | | | | | error. Jordan is right. llvm-svn: 173713
* Forbid the use of objects in unions in Objective-C++ ARC. FixesDouglas Gregor2013-01-281-32/+30
| | | | | | <rdar://problem/13098104>. llvm-svn: 173708
* Add a -pedantic warning: an anonymous union within an anonymous union is notRichard Smith2013-01-281-0/+6
| | | | | | | permitted in standard C++, despite being silently accepted by many (all?) major C++ implementations. llvm-svn: 173643
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-251-0/+4
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-251-2/+24
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-8/+14
| | | | | | | | | | | | | and split it out of -Wgnu into its own warning flag. * In C++11, this is now a hard error (GCC has no extension here in C++11 mode). The error can be disabled with -Wno-static-float-init, and has a fixit to add 'constexpr'. * In C++98, this is still an ExtWarn, but is now controlled by -Wstatic-float-init as well as -Wgnu. llvm-svn: 173414
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-241-1/+3
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-241-6/+13
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-231-0/+11
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Add a fixit for _Noreturn main,Dmitri Gribenko2013-01-211-2/+8
| | | | | | add tests for fixits removing static and inline from main llvm-svn: 173024
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-6/+44
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Reapply r172878 with test case.Ted Kremenek2013-01-191-3/+9
| | | | llvm-svn: 172888
* Whitespace.NAKAMURA Takumi2013-01-191-1/+1
| | | | llvm-svn: 172881
* Revert r172878, "Reword warning about using a *static* variable within its ↵NAKAMURA Takumi2013-01-191-10/+4
| | | | | | | | own initialization." It broke, at least, linux, msvc and mingw bots. llvm-svn: 172879
* Reword warning about using a *static* variable within its own initialization.Ted Kremenek2013-01-191-4/+10
| | | | | | | | | The warning is still under -Wuninitialized (although technically this is defined behavior), but under a subgroup -Wstatic-self-init. This addresses PR 10265. llvm-svn: 172878
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-2/+9
| | | | llvm-svn: 172761
* Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are ↵Joey Gouly2013-01-171-0/+6
| | | | | | not supported. llvm-svn: 172732
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-0/+12
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
OpenPOWER on IntegriCloud