diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp b/gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp index 4ba2a317e1f..1a8a0007530 100644 --- a/gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp +++ b/gnu/llvm/tools/clang/lib/Sema/SemaAttr.cpp @@ -205,7 +205,7 @@ void Sema::ActOnPragmaPack(SourceLocation PragmaLoc, PragmaMsStackAction Action, // "#pragma pack(pop, identifier, n) is undefined" if (Action & Sema::PSK_Pop) { if (Alignment && !SlotLabel.empty()) - Diag(PragmaLoc, diag::warn_pragma_pack_pop_identifer_and_alignment); + Diag(PragmaLoc, diag::warn_pragma_pack_pop_identifier_and_alignment); if (PackStack.Stack.empty()) Diag(PragmaLoc, diag::warn_pragma_pop_failed) << "pack" << "stack empty"; } @@ -268,7 +268,7 @@ void Sema::DiagnoseUnterminatedPragmaPack() { } } -void Sema::ActOnPragmaMSStruct(PragmaMSStructKind Kind) { +void Sema::ActOnPragmaMSStruct(PragmaMSStructKind Kind) { MSStructPragmaOn = (Kind == PMSST_ON); } @@ -330,7 +330,7 @@ void Sema::PragmaStack<ValueType>::Act(SourceLocation PragmaLocation, Stack.erase(std::prev(I.base()), Stack.end()); } } else if (!Stack.empty()) { - // We don't have a label, just pop the last entry. + // We do not have a label, just pop the last entry. CurrentValue = Stack.back().Value; CurrentPragmaLocation = Stack.back().PragmaLocation; Stack.pop_back(); @@ -389,7 +389,7 @@ bool Sema::UnifySection(StringRef SectionName, return false; } -/// \brief Called on well formed \#pragma bss_seg(). +/// Called on well formed \#pragma bss_seg(). void Sema::ActOnPragmaMSSeg(SourceLocation PragmaLocation, PragmaMsStackAction Action, llvm::StringRef StackSlotLabel, @@ -410,7 +410,7 @@ void Sema::ActOnPragmaMSSeg(SourceLocation PragmaLocation, Stack->Act(PragmaLocation, Action, StackSlotLabel, SegmentName); } -/// \brief Called on well formed \#pragma bss_seg(). +/// Called on well formed \#pragma bss_seg(). void Sema::ActOnPragmaMSSection(SourceLocation PragmaLocation, int SectionFlags, StringLiteral *SegmentName) { UnifySection(SegmentName->getString(), SectionFlags, PragmaLocation); @@ -520,7 +520,7 @@ attrMatcherRuleListToString(ArrayRef<attr::SubjectMatchRule> Rules) { } // end anonymous namespace -void Sema::ActOnPragmaAttributePush(AttributeList &Attribute, +void Sema::ActOnPragmaAttributePush(ParsedAttr &Attribute, SourceLocation PragmaLoc, attr::ParsedSubjectMatchRuleSet Rules) { SmallVector<attr::SubjectMatchRule, 4> SubjectMatchRules; @@ -645,7 +645,7 @@ void Sema::AddPragmaAttributes(Scope *S, Decl *D) { if (PragmaAttributeStack.empty()) return; for (auto &Entry : PragmaAttributeStack) { - const AttributeList *Attribute = Entry.Attribute; + ParsedAttr *Attribute = Entry.Attribute; assert(Attribute && "Expected an attribute"); // Ensure that the attribute can be applied to the given declaration. @@ -659,9 +659,10 @@ void Sema::AddPragmaAttributes(Scope *S, Decl *D) { if (!Applies) continue; Entry.IsUsed = true; - assert(!Attribute->getNext() && "Expected just one attribute"); PragmaAttributeCurrentTargetDecl = D; - ProcessDeclAttributeList(S, D, Attribute); + ParsedAttributesView Attrs; + Attrs.addAtStart(Attribute); + ProcessDeclAttributeList(S, D, Attrs); PragmaAttributeCurrentTargetDecl = nullptr; } } @@ -692,7 +693,7 @@ void Sema::AddRangeBasedOptnone(FunctionDecl *FD) { AddOptnoneAttributeIfNoConflicts(FD, OptimizeOffPragmaLocation); } -void Sema::AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD, +void Sema::AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD, SourceLocation Loc) { // Don't add a conflicting attribute. No diagnostic is needed. if (FD->hasAttr<MinSizeAttr>() || FD->hasAttr<AlwaysInlineAttr>()) |
