forked from OSchip/llvm-project
Refactored the tls_model attribute to use a custom subset subject. No functional change intended.
llvm-svn: 195964
This commit is contained in:
parent
f7cd09a047
commit
5b0481a398
|
@ -43,6 +43,9 @@ def ObjCInstanceMethod : SubsetSubject<ObjCMethod,
|
|||
def Struct : SubsetSubject<Record,
|
||||
[{!S->isUnion()}]>;
|
||||
|
||||
def TLSVar : SubsetSubject<Var,
|
||||
[{S->getTLSKind() != 0}]>;
|
||||
|
||||
// A single argument to an attribute
|
||||
class Argument<string name, bit optional> {
|
||||
string Name = name;
|
||||
|
@ -220,7 +223,7 @@ def AlwaysInline : InheritableAttr {
|
|||
|
||||
def TLSModel : InheritableAttr {
|
||||
let Spellings = [GNU<"tls_model">, CXX11<"gnu", "tls_model">];
|
||||
let Subjects = SubjectList<[Var], ErrorDiag, "ExpectedTLSVar">;
|
||||
let Subjects = SubjectList<[TLSVar], ErrorDiag, "ExpectedTLSVar">;
|
||||
let Args = [StringArgument<"Model">];
|
||||
}
|
||||
|
||||
|
|
|
@ -1545,12 +1545,6 @@ static void handleTLSModelAttr(Sema &S, Decl *D,
|
|||
if (!S.checkStringLiteralArgumentAttr(Attr, 0, Model, &LiteralLoc))
|
||||
return;
|
||||
|
||||
if (!cast<VarDecl>(D)->getTLSKind()) {
|
||||
S.Diag(Attr.getLoc(), diag::err_attribute_wrong_decl_type)
|
||||
<< Attr.getName() << ExpectedTLSVar;
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that the value.
|
||||
if (Model != "global-dynamic" && Model != "local-dynamic"
|
||||
&& Model != "initial-exec" && Model != "local-exec") {
|
||||
|
|
Loading…
Reference in New Issue