[PATCH] D84602: [MSP430] Expose msp430_builtin calling convention to C code

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


atrosinenko created this revision.
atrosinenko added reviewers: asl, aaron.ballman, rjmccall.
Herald added subscribers: llvm-commits, hiraditya.
Herald added projects: clang, LLVM.

According to MSP430 EABI document <https://www.ti.com/lit/an/slaa534a/slaa534a.pdf>, Section 6.3, some of compiler helper functions require a special calling convention that is used for some of LibCalls accepting two 64-bit arguments.

As part of porting the compiler-rt builtins library to MSP430 I need to not only internally emit calls to these LibCalls but also to explicitly declare such functions in C code (for explicilty calling them from the unit test code) and to implement them in C (when I do not want to replace the generic C implementation with custom assembler code).

References: How to add an attribute <http://clang.llvm.org/docs/InternalsManual.html#how-to-add-an-attribute> chapter covers basics of adding a new attribute (not specifically calling convention-related).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84602

Files:
  clang/include/clang/Basic/Attr.td
  clang/include/clang/Basic/Specifiers.h
  clang/lib/AST/ItaniumMangle.cpp
  clang/lib/AST/Type.cpp
  clang/lib/AST/TypePrinter.cpp
  clang/lib/Basic/Targets/MSP430.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/CodeGen/msp430-cc-builtin.c
  clang/test/Sema/attr-msp430.c
  clang/tools/libclang/CXType.cpp
  llvm/lib/Target/MSP430/MSP430ISelLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84602.280740.patch
Type: text/x-patch
Size: 8359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200726/e68694d5/attachment.bin>


More information about the llvm-commits mailing list