diff options
author | Dylan McKay <dylanmckay34@gmail.com> | 2016-03-03 10:08:02 +0000 |
---|---|---|
committer | Dylan McKay <dylanmckay34@gmail.com> | 2016-03-03 10:08:02 +0000 |
commit | 4fd0d4af86d25a575dc5b4dbddeaad45c703a6ad (patch) | |
tree | f4c1d14fbaea6442209c8f265a90e5b3963cba38 | |
parent | 91dd0a796cb31bb4aa5720fc00f52e340c7f5809 (diff) | |
download | bcm5719-llvm-4fd0d4af86d25a575dc5b4dbddeaad45c703a6ad.tar.gz bcm5719-llvm-4fd0d4af86d25a575dc5b4dbddeaad45c703a6ad.zip |
[AVR] Add calling convention parser tokens
Summary: Adds the 'avr_intrcc' and 'avr_signalcc' IR calling convention tokens to the parser.
Reviewers: arsenm
Subscribers: dylanmckay, llvm-commits
Differential Revision: http://reviews.llvm.org/D16348
llvm-svn: 262600
-rw-r--r-- | llvm/lib/AsmParser/LLLexer.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/AsmParser/LLToken.h | 1 | ||||
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 2 | ||||
-rw-r--r-- | llvm/test/Bitcode/avr-calling-conventions.ll | 16 | ||||
-rw-r--r-- | llvm/test/Bitcode/avr-calling-conventions.ll.bc | bin | 0 -> 704 bytes |
6 files changed, 25 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp index 26eca230bb3..e89e03c4e19 100644 --- a/llvm/lib/AsmParser/LLLexer.cpp +++ b/llvm/lib/AsmParser/LLLexer.cpp @@ -579,6 +579,8 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(arm_aapcscc); KEYWORD(arm_aapcs_vfpcc); KEYWORD(msp430_intrcc); + KEYWORD(avr_intrcc); + KEYWORD(avr_signalcc); KEYWORD(ptx_kernel); KEYWORD(ptx_device); KEYWORD(spir_kernel); diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 991cbd09332..3f97cd61ae4 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -1536,6 +1536,8 @@ bool LLParser::ParseOptionalDLLStorageClass(unsigned &Res) { /// ::= 'arm_aapcscc' /// ::= 'arm_aapcs_vfpcc' /// ::= 'msp430_intrcc' +/// ::= 'avr_intrcc' +/// ::= 'avr_signalcc' /// ::= 'ptx_kernel' /// ::= 'ptx_device' /// ::= 'spir_func' @@ -1567,6 +1569,8 @@ bool LLParser::ParseOptionalCallingConv(unsigned &CC) { case lltok::kw_arm_aapcscc: CC = CallingConv::ARM_AAPCS; break; case lltok::kw_arm_aapcs_vfpcc:CC = CallingConv::ARM_AAPCS_VFP; break; case lltok::kw_msp430_intrcc: CC = CallingConv::MSP430_INTR; break; + case lltok::kw_avr_intrcc: CC = CallingConv::AVR_INTR; break; + case lltok::kw_avr_signalcc: CC = CallingConv::AVR_SIGNAL; break; case lltok::kw_ptx_kernel: CC = CallingConv::PTX_Kernel; break; case lltok::kw_ptx_device: CC = CallingConv::PTX_Device; break; case lltok::kw_spir_kernel: CC = CallingConv::SPIR_KERNEL; break; diff --git a/llvm/lib/AsmParser/LLToken.h b/llvm/lib/AsmParser/LLToken.h index 29a7f16d3c2..49b663ecc64 100644 --- a/llvm/lib/AsmParser/LLToken.h +++ b/llvm/lib/AsmParser/LLToken.h @@ -94,6 +94,7 @@ namespace lltok { kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc, kw_x86_vectorcallcc, kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc, kw_msp430_intrcc, + kw_avr_intrcc, kw_avr_signalcc, kw_ptx_kernel, kw_ptx_device, kw_spir_kernel, kw_spir_func, kw_x86_64_sysvcc, kw_x86_64_win64cc, diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index df796a44212..2bc0e186d01 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -307,6 +307,8 @@ static void PrintCallingConv(unsigned cc, raw_ostream &Out) { case CallingConv::ARM_AAPCS: Out << "arm_aapcscc"; break; case CallingConv::ARM_AAPCS_VFP: Out << "arm_aapcs_vfpcc"; break; case CallingConv::MSP430_INTR: Out << "msp430_intrcc"; break; + case CallingConv::AVR_INTR: Out << "avr_intrcc "; break; + case CallingConv::AVR_SIGNAL: Out << "avr_signalcc "; break; case CallingConv::PTX_Kernel: Out << "ptx_kernel"; break; case CallingConv::PTX_Device: Out << "ptx_device"; break; case CallingConv::X86_64_SysV: Out << "x86_64_sysvcc"; break; diff --git a/llvm/test/Bitcode/avr-calling-conventions.ll b/llvm/test/Bitcode/avr-calling-conventions.ll new file mode 100644 index 00000000000..ea1005d1477 --- /dev/null +++ b/llvm/test/Bitcode/avr-calling-conventions.ll @@ -0,0 +1,16 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; CHECK: define avr_intrcc void @foo(i8) +define avr_intrcc void @foo(i8) { + ret void +} + +; CHECK: define avr_signalcc void @bar(i8) +define avr_signalcc void @bar(i8) { + ret void +} + +; CHECK: define void @baz(i8) +define void @baz(i8) { + ret void +} diff --git a/llvm/test/Bitcode/avr-calling-conventions.ll.bc b/llvm/test/Bitcode/avr-calling-conventions.ll.bc Binary files differnew file mode 100644 index 00000000000..85e9c14e6e9 --- /dev/null +++ b/llvm/test/Bitcode/avr-calling-conventions.ll.bc |