summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-11-27 18:03:44 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2015-11-27 18:03:44 +0000
commitbd3f47f5b53bcdf8bbd8c0afa86c3a6ed814e5fc (patch)
tree22ada3270b7ed24698e201dec0bdc11f925ebf9e /clang/lib/CodeGen
parent8f8eb8f545881c2a27e995086c1f0d8889f236dc (diff)
downloadbcm5719-llvm-bd3f47f5b53bcdf8bbd8c0afa86c3a6ed814e5fc.tar.gz
bcm5719-llvm-bd3f47f5b53bcdf8bbd8c0afa86c3a6ed814e5fc.zip
[mips] Interrupt attribute support.
Summary: This patch adds support for the interrupt attribute for mips32r2+. Patch by Simon Dardis. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254205
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 06a2e71f5c0..df081b4fb9f 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -5893,6 +5893,27 @@ public:
else if (FD->hasAttr<NoMips16Attr>()) {
Fn->addFnAttr("nomips16");
}
+
+ const MipsInterruptAttr *Attr = FD->getAttr<MipsInterruptAttr>();
+ if (!Attr)
+ return;
+
+ const char *Kind;
+ switch (Attr->getInterrupt()) {
+ default: llvm_unreachable("Unknown Mips interrupt attribute type!");
+ case MipsInterruptAttr::eic: Kind = "eic"; break;
+ case MipsInterruptAttr::sw0: Kind = "sw0"; break;
+ case MipsInterruptAttr::sw1: Kind = "sw1"; break;
+ case MipsInterruptAttr::hw0: Kind = "hw0"; break;
+ case MipsInterruptAttr::hw1: Kind = "hw1"; break;
+ case MipsInterruptAttr::hw2: Kind = "hw2"; break;
+ case MipsInterruptAttr::hw3: Kind = "hw3"; break;
+ case MipsInterruptAttr::hw4: Kind = "hw4"; break;
+ case MipsInterruptAttr::hw5: Kind = "hw5"; break;
+ }
+
+ Fn->addFnAttr("interrupt", Kind);
+
}
bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
OpenPOWER on IntegriCloud