aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2020-01-15 13:33:58 -0800
committerMircea Trofin <mtrofin@google.com>2020-01-15 13:34:20 -0800
commit5466597fee379b44f643cee0e0632fdef8fb6b21 (patch)
tree3f1704c13dc46084ad012ab788efa56416ef7eeb /llvm/lib/CodeGen/SafeStack.cpp
parentfa26a37d36991dd19276c2112ae03e962debe0e4 (diff)
downloadllvm-5466597fee379b44f643cee0e0632fdef8fb6b21.zip
llvm-5466597fee379b44f643cee0e0632fdef8fb6b21.tar.gz
llvm-5466597fee379b44f643cee0e0632fdef8fb6b21.tar.bz2
[NFC] Refactor InlineResult for readability
Summary: InlineResult is used both in APIs assessing whether a call site is inlinable (e.g. llvm::isInlineViable) as well as in the function inlining utility (llvm::InlineFunction). It means slightly different things (can/should inlining happen, vs did it happen), and the implicit casting may introduce ambiguity (casting from 'false' in InlineFunction will default a message about hight costs, which is incorrect here). The change renames the type to a more generic name, and disables implicit constructors. Reviewers: eraman, davidxl Reviewed By: davidxl Subscribers: kerbowa, arsenm, jvesely, nhaehnle, eraman, hiraditya, haicheng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72744
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r--llvm/lib/CodeGen/SafeStack.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index 8aa488e6..136a10f 100644
--- a/llvm/lib/CodeGen/SafeStack.cpp
+++ b/llvm/lib/CodeGen/SafeStack.cpp
@@ -708,7 +708,8 @@ void SafeStack::moveDynamicAllocasToUnsafeStack(
bool SafeStack::ShouldInlinePointerAddress(CallSite &CS) {
Function *Callee = CS.getCalledFunction();
- if (CS.hasFnAttr(Attribute::AlwaysInline) && isInlineViable(*Callee))
+ if (CS.hasFnAttr(Attribute::AlwaysInline) &&
+ isInlineViable(*Callee).isSuccess())
return true;
if (Callee->isInterposable() || Callee->hasFnAttribute(Attribute::NoInline) ||
CS.isNoInline())