forked from OSchip/llvm-project
A FIXME about block addresses and indirectbr.
llvm-svn: 142569
This commit is contained in:
parent
91c7bbde4b
commit
68db4c2699
|
@ -135,6 +135,12 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
|
|||
// for example) 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.
|
||||
// FIXME: This logic isn't really right; we can safely inline functions
|
||||
// with indirectbr's as long as no other function or global references the
|
||||
// blockaddress of a block within the current function. And as a QOI issue,
|
||||
// if someone is using a blockaddress wihtout an indirectbr, and that
|
||||
// reference somehow ends up in another function or global, we probably
|
||||
// don't want to inline this function.
|
||||
if (isa<IndirectBrInst>(BB->getTerminator()))
|
||||
containsIndirectBr = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue