summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-7/+7
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* commentRafael Espindola2013-01-121-0/+3
| | | | llvm-svn: 172317
* barRafael Espindola2013-01-121-0/+3
| | | | llvm-svn: 172316
* Disable caching of visibility.Rafael Espindola2013-01-121-40/+43
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* Handle static functions being redeclared in function scope.Rafael Espindola2013-01-091-0/+4
| | | | | | Fixes pr14861. llvm-svn: 171978
* Assert that redeclarations have the same linkage.Rafael Espindola2013-01-051-3/+28
| | | | | | | It is somewhat hard to test linkage, so I decided to try to add an assert. This already found some interesting cases where there were different. llvm-svn: 171585
* Style fix: We don't use lowercase-and-underscored template parameter names.Rafael Espindola2013-01-041-3/+3
| | | | | | Thanks for dgregor for noticing it. llvm-svn: 171532
* Fix typo. Thanks to dgregor for noticing it.Rafael Espindola2013-01-041-1/+1
| | | | llvm-svn: 171521
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-4/+4
| | | | llvm-svn: 171367
* Don't get confused if a extern "C" builtin function is redeclared withoutRafael Espindola2012-12-301-1/+1
| | | | | | the extern "C". llvm-svn: 171260
* Reject overloading of two static extern C functions.Rafael Espindola2012-12-281-0/+30
| | | | | | | | This patch moves hasCLanguageLinkage to be VarDecl and FunctionDecl methods so that they can be used from SemaOverload.cpp and then fixes the logic in Sema::IsOverload. llvm-svn: 171193
* Add 171048 back but invalidate the cache of all redeclarations when settingRafael Espindola2012-12-251-28/+37
| | | | | | | | | | | | | | | | | | the body of a functions. The problem was that hasBody looks at the entire chain and causes problems to -fvisibility-inlines-hidden if the cache was not invalidated. Original message: Cache visibility of decls. This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171053
* Revert r171048, "Cache visibility of decls."NAKAMURA Takumi2012-12-251-35/+28
| | | | | | It broke stage2. llvm-svn: 171050
* Cache visibility of decls.Rafael Espindola2012-12-251-28/+35
| | | | | | | | | | | This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171048
* Merge storage classes even when contexts don't match.Rafael Espindola2012-12-181-2/+6
| | | | | | | | This fixes the storage class of extern decls that are merged with file level statics. The patch also fixes the linkage computation so that they are considered internal. llvm-svn: 170406
* Fix isThisDeclarationADefinition for extern following tentative.Rafael Espindola2012-12-171-1/+1
| | | | | | | | An extern declaration following a tentative definition should not itself be considered a tentative definition. Fixes pr14614. llvm-svn: 170377
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-081-7/+0
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-011-3/+12
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* Now that the underlying problem has been fixed, add r168411 back.Rafael Espindola2012-11-291-6/+4
| | | | | | | | Original commit message: Remove redundant code. llvm-svn: 168900
* Revert r168411 for now.Rafael Espindola2012-11-271-4/+6
| | | | llvm-svn: 168667
* Remove redundant code.Rafael Espindola2012-11-211-6/+4
| | | | llvm-svn: 168411
* Remove redundant code.Rafael Espindola2012-11-211-24/+3
| | | | llvm-svn: 168410
* Provide the correct mangling and linkage for certain unnamed nested classes.David Blaikie2012-11-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects the mangling and linkage of classes (& their member functions) in cases like this: struct foo { struct { void func() { ... } } x; }; we were accidentally giving this nested unnamed struct 'no' linkage where it should've had the linkage of the outer class. The mangling was incorrecty too, mangling as TU-wide unnamed type mangling of $_X rather than class-scoped mangling of UtX_. This also fixes -Wunused-member-function which would incorrectly diagnose 'func' as unused due to it having no linkage & thus appearing to be TU-local when in fact it might be correctly used in another TU. Similar mangling should be applied to function local classes in similar cases but I've deferred that for a subsequent patch. Review/discussion by Richard Smith, John McCall, & especially Eli Friedman. llvm-svn: 167906
* Remove calls to getMostRecentDecl. The case they were added for in r117526 areRafael Espindola2012-11-121-4/+2
| | | | | | now covered by attribute merging. llvm-svn: 167714
* In Sema::MergeVarDecl we handle merging of storage classes and visibilityRafael Espindola2012-11-121-25/+6
| | | | | | | | | | | | | | attributes. In cases where the merged declaration is fully equivalent to the two original ones, some of the code was getLVForDecl was duplicated. Cases that are still handled in getLVForDecl are things like __private_extern__ int N; int N; For which we cannot produce a single merged decl with all the information. llvm-svn: 167703
* Fix indentation.Eli Friedman2012-10-261-2/+2
| | | | llvm-svn: 166830
* DR1511: A const volatile global does not implicitly get internal linkage like aRichard Smith2012-10-191-5/+5
| | | | | | const non-volatile global does. llvm-svn: 166269
* Make -mms-bitfields behave consistently.Eli Friedman2012-10-121-1/+8
| | | | | | Patch by Jeremiah Zanin. llvm-svn: 165849
* Handle gnu_inline in c++ in a gcc compatible way. Original patch by TobiasRafael Espindola2012-10-111-1/+1
| | | | | | Grosser. llvm-svn: 165720
* In VarDecl::getSourceRange() make sure to check that the source locationArgyrios Kyrtzidis2012-10-081-2/+5
| | | | | | | | | | of the initializer is valid before using it. Fixes rdar://12455002&12449015 where local variables of objc objects in ARC mode were not annotated because of the ImplicitValueInitExpr initializer having invalid source range, resulting in the SourceRange of the VarDecl having invalid end location. llvm-svn: 165456
* Fix the AST representation for non-type template arguments to encodeEli Friedman2012-09-261-6/+6
| | | | | | | | | | | | enough information so we can mangle them correctly in cases involving dependent parameter types. (This specifically impacts cases involving null pointers and cases involving parameters of reference type.) Fix the mangler to use this information instead of trying to scavenge it out of the parameter declaration. <rdar://problem/12296776>. llvm-svn: 164656
* [PCH] When loading fields from external storage make sure to alsoArgyrios Kyrtzidis2012-09-101-2/+7
| | | | | | | | | | | load in the IndirectField declarations as well. Field designators in initializer lists depend on traversing the fields decl chain to find the indirect fields. Fixes rdar://12239321 llvm-svn: 163552
* Switch a couple getAs uses to castAs.Eli Friedman2012-08-301-2/+2
| | | | llvm-svn: 162948
* Consider the visibility of template template arguments. GCC doesn't, but it alsoRafael Espindola2012-07-311-0/+4
| | | | | | fails to consider the linkage, which we were already considering. llvm-svn: 161070
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160622
* Move option test earlier in the function.Rafael Espindola2012-07-131-3/+2
| | | | llvm-svn: 160202
* Use -fvisibility-inlines-hidden in inline functions too. This matches gccRafael Espindola2012-07-131-29/+42
| | | | | | behavior since gcc pr30066. Thanks to Benjamin Kramer for pointing it out. llvm-svn: 160174
* Fix a bug in my previous commit. The problem is not that we were not using theRafael Espindola2012-07-131-4/+2
| | | | | | | canonical decl for the template, but that we were not merging attributes for templates at all! llvm-svn: 160157
* Use the canonical template decl when trying to find if it has a visibilityRafael Espindola2012-07-121-2/+4
| | | | | | attribute. llvm-svn: 160139
* Reintroduced FieldDecl public methods setBitWidth and removeBitWidth.Abramo Bagnara2012-07-021-0/+6
| | | | llvm-svn: 159579
* We were computing the visibility and linkage of template parameters, butRafael Espindola2012-06-111-4/+4
| | | | | | | | | only using the linkage. Use and test both, documenting that considering the visibility and linkage of template parameters is a difference from gcc. llvm-svn: 158309
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-101-5/+4
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* PR13051: If a constructor is explicitly defaulted, it isn't marked as beingRichard Smith2012-06-081-0/+7
| | | | | | | | | | | | constexpr until we get to the end of the class definition. When that happens, be sure to remember that the class actually does have a constexpr constructor. This is a stopgap solution, which still doesn't cover the case of a class with multiple copy constructors (only some of which are constexpr). We should be performing constructor lookup when implicitly defining a constructor in order to determine whether all constructors it invokes are constexpr. llvm-svn: 158228
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-2/+2
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Don't ignore linkage when ignoring visibility in the instantiation of aRafael Espindola2012-05-251-4/+12
| | | | | | method template. llvm-svn: 157486
* Don't ignore linkage when ignoring visibility in the instantiation of aRafael Espindola2012-05-251-8/+12
| | | | | | function template. llvm-svn: 157480
* Consider the linkage for member class templates even when we have to ignoreRafael Espindola2012-05-251-6/+14
| | | | | | the visibility. llvm-svn: 157475
* When ignoring visibility in an instantiation, still consider the linkage.Rafael Espindola2012-05-251-10/+16
| | | | | | | Similar fixes for function and member template to follow as I write the testcases. llvm-svn: 157470
* Whitespace fixes.Rafael Espindola2012-05-251-5/+4
| | | | llvm-svn: 157469
OpenPOWER on IntegriCloud