[llvm] r262600 - [AVR] Add calling convention parser tokens
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 3 02:08:02 PST 2016
Author: dylanmckay
Date: Thu Mar 3 04:08:02 2016
New Revision: 262600
URL: http://llvm.org/viewvc/llvm-project?rev=262600&view=rev
Log:
[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
Added:
llvm/trunk/test/Bitcode/avr-calling-conventions.ll
llvm/trunk/test/Bitcode/avr-calling-conventions.ll.bc (with props)
Modified:
llvm/trunk/lib/AsmParser/LLLexer.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/AsmParser/LLToken.h
llvm/trunk/lib/IR/AsmWriter.cpp
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=262600&r1=262599&r2=262600&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Thu Mar 3 04:08:02 2016
@@ -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);
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=262600&r1=262599&r2=262600&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Mar 3 04:08:02 2016
@@ -1536,6 +1536,8 @@ bool LLParser::ParseOptionalDLLStorageCl
/// ::= 'arm_aapcscc'
/// ::= 'arm_aapcs_vfpcc'
/// ::= 'msp430_intrcc'
+/// ::= 'avr_intrcc'
+/// ::= 'avr_signalcc'
/// ::= 'ptx_kernel'
/// ::= 'ptx_device'
/// ::= 'spir_func'
@@ -1567,6 +1569,8 @@ bool LLParser::ParseOptionalCallingConv(
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;
Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=262600&r1=262599&r2=262600&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Thu Mar 3 04:08:02 2016
@@ -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,
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=262600&r1=262599&r2=262600&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Thu Mar 3 04:08:02 2016
@@ -307,6 +307,8 @@ static void PrintCallingConv(unsigned cc
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;
Added: llvm/trunk/test/Bitcode/avr-calling-conventions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/avr-calling-conventions.ll?rev=262600&view=auto
==============================================================================
--- llvm/trunk/test/Bitcode/avr-calling-conventions.ll (added)
+++ llvm/trunk/test/Bitcode/avr-calling-conventions.ll Thu Mar 3 04:08:02 2016
@@ -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
+}
Added: llvm/trunk/test/Bitcode/avr-calling-conventions.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/avr-calling-conventions.ll.bc?rev=262600&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/Bitcode/avr-calling-conventions.ll.bc
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
More information about the llvm-commits
mailing list