summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-03-16 16:57:31 +0000
committerReid Kleckner <rnk@google.com>2017-03-16 16:57:31 +0000
commit1275a2dec8564ced4a4679bcb82fdaa241a87805 (patch)
tree6f1ea8290e5672b622cb15e60bc9a7490d941eda /llvm/lib/IR/Function.cpp
parentc5b3351750c74b192d1fb31de291494fa8db97b2 (diff)
downloadbcm5719-llvm-1275a2dec8564ced4a4679bcb82fdaa241a87805.tar.gz
bcm5719-llvm-1275a2dec8564ced4a4679bcb82fdaa241a87805.zip
[IR] Inline some Function accessors
I checked that all of these out-of-line methods previously compiled to simple loads and bittests, so they are pretty good candidates for inlining. In particular, arg_size() and arg_empty() are popular and are just two loads, so they seem worth inlining. llvm-svn: 297963
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 7b5d49c34b3..1318b5163be 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -185,32 +185,10 @@ bool Argument::hasAttribute(Attribute::AttrKind Kind) const {
// Helper Methods in Function
//===----------------------------------------------------------------------===//
-bool Function::isMaterializable() const {
- return getGlobalObjectSubClassData() & (1 << IsMaterializableBit);
-}
-
-void Function::setIsMaterializable(bool V) {
- unsigned Mask = 1 << IsMaterializableBit;
- setGlobalObjectSubClassData((~Mask & getGlobalObjectSubClassData()) |
- (V ? Mask : 0u));
-}
-
LLVMContext &Function::getContext() const {
return getType()->getContext();
}
-FunctionType *Function::getFunctionType() const {
- return cast<FunctionType>(getValueType());
-}
-
-bool Function::isVarArg() const {
- return getFunctionType()->isVarArg();
-}
-
-Type *Function::getReturnType() const {
- return getFunctionType()->getReturnType();
-}
-
void Function::removeFromParent() {
getParent()->getFunctionList().remove(getIterator());
}
@@ -296,13 +274,6 @@ void Function::stealArgumentListFrom(Function &Src) {
Src.setValueSubclassData(Src.getSubclassDataFromValue() | (1 << 0));
}
-size_t Function::arg_size() const {
- return getFunctionType()->getNumParams();
-}
-bool Function::arg_empty() const {
- return getFunctionType()->getNumParams() == 0;
-}
-
// dropAllReferences() - This function causes all the subinstructions to "let
// go" of all references that they are maintaining. This allows one to
// 'delete' a whole class at a time, even though there may be circular
OpenPOWER on IntegriCloud