summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/Overload.h
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-02-01 17:13:26 +0000
committerHans Wennborg <hans@hanshq.net>2017-02-01 17:13:26 +0000
commitccd6729877c03d702cccf5f9a3c5d4c2df372ff1 (patch)
tree3e9ebd91d5d43e012c7c63917be55e00c0831d68 /include/clang/Sema/Overload.h
parent5eb0ba0f845af0eb3cc9d2b594385435c368994a (diff)
Merging r293360:
------------------------------------------------------------------------ r293360 | gbiv | 2017-01-27 18:19:40 -0800 (Fri, 27 Jan 2017) | 11 lines Change how we handle diagnose_if attributes. This patch changes how we handle argument-dependent `diagnose_if` attributes. In particular, we now check them in the same place that we check for things like passing NULL to Nonnull args, etc. This is basically better in every way than how we were handling them before. :) This fixes PR31638, PR31639, and PR31640. Differential Revision: https://reviews.llvm.org/D28889 ------------------------------------------------------------------------ Merging r293369: ------------------------------------------------------------------------ r293369 | gbiv | 2017-01-27 20:16:32 -0800 (Fri, 27 Jan 2017) | 7 lines Attempt to unbreak buildbots. r293360 broke some ARM bots, because size_t on those targets is apparently `unsigned int`, not `unsigned long`. `sizeof(whatever)` should to give us a `size_t`, so we can just use the type of that instead. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/Overload.h')
-rw-r--r--include/clang/Sema/Overload.h32
1 files changed, 4 insertions, 28 deletions
diff --git a/include/clang/Sema/Overload.h b/include/clang/Sema/Overload.h
index 88fdc991f3..5220d98730 100644
--- a/include/clang/Sema/Overload.h
+++ b/include/clang/Sema/Overload.h
@@ -675,26 +675,6 @@ namespace clang {
/// to be used while performing partial ordering of function templates.
unsigned ExplicitCallArguments;
- /// The number of diagnose_if attributes that this overload triggered.
- /// If any of the triggered attributes are errors, this won't count
- /// diagnose_if warnings.
- unsigned NumTriggeredDiagnoseIfs = 0;
-
- /// Basically a TinyPtrVector<DiagnoseIfAttr *> that doesn't own the vector:
- /// If NumTriggeredDiagnoseIfs is 0 or 1, this is a DiagnoseIfAttr *,
- /// otherwise it's a pointer to an array of `NumTriggeredDiagnoseIfs`
- /// DiagnoseIfAttr *s.
- llvm::PointerUnion<DiagnoseIfAttr *, DiagnoseIfAttr **> DiagnoseIfInfo;
-
- /// Gets an ArrayRef for the data at DiagnoseIfInfo. Note that this may give
- /// you a pointer into DiagnoseIfInfo.
- ArrayRef<DiagnoseIfAttr *> getDiagnoseIfInfo() const {
- auto *Ptr = NumTriggeredDiagnoseIfs <= 1
- ? DiagnoseIfInfo.getAddrOfPtr1()
- : DiagnoseIfInfo.get<DiagnoseIfAttr **>();
- return {Ptr, NumTriggeredDiagnoseIfs};
- }
-
union {
DeductionFailureInfo DeductionFailure;
@@ -759,9 +739,8 @@ namespace clang {
SmallVector<OverloadCandidate, 16> Candidates;
llvm::SmallPtrSet<Decl *, 16> Functions;
- // Allocator for ConversionSequenceLists and DiagnoseIfAttr* arrays.
- // We store the first few of each of these inline to avoid allocation for
- // small sets.
+ // Allocator for ConversionSequenceLists. We store the first few of these
+ // inline to avoid allocation for small sets.
llvm::BumpPtrAllocator SlabAllocator;
SourceLocation Loc;
@@ -776,6 +755,8 @@ namespace clang {
/// from the slab allocator.
/// FIXME: It would probably be nice to have a SmallBumpPtrAllocator
/// instead.
+ /// FIXME: Now that this only allocates ImplicitConversionSequences, do we
+ /// want to un-generalize this?
template <typename T>
T *slabAllocate(unsigned N) {
// It's simpler if this doesn't need to consider alignment.
@@ -809,11 +790,6 @@ namespace clang {
SourceLocation getLocation() const { return Loc; }
CandidateSetKind getKind() const { return Kind; }
- /// Make a DiagnoseIfAttr* array in a block of memory that will live for
- /// as long as this OverloadCandidateSet. Returns a pointer to the start
- /// of that array.
- DiagnoseIfAttr **addDiagnoseIfComplaints(ArrayRef<DiagnoseIfAttr *> CA);
-
/// \brief Determine when this overload candidate will be new to the
/// overload set.
bool isNewCandidate(Decl *F) {