summaryrefslogtreecommitdiffstats
path: root/clang/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang')
-rw-r--r--clang/include/clang/Basic/Attr.td2
-rw-r--r--clang/include/clang/Basic/AttrDocs.td17
-rw-r--r--clang/include/clang/Basic/DiagnosticGroups.td1
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td9
-rw-r--r--clang/include/clang/Parse/Parser.h4
-rw-r--r--clang/include/clang/Sema/AttributeList.h22
-rw-r--r--clang/include/clang/Sema/DelayedDiagnostic.h9
-rw-r--r--clang/include/clang/Sema/Sema.h5
8 files changed, 30 insertions, 39 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index a16b9693167..c7f559d9b3a 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -451,7 +451,7 @@ def Availability : InheritableAttr {
let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">,
VersionArgument<"deprecated">, VersionArgument<"obsoleted">,
BoolArgument<"unavailable">, StringArgument<"message">,
- BoolArgument<"nopartial">];
+ BoolArgument<"strict">];
let AdditionalMembers =
[{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {
return llvm::StringSwitch<llvm::StringRef>(Platform)
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index 44f6ea2c467..5ed44de420c 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -685,20 +685,21 @@ are:
Apple's watchOS operating system. The minimum deployment target is specified by
the ``-mwatchos-version-min=*version*`` command-line argument.
-An optional nopartial can be placed after the platform name.
-With the optional nopartial, when deploying back to a platform version prior to
-when the declaration was introduced, Clang emits an error specifying that the
-function is not introduced yet.
-
-Without the optional nopartial, a declaration can be used even when deploying back
-to a platform version prior to when the declaration was introduced. When this
-happens, the declaration is `weakly linked
+A declaration can typically be used even when deploying back to a platform
+version prior to when the declaration was introduced. When this happens, the
+declaration is `weakly linked
<https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html>`_,
as if the ``weak_import`` attribute were added to the declaration. A
weakly-linked declaration may or may not be present a run-time, and a program
can determine whether the declaration is present by checking whether the
address of that declaration is non-NULL.
+The flag ``strict`` disallows using API when deploying back to a
+platform version prior to when the declaration was introduced. An
+attempt to use such API before its introduction causes a hard error.
+Weakly-linking is almost always a better API choice, since it allows
+users to query availability at runtime.
+
If there are multiple declarations of the same entity, the availability
attributes must either match on a per-platform basis or later
declarations must not have availability attributes for that
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index 875f5ceb90c..969050df596 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -87,7 +87,6 @@ def DeprecatedAttributes : DiagGroup<"deprecated-attributes">;
def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
def PartialAvailability : DiagGroup<"partial-availability">;
-def NotYetIntroducedDeclarations : DiagGroup<"not-yet-introduced-declarations">;
def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
def DeprecatedRegister : DiagGroup<"deprecated-register">;
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 5394a06baf3..45d1b4acc13 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -841,7 +841,7 @@ def warn_accessor_property_type_mismatch : Warning<
def not_conv_function_declared_at : Note<"type conversion function declared here">;
def note_method_declared_at : Note<"method %0 declared here">;
def note_property_attribute : Note<"property %0 is declared "
- "%select{deprecated|unavailable|partial|not-yet-introduced}1 here">;
+ "%select{deprecated|unavailable|partial}1 here">;
def err_setter_type_void : Error<"type of setter must be void">;
def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
def warn_duplicate_method_decl :
@@ -4128,14 +4128,9 @@ def err_unavailable_message : Error<"%0 is unavailable: %1">;
def warn_unavailable_fwdclass_message : Warning<
"%0 may be unavailable because the receiver type is unknown">,
InGroup<UnavailableDeclarations>;
-def err_notyetintroduced : Error<"%0 is not introduced yet">;
-def err_notyetintroduced_message : Error<"%0 is not introduced yet: %1">;
-def warn_notyetintroduced_fwdclass_message : Warning<
- "%0 may not be introduced because the receiver type is unknown">,
- InGroup<NotYetIntroducedDeclarations>;
def note_availability_specified_here : Note<
"%0 has been explicitly marked "
- "%select{unavailable|deleted|deprecated|partial|not-yet-introduced}1 here">;
+ "%select{unavailable|deleted|deprecated|partial}1 here">;
def note_implicitly_deleted : Note<
"explicitly defaulted function was implicitly deleted here">;
def note_inherited_deleted_here : Note<
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 781fdb3f4cb..1aabc6ce284 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -134,8 +134,8 @@ class Parser : public CodeCompletionHandler {
/// \brief Identifier for "message".
IdentifierInfo *Ident_message;
- /// \brief Identifier for "nopartial".
- IdentifierInfo *Ident_nopartial;
+ /// \brief Identifier for "strict".
+ IdentifierInfo *Ident_strict;
/// C++0x contextual keywords.
mutable IdentifierInfo *Ident_final;
diff --git a/clang/include/clang/Sema/AttributeList.h b/clang/include/clang/Sema/AttributeList.h
index bfb85d0d219..836646de609 100644
--- a/clang/include/clang/Sema/AttributeList.h
+++ b/clang/include/clang/Sema/AttributeList.h
@@ -157,13 +157,13 @@ private:
+ NumArgs)[index];
}
- /// The location of the 'nopartial' keyword in an availability attribute.
- SourceLocation *getNopartialSlot() {
+ /// The location of the 'strict' keyword in an availability attribute.
+ SourceLocation *getStrictSlot() {
return reinterpret_cast<SourceLocation*>(
&getAvailabilitySlot(ObsoletedSlot) + 1);
}
- SourceLocation const *getNopartialSlot() const {
+ SourceLocation const *getStrictSlot() const {
return reinterpret_cast<SourceLocation const*>(
&getAvailabilitySlot(ObsoletedSlot) + 1);
}
@@ -244,7 +244,7 @@ private:
const AvailabilityChange &obsoleted,
SourceLocation unavailable,
const Expr *messageExpr,
- Syntax syntaxUsed, SourceLocation nopartial)
+ Syntax syntaxUsed, SourceLocation strict)
: AttrName(attrName), ScopeName(scopeName), AttrRange(attrRange),
ScopeLoc(scopeLoc), EllipsisLoc(), NumArgs(1), SyntaxUsed(syntaxUsed),
Invalid(false), UsedAsTypeAttr(false), IsAvailability(true),
@@ -256,7 +256,7 @@ private:
new (&getAvailabilitySlot(IntroducedSlot)) AvailabilityChange(introduced);
new (&getAvailabilitySlot(DeprecatedSlot)) AvailabilityChange(deprecated);
new (&getAvailabilitySlot(ObsoletedSlot)) AvailabilityChange(obsoleted);
- memcpy(getNopartialSlot(), &nopartial, sizeof(SourceLocation));
+ memcpy(getStrictSlot(), &strict, sizeof(SourceLocation));
AttrKind = getKind(getName(), getScopeName(), syntaxUsed);
}
@@ -424,9 +424,9 @@ public:
return getAvailabilitySlot(ObsoletedSlot);
}
- SourceLocation getNopartialLoc() const {
+ SourceLocation getStrictLoc() const {
assert(getKind() == AT_Availability && "Not an availability attribute");
- return *getNopartialSlot();
+ return *getStrictSlot();
}
SourceLocation getUnavailableLoc() const {
@@ -624,13 +624,13 @@ public:
SourceLocation unavailable,
const Expr *MessageExpr,
AttributeList::Syntax syntax,
- SourceLocation nopartial) {
+ SourceLocation strict) {
void *memory = allocate(AttributeFactory::AvailabilityAllocSize);
return add(new (memory) AttributeList(attrName, attrRange,
scopeName, scopeLoc,
Param, introduced, deprecated,
obsoleted, unavailable, MessageExpr,
- syntax, nopartial));
+ syntax, strict));
}
AttributeList *create(IdentifierInfo *attrName, SourceRange attrRange,
@@ -760,11 +760,11 @@ public:
SourceLocation unavailable,
const Expr *MessageExpr,
AttributeList::Syntax syntax,
- SourceLocation nopartial) {
+ SourceLocation strict) {
AttributeList *attr =
pool.create(attrName, attrRange, scopeName, scopeLoc, Param, introduced,
deprecated, obsoleted, unavailable, MessageExpr, syntax,
- nopartial);
+ strict);
add(attr);
return attr;
}
diff --git a/clang/include/clang/Sema/DelayedDiagnostic.h b/clang/include/clang/Sema/DelayedDiagnostic.h
index 43d67640504..155b3aa72d7 100644
--- a/clang/include/clang/Sema/DelayedDiagnostic.h
+++ b/clang/include/clang/Sema/DelayedDiagnostic.h
@@ -113,8 +113,7 @@ private:
/// the complete parsing of the current declaration.
class DelayedDiagnostic {
public:
- enum DDKind { Deprecation, Unavailable, Access, ForbiddenType,
- NotYetIntroduced };
+ enum DDKind { Deprecation, Unavailable, Access, ForbiddenType };
unsigned char Kind; // actually a DDKind
bool Triggered;
@@ -166,15 +165,13 @@ public:
}
const NamedDecl *getDeprecationDecl() const {
- assert((Kind == Deprecation || Kind == Unavailable ||
- Kind == NotYetIntroduced) &&
+ assert((Kind == Deprecation || Kind == Unavailable) &&
"Not a deprecation diagnostic.");
return DeprecationData.Decl;
}
StringRef getDeprecationMessage() const {
- assert((Kind == Deprecation || Kind == Unavailable ||
- Kind == NotYetIntroduced) &&
+ assert((Kind == Deprecation || Kind == Unavailable) &&
"Not a deprecation diagnostic.");
return StringRef(DeprecationData.Message,
DeprecationData.MessageLen);
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index ba2e23180ea..bfba7b11efa 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -2108,7 +2108,7 @@ public:
VersionTuple Obsoleted,
bool IsUnavailable,
StringRef Message,
- bool IsNopartial,
+ bool IsStrict,
AvailabilityMergeKind AMK,
unsigned AttrSpellingListIndex);
TypeVisibilityAttr *mergeTypeVisibilityAttr(Decl *D, SourceRange Range,
@@ -3536,8 +3536,7 @@ public:
void redelayDiagnostics(sema::DelayedDiagnosticPool &pool);
- enum AvailabilityDiagnostic { AD_Deprecation, AD_Unavailable, AD_Partial,
- AD_NotYetIntroduced };
+ enum AvailabilityDiagnostic { AD_Deprecation, AD_Unavailable, AD_Partial };
void EmitAvailabilityWarning(AvailabilityDiagnostic AD,
NamedDecl *D, StringRef Message,
OpenPOWER on IntegriCloud