[PATCH] D84605: [IR][MSP430] Expose the "msp430_builtin" calling convention to .ll

Anatoly Trosinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 26 11:56:38 PDT 2020


atrosinenko created this revision.
atrosinenko added reviewers: asl, rjmccall.
Herald added subscribers: dexonsmith, steven_wu, hiraditya.
Herald added a project: LLVM.

Accompanying patch for D84602 <https://reviews.llvm.org/D84602> that gives a meaningful name for `msp430_builtin` calling convention in .ll sources (`msp430_builtincc` instead of `cc94`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84605

Files:
  llvm/lib/AsmParser/LLLexer.cpp
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/AsmParser/LLToken.h
  llvm/lib/IR/AsmWriter.cpp
  llvm/test/Bitcode/compatibility.ll
  llvm/utils/vim/syntax/llvm.vim
  llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml


Index: llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
===================================================================
--- llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
+++ llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
@@ -202,6 +202,7 @@
             \\bminsize\\b|\
             \\bmodule\\b|\
             \\bmonotonic\\b|\
+            \\bmsp430_builtincc\\b|\
             \\bmsp430_intrcc\\b|\
             \\bmusttail\\b|\
             \\bnaked\\b|\
Index: llvm/utils/vim/syntax/llvm.vim
===================================================================
--- llvm/utils/vim/syntax/llvm.vim
+++ llvm/utils/vim/syntax/llvm.vim
@@ -105,6 +105,7 @@
       \ minsize
       \ module
       \ monotonic
+      \ msp430_builtincc
       \ msp430_intrcc
       \ musttail
       \ naked
Index: llvm/test/Bitcode/compatibility.ll
===================================================================
--- llvm/test/Bitcode/compatibility.ll
+++ llvm/test/Bitcode/compatibility.ll
@@ -486,6 +486,10 @@
 ; CHECK: declare amdgpu_hs void @f.cc93()
 declare amdgpu_hs void @f.amdgpu_hs()
 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
+declare cc94 void @f.cc94()
+; CHECK: declare msp430_builtincc void @f.cc94()
+declare msp430_builtincc void @f.msp430_builtincc()
+; CHECK: declare msp430_builtincc void @f.msp430_builtincc()
 declare cc95 void @f.cc95()
 ; CHECK: declare amdgpu_ls void @f.cc95()
 declare amdgpu_ls void @f.amdgpu_ls()
Index: llvm/lib/IR/AsmWriter.cpp
===================================================================
--- llvm/lib/IR/AsmWriter.cpp
+++ llvm/lib/IR/AsmWriter.cpp
@@ -367,6 +367,7 @@
   case CallingConv::AArch64_SVE_VectorCall:
     Out << "aarch64_sve_vector_pcs";
     break;
+  case CallingConv::MSP430_BUILTIN:Out << "msp430_builtincc"; 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;
Index: llvm/lib/AsmParser/LLToken.h
===================================================================
--- llvm/lib/AsmParser/LLToken.h
+++ llvm/lib/AsmParser/LLToken.h
@@ -143,6 +143,7 @@
   kw_arm_aapcs_vfpcc,
   kw_aarch64_vector_pcs,
   kw_aarch64_sve_vector_pcs,
+  kw_msp430_builtincc,
   kw_msp430_intrcc,
   kw_avr_intrcc,
   kw_avr_signalcc,
Index: llvm/lib/AsmParser/LLParser.cpp
===================================================================
--- llvm/lib/AsmParser/LLParser.cpp
+++ llvm/lib/AsmParser/LLParser.cpp
@@ -2005,6 +2005,7 @@
 ///   ::= 'arm_aapcs_vfpcc'
 ///   ::= 'aarch64_vector_pcs'
 ///   ::= 'aarch64_sve_vector_pcs'
+///   ::= 'msp430_builtincc'
 ///   ::= 'msp430_intrcc'
 ///   ::= 'avr_intrcc'
 ///   ::= 'avr_signalcc'
@@ -2054,6 +2055,7 @@
   case lltok::kw_aarch64_sve_vector_pcs:
     CC = CallingConv::AArch64_SVE_VectorCall;
     break;
+  case lltok::kw_msp430_builtincc:CC = CallingConv::MSP430_BUILTIN; 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;
Index: llvm/lib/AsmParser/LLLexer.cpp
===================================================================
--- llvm/lib/AsmParser/LLLexer.cpp
+++ llvm/lib/AsmParser/LLLexer.cpp
@@ -595,6 +595,7 @@
   KEYWORD(arm_aapcs_vfpcc);
   KEYWORD(aarch64_vector_pcs);
   KEYWORD(aarch64_sve_vector_pcs);
+  KEYWORD(msp430_builtincc);
   KEYWORD(msp430_intrcc);
   KEYWORD(avr_intrcc);
   KEYWORD(avr_signalcc);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84605.280744.patch
Type: text/x-patch
Size: 3561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200726/3e246449/attachment.bin>


More information about the llvm-commits mailing list