aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/MSP430/MSP430AsmPrinter.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
commit1d5ae1026e831016fc29fd927877c86af904481f (patch)
tree2cdfd12620fcfa5d9e4a0389f85368e8e36f63f9 /lib/Target/MSP430/MSP430AsmPrinter.cpp
parente6d1592492a3a379186bfb02bd0f4eda0669c0d5 (diff)
downloadsrc-1d5ae1026e831016fc29fd927877c86af904481f.tar.gz
src-1d5ae1026e831016fc29fd927877c86af904481f.zip
Notes
Diffstat (limited to 'lib/Target/MSP430/MSP430AsmPrinter.cpp')
-rw-r--r--lib/Target/MSP430/MSP430AsmPrinter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp
index 3a71a084d1af..a3b91acdc6d0 100644
--- a/lib/Target/MSP430/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp
@@ -159,8 +159,9 @@ void MSP430AsmPrinter::EmitInstruction(const MachineInstr *MI) {
void MSP430AsmPrinter::EmitInterruptVectorSection(MachineFunction &ISR) {
MCSection *Cur = OutStreamer->getCurrentSectionOnly();
const auto *F = &ISR.getFunction();
- assert(F->hasFnAttribute("interrupt") &&
- "Functions with MSP430_INTR CC should have 'interrupt' attribute");
+ if (F->getCallingConv() != CallingConv::MSP430_INTR) {
+ report_fatal_error("Functions with 'interrupt' attribute must have msp430_intrcc CC");
+ }
StringRef IVIdx = F->getFnAttribute("interrupt").getValueAsString();
MCSection *IV = OutStreamer->getContext().getELFSection(
"__interrupt_vector_" + IVIdx,
@@ -174,8 +175,9 @@ void MSP430AsmPrinter::EmitInterruptVectorSection(MachineFunction &ISR) {
bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Emit separate section for an interrupt vector if ISR
- if (MF.getFunction().getCallingConv() == CallingConv::MSP430_INTR)
+ if (MF.getFunction().hasFnAttribute("interrupt")) {
EmitInterruptVectorSection(MF);
+ }
SetupMachineFunction(MF);
EmitFunctionBody();