summaryrefslogtreecommitdiff
path: root/tools/llvm-upgrade
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-11 02:44:20 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-11 02:44:20 +0000
commit18da0720887527ed570e9703ae5f290beb491ee1 (patch)
tree9a0a69b4dd6e5a5326680389f76724e0db1b98dd /tools/llvm-upgrade
parent947aa7de67c553a0bbf0ef60173f23a8747014bf (diff)
downloadllvm-18da0720887527ed570e9703ae5f290beb491ee1.tar.gz
llvm-18da0720887527ed570e9703ae5f290beb491ee1.tar.bz2
llvm-18da0720887527ed570e9703ae5f290beb491ee1.tar.xz
For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-upgrade')
-rw-r--r--tools/llvm-upgrade/UpgradeParser.cpp.cvs16
-rw-r--r--tools/llvm-upgrade/UpgradeParser.y16
-rw-r--r--tools/llvm-upgrade/UpgradeParser.y.cvs16
3 files changed, 24 insertions, 24 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
index 2eebb7108b..ae4bd09f6b 100644
--- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
@@ -748,7 +748,7 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1,
PAL2 = *F2->getParamAttrs();
if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0))
return false;
- unsigned SRetMask = ~unsigned(StructRetAttribute);
+ unsigned SRetMask = ~unsigned(ParamAttr::StructRet);
for (unsigned i = 0; i < F1->getNumParams(); ++i) {
if (F1->getParamType(i) != F2->getParamType(i) ||
unsigned(PAL1.getParamAttrs(i+1)) & SRetMask !=
@@ -793,7 +793,7 @@ static Value* handleSRetFuncTypeMerge(Value *V, const Type* Ty) {
const FunctionType *FT2 = dyn_cast<FunctionType>(PF2->getElementType());
if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) {
const ParamAttrsList *PAL2 = FT2->getParamAttrs();
- if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute))
+ if (PAL2 && PAL2->paramHasAttr(1, ParamAttr::StructRet))
return V;
else if (Constant *C = dyn_cast<Constant>(V))
return ConstantExpr::getBitCast(C, PF1);
@@ -5389,8 +5389,8 @@ yyreduce:
ParamAttrsList *ParamAttrs = 0;
if ((yyvsp[-7].UIntVal) == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first arg
+ ParamAttrs->addAttributes(0, ParamAttr::None); // result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg
}
const FunctionType *FT =
@@ -5867,8 +5867,8 @@ yyreduce:
ParamAttrsList *ParamAttrs = 0;
if ((yyvsp[-11].UIntVal) == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // Function result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first param
+ ParamAttrs->addAttributes(0, ParamAttr::None); // Function result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param
}
bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
if (isVarArg) ParamTypes.pop_back();
@@ -6369,8 +6369,8 @@ yyreduce:
ParamAttrsList *ParamAttrs = 0;
if ((yyvsp[-5].UIntVal) == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // function result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter
+ ParamAttrs->addAttributes(0, ParamAttr::None); // function result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter
}
FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs);
diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y
index dfc86c615d..1751912a2e 100644
--- a/tools/llvm-upgrade/UpgradeParser.y
+++ b/tools/llvm-upgrade/UpgradeParser.y
@@ -388,7 +388,7 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1,
PAL2 = *F2->getParamAttrs();
if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0))
return false;
- unsigned SRetMask = ~unsigned(StructRetAttribute);
+ unsigned SRetMask = ~unsigned(ParamAttr::StructRet);
for (unsigned i = 0; i < F1->getNumParams(); ++i) {
if (F1->getParamType(i) != F2->getParamType(i) ||
unsigned(PAL1.getParamAttrs(i+1)) & SRetMask !=
@@ -433,7 +433,7 @@ static Value* handleSRetFuncTypeMerge(Value *V, const Type* Ty) {
const FunctionType *FT2 = dyn_cast<FunctionType>(PF2->getElementType());
if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) {
const ParamAttrsList *PAL2 = FT2->getParamAttrs();
- if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute))
+ if (PAL2 && PAL2->paramHasAttr(1, ParamAttr::StructRet))
return V;
else if (Constant *C = dyn_cast<Constant>(V))
return ConstantExpr::getBitCast(C, PF1);
@@ -2904,8 +2904,8 @@ FunctionHeaderH
ParamAttrsList *ParamAttrs = 0;
if ($1 == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first arg
+ ParamAttrs->addAttributes(0, ParamAttr::None); // result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg
}
const FunctionType *FT =
@@ -3293,8 +3293,8 @@ BBTerminatorInst
ParamAttrsList *ParamAttrs = 0;
if ($2 == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // Function result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first param
+ ParamAttrs->addAttributes(0, ParamAttr::None); // Function result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param
}
bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
if (isVarArg) ParamTypes.pop_back();
@@ -3698,8 +3698,8 @@ InstVal
ParamAttrsList *ParamAttrs = 0;
if ($2 == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // function result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter
+ ParamAttrs->addAttributes(0, ParamAttr::None); // function result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter
}
FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs);
diff --git a/tools/llvm-upgrade/UpgradeParser.y.cvs b/tools/llvm-upgrade/UpgradeParser.y.cvs
index dfc86c615d..1751912a2e 100644
--- a/tools/llvm-upgrade/UpgradeParser.y.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.y.cvs
@@ -388,7 +388,7 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1,
PAL2 = *F2->getParamAttrs();
if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0))
return false;
- unsigned SRetMask = ~unsigned(StructRetAttribute);
+ unsigned SRetMask = ~unsigned(ParamAttr::StructRet);
for (unsigned i = 0; i < F1->getNumParams(); ++i) {
if (F1->getParamType(i) != F2->getParamType(i) ||
unsigned(PAL1.getParamAttrs(i+1)) & SRetMask !=
@@ -433,7 +433,7 @@ static Value* handleSRetFuncTypeMerge(Value *V, const Type* Ty) {
const FunctionType *FT2 = dyn_cast<FunctionType>(PF2->getElementType());
if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) {
const ParamAttrsList *PAL2 = FT2->getParamAttrs();
- if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute))
+ if (PAL2 && PAL2->paramHasAttr(1, ParamAttr::StructRet))
return V;
else if (Constant *C = dyn_cast<Constant>(V))
return ConstantExpr::getBitCast(C, PF1);
@@ -2904,8 +2904,8 @@ FunctionHeaderH
ParamAttrsList *ParamAttrs = 0;
if ($1 == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first arg
+ ParamAttrs->addAttributes(0, ParamAttr::None); // result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg
}
const FunctionType *FT =
@@ -3293,8 +3293,8 @@ BBTerminatorInst
ParamAttrsList *ParamAttrs = 0;
if ($2 == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // Function result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first param
+ ParamAttrs->addAttributes(0, ParamAttr::None); // Function result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param
}
bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
if (isVarArg) ParamTypes.pop_back();
@@ -3698,8 +3698,8 @@ InstVal
ParamAttrsList *ParamAttrs = 0;
if ($2 == OldCallingConv::CSRet) {
ParamAttrs = new ParamAttrsList();
- ParamAttrs->addAttributes(0, NoAttributeSet); // function result
- ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter
+ ParamAttrs->addAttributes(0, ParamAttr::None); // function result
+ ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter
}
FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs);