]> granicus.if.org Git - llvm/commit
[Attr] Add "willreturn" function attribute
authorJohannes Doerfert <jdoerfert@anl.gov>
Thu, 27 Jun 2019 15:51:40 +0000 (15:51 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Thu, 27 Jun 2019 15:51:40 +0000 (15:51 +0000)
commit8a0fc5ba4f2841d1c96097717443274bebdaae8b
treedcb0007b851c54b3d9573b1f441c31adde96f56b
parent068d4d9024f0f609ec6df4a86985a48d6a776521
[Attr] Add "willreturn" function attribute

This patch introduces a new function attribute, willreturn, to indicate
that a call of this function will either exhibit undefined behavior or
comes back and continues execution at a point in the existing call stack
that includes the current invocation.

This attribute guarantees that the function does not have any endless
loops, endless recursion, or terminating functions like abort or exit.

Patch by Hideto Ueno (@uenoku)

Reviewers: jdoerfert

Subscribers: mehdi_amini, hiraditya, steven_wu, dexonsmith, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62801

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364555 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
docs/LangRef.rst
include/llvm/Bitcode/LLVMBitCodes.h
include/llvm/IR/Attributes.td
lib/AsmParser/LLLexer.cpp
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLToken.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/IR/Attributes.cpp
lib/IR/Verifier.cpp
lib/Transforms/Utils/CodeExtractor.cpp
test/Bitcode/attributes.ll
test/Transforms/FunctionAttrs/willreturn.ll [new file with mode: 0644]