]> granicus.if.org Git - clang/commit
[CodeGen] Tweak isTriviallyRecursive further
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 30 Jun 2015 04:41:18 +0000 (04:41 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 30 Jun 2015 04:41:18 +0000 (04:41 +0000)
commit5eeb3a4bfa5fc568d4f3ac51c9c3392f72a4bb17
tree003853261cd43d95a3d9551b47c2c39ede77260b
parent25c4b570fc0cd86124befc713d9bcc05ac0a4dbd
[CodeGen] Tweak isTriviallyRecursive further

isTriviallyRecursive is a hack used to bridge a gap between the
expectations that source code assumes and the semantics that LLVM IR can
provide.  Specifically, asm labels on functions are treated as an
explicit name for a GlobalObject in Clang but treated like an
output-processing step in GCC.  Tweak this hack a little further to emit
calls to library functions instead of emitting an incorrect definition.
The definition in question would have available_externally linkage (this
is OK) but result in a call to itself which will either result in an
infinite loop or stack overflow.

This fixes PR23964.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241043 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenModule.cpp
test/CodeGen/pr9614.c