summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Correct incoherent function versus function template partial ordering for ↵Richard Smith2014-05-171-24/+30
| | | | | | conversion operators (the comparison could claim that two conversion operators are both better than each other). Actually implement DR495, rather than passing its test by chance because the declarations happened to be in the "lucky" order. llvm-svn: 209054
* Tweak diagnostic wording for init list narrowingAlp Toker2014-05-172-3/+3
| | | | | | | | | The conventional form is '<action> to silence this warning'. Also call the diagnostic an 'issue' rather than a 'message' because the latter term is more widely used with reference to message expressions. llvm-svn: 209052
* If a declaration is loaded, and then a module import adds a redeclaration, thenRichard Smith2014-05-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046
* Push implicitly-declared allocation functions into the IdResolver. Otherwise,Richard Smith2014-05-161-3/+1
| | | | | | | declaration merging in modules is unable to find them and we get bogus errors and even crashes. llvm-svn: 208944
* Allow dllimport/dllexport on inline functions and adjust the linkage.Hans Wennborg2014-05-152-29/+6
| | | | | | | | This is a step towards handling these attributes on classes (PR11170). Differential Revision: http://reviews.llvm.org/D3772 llvm-svn: 208925
* Refactoring another for loop to use a range-based for loop instead. Also ↵Aaron Ballman2014-05-151-11/+4
| | | | | | cleaned up a bit of formatting. No functional changes intended. llvm-svn: 208918
* Refactoring some for loops to use range-based for loops instead. No ↵Aaron Ballman2014-05-151-84/+46
| | | | | | functional changes intended. llvm-svn: 208915
* C++11 - Use nullptr in lib/Sema/SemaOpenMP.cpp and some reformatting (no ↵Alexander Musman2014-05-151-40/+42
| | | | | | functional changes). llvm-svn: 208879
* PR19742: cv-qualifiers and ref-qualifiers aren't allowed on functions withinRichard Smith2014-05-141-64/+70
| | | | | | | pointer and reference types, even if those types are produced by template instantiation. llvm-svn: 208825
* When we generate a redeclaration for anJohn McCall2014-05-141-1/+9
| | | | | | | elaborated-type-specifier, place it in the correct context. llvm-svn: 208799
* [OPENMP] Fix warning in Release builds.Alexey Bataev2014-05-141-0/+9
| | | | llvm-svn: 208768
* Sema::FindAllocationFunctions(): Fix \param. [-Wdocumentation]NAKAMURA Takumi2014-05-141-1/+1
| | | | llvm-svn: 208758
* Create a redeclaration when an elaborated type specifierJohn McCall2014-05-141-3/+6
| | | | | | | | | resolves to an existing declaration if there are attributes present. This gives us something to apply the attributes to. llvm-svn: 208756
* PR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. ThisRichard Smith2014-05-132-48/+28
| | | | | | | | | caused us to perform copy-initialization for the parameters of an allocation function called by a new-expression multiple times, resulting in us rejecting allocations that passed non-copyable parameters (and much worse things in MSVC compat mode, where we potentially called this function multiple times). llvm-svn: 208724
* Refactor and fix a latent bug (found by inspection) where an external ASTRichard Smith2014-05-131-21/+18
| | | | | | | | | source that provides a declaration from a hidden module would not have the visibility of the produced definition checked. This might matter if an external source chose to import a new module to provide an extra definition, but is not observable with our current external sources. llvm-svn: 208659
* [OPENMP] Removed unnecessary enums from OpenMP constructsAlexey Bataev2014-05-121-13/+6
| | | | llvm-svn: 208516
* PR19713: Don't warn on unused static inline functions, even if the 'inline' wasRichard Smith2014-05-111-2/+3
| | | | | | implied by 'constexpr'. llvm-svn: 208511
* Parameter/argument terminology fixesAlp Toker2014-05-111-25/+25
| | | | llvm-svn: 208499
* Consolidate single void paramter checkingAlp Toker2014-05-114-19/+5
| | | | | | | | Also correct argument/parameter terminology. No change in functionality. llvm-svn: 208498
* Objective-C ARC. Add support for toll-free bridge Fariborz Jahanian2014-05-102-0/+21
| | | | | | | type ,and bridge attribute, checking with static_cast. // rdar://16756639 llvm-svn: 208474
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-106-15/+13
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* Don't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.David Blaikie2014-05-091-1/+2
| | | | | | | | | The base class is the culprit/risk here - a sealed/final derived class with virtual functions and a non-virtual dtor can't accidentally be polymorphically destroyed (if the base class's dtor is protected - which also suppresses this warning). llvm-svn: 208449
* Objective-C. Reduce false positive warnings with -Wselector by issuing warning Fariborz Jahanian2014-05-091-2/+3
| | | | | | | only when named selector is declared in TU and it is not declared in a system header. rdar://16600230 llvm-svn: 208443
* Permit duplicate explicit class instantiations if MSVCCompat is enabledWill Wilson2014-05-091-2/+6
| | | | llvm-svn: 208402
* Add support for partial jump scope checkingAlp Toker2014-05-093-14/+22
| | | | | | | | | | This lets us diagnose and perform more complete semantic analysis when faced with errors in the function body or declaration. By recovering here we provide more consistent diagnostics, particularly during interactive editing. llvm-svn: 208394
* Fix PR19169 [Crash on invalid attempting to specialize a template method as ↵Karthik Bhat2014-05-081-2/+11
| | | | | | | | | a template variable]. A template declaration of a template name can be null in case we have a dependent name or a set of function templates. Hence use dyn_cast_or_null instead of dyn_cast. Also improve the diagnostic emitted in this case. llvm-svn: 208313
* fmodules-search-all: Removed dead code and added some comments.John Thompson2014-05-071-6/+5
| | | | llvm-svn: 208259
* Add an Extension warning for applying unary * to an operand of type 'void*' inRichard Smith2014-05-071-4/+13
| | | | | | | C++. This seems like a pointless (and indeed harmful) restriction to me, so I've suggested removing it to -core and disabled this diagnostic by default. llvm-svn: 208254
* If an instantiation of a template is required to be a complete type, checkRichard Smith2014-05-073-11/+79
| | | | | | | whether the definition of the template is visible rather than checking whether the instantiated definition happens to be in an imported module. llvm-svn: 208150
* Try harder to ensure a strict weak ordering of overload candidates thatKaelyn Takata2014-05-071-6/+11
| | | | | | have arity mismatches. llvm-svn: 208146
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-063-20/+116
| | | | llvm-svn: 208077
* Fix crash when one overload candidate is a template instead of a function. ↵Nick Lewycky2014-05-061-0/+1
| | | | | | | | | | Patch by Kaelyn Takata. Testcase coming out of creduce will land in a separate commit shortly. Also, it appears that this callback is used even in a SFINAE context where the results are never displayed. llvm-svn: 208062
* [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP ↵Alexey Bataev2014-05-062-0/+61
| | | | | | clause 'proc_bind' llvm-svn: 208060
* Support field references to struct names and c++11 aliases from inline asm.Nico Weber2014-05-061-1/+3
| | | | | | This is in addition to the existing support for typedefs. llvm-svn: 208053
* StringRefize and take out an old FIXMEAlp Toker2014-05-051-3/+4
| | | | llvm-svn: 207962
* Make module self-import an errorBen Langmuir2014-05-051-0/+7
| | | | | | | | Ideally, importing Foo.a from Foo.b would "do the right thing", but until it does, this patch makes it an error rather than allow it to silently be ignored. llvm-svn: 207948
* Minor cleanups, no behavior change.Nico Weber2014-05-031-11/+9
| | | | | | | | | | * Fixes a "return" that was indented at the same level as the continuation from the previous line * Wrap several lines to 80 columns * Remove an if check that was always true * Move a variable declaration slightly closer to its use llvm-svn: 207922
* Wrap a few lines at 80 columns, change a confusing indent. No behavior change.Nico Weber2014-05-032-9/+9
| | | | llvm-svn: 207921
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-0321-108/+91
| | | | llvm-svn: 207896
* Revert "Sema: Implement DR244"David Majnemer2014-05-031-3/+3
| | | | | | | | This was accidentally committed. This reverts commit r207892. llvm-svn: 207893
* Sema: Implement DR244David Majnemer2014-05-031-3/+3
| | | | | | | | | Naming the destructor using a typedef-name for the class-name is well-formed. This fixes PR19620. llvm-svn: 207892
* Rewrite NRVO determination. Track NRVO candidates on the parser Scope and ↵Nick Lewycky2014-05-036-62/+109
| | | | | | | | apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal. Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith. llvm-svn: 207890
* Updated the attribute tablegen emitter for variadic arguments to emit a ↵Aaron Ballman2014-05-021-5/+2
| | | | | | range accessor in addition to the iterators. Updated code using iterators to use range-based for loops. llvm-svn: 207837
* Handle -fdelayed-template-parsing of out-of-line definitions ofHans Wennborg2014-05-021-33/+41
| | | | | | | | | | | class template member classes (PR19613) Also improve this code in general by implementing suggestions from Richard. Differential Revision: http://reviews.llvm.org/D3555?id=9020 llvm-svn: 207822
* Use std::abs(int) portably.David Blaikie2014-05-011-2/+3
| | | | | | Code review feedback from Reid Kleckner on r207806. llvm-svn: 207811
* Fix some -Wabsolute-value warnings introduced in r207796.David Blaikie2014-05-011-2/+2
| | | | llvm-svn: 207806
* When sorting overload candidates, sort arity mismatches in ascendingKaelyn Takata2014-05-011-3/+16
| | | | | | | | order by the number of missing or extra parameters. This is useful if there are more than a few overload candidates with arity mismatches, particularly in the presence of -fshow-overloads=best. llvm-svn: 207796
* AST: Mangle reference temporaries reliablyDavid Majnemer2014-05-013-53/+56
| | | | | | | | | | | | | | | Summary: Previously, we would generate a single name for all reference temporaries and allow LLVM to rename them for us. Instead, number the reference temporaries as we build them in Sema. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3554 llvm-svn: 207776
* MSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtorsReid Kleckner2014-05-011-2/+3
| | | | | | | | | | | | | We accept 'void *p; p->~void();' for MSVC compatibility since r148682. However, we were returning ExprError, rather than producing an AST, despite only diagnosing it with a warning. CodeGen noticed that the template function specialization had an invalid AST, and therefore didn't generate code for it. This change makes us produce an AST with a void pseudo-dtor call. Part of PR18256. llvm-svn: 207771
* Add support for __declspec(thread) under -fms-extensionsReid Kleckner2014-05-011-0/+22
| | | | | | | | Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3551 llvm-svn: 207734
OpenPOWER on IntegriCloud