mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 03:06:28 +00:00
add a comment about why we don't allow inlining indbr.
llvm-svn: 85724
This commit is contained in:
parent
0151329ce5
commit
11944e39d4
@ -159,6 +159,11 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
|
||||
if (isa<ReturnInst>(BB->getTerminator()))
|
||||
++NumRets;
|
||||
|
||||
// We never want to inline functions that contain an indirectbr. This is
|
||||
// incorrect because all the blockaddress's (e.g. in static global
|
||||
// initializers would be referring to the original function, and this indirect
|
||||
// jump would jump from the inlined copy of the function into the original
|
||||
// function which is extremely undefined behavior.
|
||||
if (isa<IndirectBrInst>(BB->getTerminator()))
|
||||
NeverInline = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user