aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-13 05:00:21 +0000
committerChris Lattner <sabre@nondot.org>2008-03-13 05:00:21 +0000
commitd5d94df73f2af639a4cffc7e4f3491001817df08 (patch)
tree0a0f95159da3df6c4c5316c0a6efcd68d716a2b7 /lib
parent041221c0972ff575b07f76808c504833d629ae1f (diff)
move a bunch of trivial methods to be inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Function.cpp36
-rw-r--r--lib/VMCore/Instructions.cpp76
2 files changed, 2 insertions, 110 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 5a69c099f6..6fd3af4f9d 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -137,42 +137,6 @@ void Function::eraseFromParent() {
getParent()->getFunctionList().erase(this);
}
-/// @brief Determine whether the function has the given attribute.
-bool Function::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- return ParamAttrs.paramHasAttr(i, attr);
-}
-
-/// @brief Extract the alignment for a call or parameter (0=unknown).
-uint16_t Function::getParamAlignment(uint16_t i) const {
- return ParamAttrs.getParamAlignment(i);
-}
-
-/// @brief Determine if the function cannot return.
-bool Function::doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
-}
-
-/// @brief Determine if the function cannot unwind.
-bool Function::doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
-}
-
-/// @brief Determine if the function does not access memory.
-bool Function::doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
-}
-
-/// @brief Determine if the function does not access or only reads memory.
-bool Function::onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
-}
-
-/// @brief Determine if the function returns a structure through first
-/// pointer argument.
-bool Function::hasStructRetAttr() const {
- return paramHasAttr(1, ParamAttr::StructRet);
-}
-
//===----------------------------------------------------------------------===//
// Function Implementation
//===----------------------------------------------------------------------===//
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index ee9a02e91a..df5a2fc0cf 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -362,7 +362,7 @@ CallInst::CallInst(const CallInst &CI)
OL[i].init(InOL[i], this);
}
-bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
+bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
if (ParamAttrs.paramHasAttr(i, attr))
return true;
if (const Function *F = getCalledFunction())
@@ -370,47 +370,6 @@ bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
return false;
}
-uint16_t CallInst::getParamAlignment(uint16_t i) const {
- return ParamAttrs.getParamAlignment(i);
-}
-
-/// @brief Determine if the call does not access memory.
-bool CallInst::doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
-}
-
-/// @brief Determine if the call does not access or only reads memory.
-bool CallInst::onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
-}
-
-/// @brief Determine if the call cannot return.
-bool CallInst::doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
-}
-
-/// @brief Determine if the call cannot unwind.
-bool CallInst::doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
-}
-
-/// @brief Determine if the call returns a structure through first
-/// pointer argument.
-bool CallInst::hasStructRetAttr() const {
- // Be friendly and also check the callee.
- return paramHasAttr(1, ParamAttr::StructRet);
-}
-
-/// @brief Determine if any call argument is an aggregate passed by value.
-bool CallInst::hasByValArgument() const {
- if (ParamAttrs.hasAttrSomewhere(ParamAttr::ByVal))
- return true;
- // Be consistent with other methods and check the callee too.
- if (const Function *F = getCalledFunction())
- return F->getParamAttrs().hasAttrSomewhere(ParamAttr::ByVal);
- return false;
-}
-
void CallInst::setDoesNotThrow(bool doesNotThrow) {
PAListPtr PAL = getParamAttrs();
if (doesNotThrow)
@@ -473,7 +432,7 @@ void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) {
return setSuccessor(idx, B);
}
-bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
+bool InvokeInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
if (ParamAttrs.paramHasAttr(i, attr))
return true;
if (const Function *F = getCalledFunction())
@@ -481,30 +440,6 @@ bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
return false;
}
-uint16_t InvokeInst::getParamAlignment(uint16_t i) const {
- return ParamAttrs.getParamAlignment(i);
-}
-
-/// @brief Determine if the call does not access memory.
-bool InvokeInst::doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
-}
-
-/// @brief Determine if the call does not access or only reads memory.
-bool InvokeInst::onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
-}
-
-/// @brief Determine if the call cannot return.
-bool InvokeInst::doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
-}
-
-/// @brief Determine if the call cannot unwind.
-bool InvokeInst::doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
-}
-
void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
PAListPtr PAL = getParamAttrs();
if (doesNotThrow)
@@ -514,13 +449,6 @@ void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
setParamAttrs(PAL);
}
-/// @brief Determine if the invoke returns a structure through first
-/// pointer argument.
-bool InvokeInst::hasStructRetAttr() const {
- // Be friendly and also check the callee.
- return paramHasAttr(1, ParamAttr::StructRet);
-}
-
//===----------------------------------------------------------------------===//
// ReturnInst Implementation