aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-03-03 21:46:28 +0000
committerDevang Patel <dpatel@apple.com>2008-03-03 21:46:28 +0000
commit949a4b703892bb1609da45f4f9b6573c9c83f161 (patch)
tree134aebc1687b4475b4b29b5bffd7672aca752505 /lib/VMCore
parent890cc575d3ce073c6296c8e889c6325a0d9a08f6 (diff)
downloadexternal_llvm-949a4b703892bb1609da45f4f9b6573c9c83f161.zip
external_llvm-949a4b703892bb1609da45f4f9b6573c9c83f161.tar.gz
external_llvm-949a4b703892bb1609da45f4f9b6573c9c83f161.tar.bz2
s/isReturnStruct()/hasStructRetAttr()/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Function.cpp8
-rw-r--r--lib/VMCore/Instructions.cpp10
-rw-r--r--lib/VMCore/Verifier.cpp3
3 files changed, 13 insertions, 8 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 92737f6..f5712e7 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -168,10 +168,10 @@ bool Function::onlyReadsMemory() const {
return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
}
-/// @brief Determine if the function returns a structure.
-bool Function::isStructReturn() const {
- return paramHasAttr(1, ParamAttr::StructRet)
- || isa<StructType>(getReturnType());
+/// @brief Determine if the function returns a structure through first
+/// pointer argument.
+bool Function::hasStructRetAttr() const {
+ return paramHasAttr(1, ParamAttr::StructRet);
}
//===----------------------------------------------------------------------===//
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index dfd3b83..f7401ec 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -419,8 +419,9 @@ bool CallInst::doesNotThrow() const {
return paramHasAttr(0, ParamAttr::NoUnwind);
}
-/// @brief Determine if the call returns a structure.
-bool CallInst::isStructReturn() const {
+/// @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);
}
@@ -560,8 +561,9 @@ void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
setParamAttrs(PAL);
}
-/// @brief Determine if the call returns a structure.
-bool InvokeInst::isStructReturn() const {
+/// @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);
}
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 3d68324..9ce886c 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -455,6 +455,9 @@ void Verifier::visitFunction(Function &F) {
isa<StructType>(F.getReturnType()),
"Functions cannot return aggregate values!", &F);
+ Assert1(!F.hasStructRetAttr() || F.getReturnType() == Type::VoidTy,
+ "Invalid struct return type!", &F);
+
const ParamAttrsList *Attrs = F.getParamAttrs();
Assert1(!Attrs ||