diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2019-01-23 18:02:17 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2019-01-23 18:02:17 +0000 |
| commit | b0d74bfe81b6cb4119b2e943fb2df35e30b4f4dd (patch) | |
| tree | 1469d1f81aa76042482c8d874c78fed5b283a025 | |
| parent | 25ce596cd111ba93777338412ff9731b16f45cc6 (diff) | |
| download | bcm5719-llvm-b0d74bfe81b6cb4119b2e943fb2df35e30b4f4dd.tar.gz bcm5719-llvm-b0d74bfe81b6cb4119b2e943fb2df35e30b4f4dd.zip | |
Merge similar target diagnostics for interrupt attribute into one; NFC
Patch by Kristina Bessonova!
llvm-svn: 351969
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 14 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 22 |
2 files changed, 15 insertions, 21 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index c55c8159768..1a8f5c1307c 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -261,22 +261,14 @@ def err_anyx86_interrupt_called : Error< def warn_arm_interrupt_calling_convention : Warning< "call to function without interrupt attribute could clobber interruptee's VFP registers">, InGroup<Extra>; -def warn_mips_interrupt_attribute : Warning< - "MIPS 'interrupt' attribute only applies to functions that have " - "%select{no parameters|a 'void' return type}0">, +def warn_interrupt_attribute_invalid : Warning< + "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to " + "functions that have %select{no parameters|a 'void' return type}1">, InGroup<IgnoredAttributes>; def warn_riscv_repeated_interrupt_attribute : Warning< "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>; def note_riscv_repeated_interrupt_attribute : Note< "repeated RISC-V 'interrupt' attribute is here">; -def warn_riscv_interrupt_attribute : Warning< - "RISC-V 'interrupt' attribute only applies to functions that have " - "%select{no parameters|a 'void' return type}0">, - InGroup<IgnoredAttributes>; -def warn_msp430_interrupt_attribute : Warning< - "MSP430 'interrupt' attribute only applies to functions that have " - "%select{no parameters|a 'void' return type}0">, - InGroup<IgnoredAttributes>; def warn_unused_parameter : Warning<"unused parameter %0">, InGroup<UnusedParameter>, DefaultIgnore; def warn_unused_variable : Warning<"unused variable %0">, diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 5e9f27001d6..010095da577 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -5543,14 +5543,14 @@ static void handleMSP430InterruptAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } if (hasFunctionProto(D) && getFunctionOrMethodNumParams(D) != 0) { - S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute) - << 0; + S.Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid) + << /*MSP430*/ 1 << 0; return; } if (!getFunctionOrMethodResultType(D)->isVoidType()) { - S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute) - << 1; + S.Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid) + << /*MSP430*/ 1 << 1; return; } @@ -5618,14 +5618,14 @@ static void handleMipsInterruptAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } if (hasFunctionProto(D) && getFunctionOrMethodNumParams(D) != 0) { - S.Diag(D->getLocation(), diag::warn_mips_interrupt_attribute) - << 0; + S.Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid) + << /*MIPS*/ 0 << 0; return; } if (!getFunctionOrMethodResultType(D)->isVoidType()) { - S.Diag(D->getLocation(), diag::warn_mips_interrupt_attribute) - << 1; + S.Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid) + << /*MIPS*/ 0 << 1; return; } @@ -5772,12 +5772,14 @@ static void handleRISCVInterruptAttr(Sema &S, Decl *D, } if (hasFunctionProto(D) && getFunctionOrMethodNumParams(D) != 0) { - S.Diag(D->getLocation(), diag::warn_riscv_interrupt_attribute) << 0; + S.Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid) + << /*RISC-V*/ 2 << 0; return; } if (!getFunctionOrMethodResultType(D)->isVoidType()) { - S.Diag(D->getLocation(), diag::warn_riscv_interrupt_attribute) << 1; + S.Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid) + << /*RISC-V*/ 2 << 1; return; } |

