diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-04-11 02:44:20 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-04-11 02:44:20 +0000 |
commit | 18da0720887527ed570e9703ae5f290beb491ee1 (patch) | |
tree | 9a0a69b4dd6e5a5326680389f76724e0db1b98dd /lib | |
parent | 947aa7de67c553a0bbf0ef60173f23a8747014bf (diff) | |
download | llvm-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 'lib')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.cpp.cvs | 44 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 44 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y.cvs | 44 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 26 | ||||
-rw-r--r-- | lib/Linker/LinkItems.cpp | 16 | ||||
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 16 | ||||
-rw-r--r-- | lib/Target/MSIL/MSILWriter.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 22 | ||||
-rw-r--r-- | lib/VMCore/Function.cpp | 16 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 6 |
10 files changed, 123 insertions, 115 deletions
diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index f73f2ee5a4..f321782663 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -3337,27 +3337,27 @@ yyreduce: case 93: #line 1192 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ZExtAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 94: #line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = SExtAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 95: #line 1194 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = InRegAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 96: #line 1195 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = StructRetAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 97: #line 1198 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoAttributeSet; ;} + { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 98: @@ -3369,17 +3369,17 @@ yyreduce: case 99: #line 1204 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoReturnAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 100: #line 1205 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoUnwindAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 102: #line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoAttributeSet; ;} + { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 103: @@ -3522,7 +3522,7 @@ yyreduce: { std::vector<const Type*> Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); @@ -3530,7 +3530,7 @@ yyreduce: const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -3552,7 +3552,7 @@ yyreduce: { std::vector<const Type*> Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); unsigned index = 1; @@ -3560,7 +3560,7 @@ yyreduce: const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -3693,7 +3693,7 @@ yyreduce: #line 1431 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR @@ -3704,7 +3704,7 @@ yyreduce: #line 1438 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR @@ -4578,7 +4578,7 @@ yyreduce: struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR ;} @@ -4591,7 +4591,7 @@ yyreduce: struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR ;} @@ -4619,7 +4619,7 @@ yyreduce: std::vector<const Type*> ParamTypeList; ParamAttrsList ParamAttrs; - if ((yyvsp[-2].ParamAttrs) != NoAttributeSet) + if ((yyvsp[-2].ParamAttrs) != ParamAttr::None) ParamAttrs.addAttributes(0, (yyvsp[-2].ParamAttrs)); if ((yyvsp[-4].ArgList)) { // If there are arguments... unsigned index = 1; @@ -4629,7 +4629,7 @@ yyreduce: GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } } @@ -5075,7 +5075,7 @@ yyreduce: // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[-6].ParamAttrs) != NoAttributeSet) + if ((yyvsp[-6].ParamAttrs) != ParamAttr::None) ParamAttrs.addAttributes(0, (yyvsp[-6].ParamAttrs)); ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); unsigned index = 1; @@ -5084,7 +5084,7 @@ yyreduce: if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } @@ -5471,7 +5471,7 @@ yyreduce: // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) ParamAttrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); @@ -5480,7 +5480,7 @@ yyreduce: if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 92d06a75c5..ddf6fcec00 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -1189,24 +1189,24 @@ OptCallingConv : /*empty*/ { $$ = CallingConv::C; } | CHECK_FOR_ERROR }; -ParamAttr : ZEXT { $$ = ZExtAttribute; } - | SEXT { $$ = SExtAttribute; } - | INREG { $$ = InRegAttribute; } - | SRET { $$ = StructRetAttribute; } +ParamAttr : ZEXT { $$ = ParamAttr::ZExt; } + | SEXT { $$ = ParamAttr::SExt; } + | INREG { $$ = ParamAttr::InReg; } + | SRET { $$ = ParamAttr::StructRet; } ; -OptParamAttrs : /* empty */ { $$ = NoAttributeSet; } +OptParamAttrs : /* empty */ { $$ = ParamAttr::None; } | OptParamAttrs ParamAttr { $$ = $1 | $2; } ; -FuncAttr : NORETURN { $$ = NoReturnAttribute; } - | NOUNWIND { $$ = NoUnwindAttribute; } +FuncAttr : NORETURN { $$ = ParamAttr::NoReturn; } + | NOUNWIND { $$ = ParamAttr::NoUnwind; } | ParamAttr ; -OptFuncAttrs : /* empty */ { $$ = NoAttributeSet; } +OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; } | OptFuncAttrs FuncAttr { $$ = $1 | $2; } @@ -1298,7 +1298,7 @@ Types | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector<const Type*> Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); unsigned index = 1; TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); @@ -1306,7 +1306,7 @@ Types const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1324,7 +1324,7 @@ Types | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector<const Type*> Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); unsigned index = 1; @@ -1332,7 +1332,7 @@ Types const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1430,14 +1430,14 @@ ArgTypeListI : ArgTypeList | ArgTypeList ',' DOTDOTDOT { $$=$1; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR @@ -2100,7 +2100,7 @@ ArgList : ArgListH { struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2109,7 +2109,7 @@ ArgList : ArgListH { struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2131,7 +2131,7 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')' std::vector<const Type*> ParamTypeList; ParamAttrsList ParamAttrs; - if ($7 != NoAttributeSet) + if ($7 != ParamAttr::None) ParamAttrs.addAttributes(0, $7); if ($5) { // If there are arguments... unsigned index = 1; @@ -2141,7 +2141,7 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')' GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } } @@ -2486,7 +2486,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); ValueRefList::iterator I = $6->begin(), E = $6->end(); unsigned index = 1; @@ -2495,7 +2495,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } @@ -2792,7 +2792,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); unsigned index = 1; ValueRefList::iterator I = $6->begin(), E = $6->end(); @@ -2801,7 +2801,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs index 92d06a75c5..ddf6fcec00 100644 --- a/lib/AsmParser/llvmAsmParser.y.cvs +++ b/lib/AsmParser/llvmAsmParser.y.cvs @@ -1189,24 +1189,24 @@ OptCallingConv : /*empty*/ { $$ = CallingConv::C; } | CHECK_FOR_ERROR }; -ParamAttr : ZEXT { $$ = ZExtAttribute; } - | SEXT { $$ = SExtAttribute; } - | INREG { $$ = InRegAttribute; } - | SRET { $$ = StructRetAttribute; } +ParamAttr : ZEXT { $$ = ParamAttr::ZExt; } + | SEXT { $$ = ParamAttr::SExt; } + | INREG { $$ = ParamAttr::InReg; } + | SRET { $$ = ParamAttr::StructRet; } ; -OptParamAttrs : /* empty */ { $$ = NoAttributeSet; } +OptParamAttrs : /* empty */ { $$ = ParamAttr::None; } | OptParamAttrs ParamAttr { $$ = $1 | $2; } ; -FuncAttr : NORETURN { $$ = NoReturnAttribute; } - | NOUNWIND { $$ = NoUnwindAttribute; } +FuncAttr : NORETURN { $$ = ParamAttr::NoReturn; } + | NOUNWIND { $$ = ParamAttr::NoUnwind; } | ParamAttr ; -OptFuncAttrs : /* empty */ { $$ = NoAttributeSet; } +OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; } | OptFuncAttrs FuncAttr { $$ = $1 | $2; } @@ -1298,7 +1298,7 @@ Types | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector<const Type*> Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); unsigned index = 1; TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); @@ -1306,7 +1306,7 @@ Types const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1324,7 +1324,7 @@ Types | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector<const Type*> Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); unsigned index = 1; @@ -1332,7 +1332,7 @@ Types const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1430,14 +1430,14 @@ ArgTypeListI : ArgTypeList | ArgTypeList ',' DOTDOTDOT { $$=$1; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR @@ -2100,7 +2100,7 @@ ArgList : ArgListH { struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2109,7 +2109,7 @@ ArgList : ArgListH { struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2131,7 +2131,7 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')' std::vector<const Type*> ParamTypeList; ParamAttrsList ParamAttrs; - if ($7 != NoAttributeSet) + if ($7 != ParamAttr::None) ParamAttrs.addAttributes(0, $7); if ($5) { // If there are arguments... unsigned index = 1; @@ -2141,7 +2141,7 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')' GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } } @@ -2486,7 +2486,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); ValueRefList::iterator I = $6->begin(), E = $6->end(); unsigned index = 1; @@ -2495,7 +2495,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } @@ -2792,7 +2792,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); unsigned index = 1; ValueRefList::iterator I = $6->begin(), E = $6->end(); @@ -2801,7 +2801,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index cd194c96cf..9683d486ec 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -828,9 +828,9 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) { const FunctionType *FTy = I.getParent()->getParent()->getFunctionType(); const ParamAttrsList *Attrs = FTy->getParamAttrs(); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - if (Attrs && Attrs->paramHasAttr(0, SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt)) ExtendKind = ISD::SIGN_EXTEND; - if (Attrs && Attrs->paramHasAttr(0, ZExtAttribute)) + if (Attrs && Attrs->paramHasAttr(0, ParamAttr::ZExt)) ExtendKind = ISD::ZERO_EXTEND; RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp); } @@ -2768,16 +2768,16 @@ void SelectionDAGLowering::LowerCallTo(Instruction &I, Value *Arg = I.getOperand(i); SDOperand ArgNode = getValue(Arg); Entry.Node = ArgNode; Entry.Ty = Arg->getType(); - Entry.isSExt = Attrs && Attrs->paramHasAttr(i, SExtAttribute); - Entry.isZExt = Attrs && Attrs->paramHasAttr(i, ZExtAttribute); - Entry.isInReg = Attrs && Attrs->paramHasAttr(i, InRegAttribute); - Entry.isSRet = Attrs && Attrs->paramHasAttr(i, StructRetAttribute); + Entry.isSExt = Attrs && Attrs->paramHasAttr(i, ParamAttr::SExt); + Entry.isZExt = Attrs && Attrs->paramHasAttr(i, ParamAttr::ZExt); + Entry.isInReg = Attrs && Attrs->paramHasAttr(i, ParamAttr::InReg); + Entry.isSRet = Attrs && Attrs->paramHasAttr(i, ParamAttr::StructRet); Args.push_back(Entry); } std::pair<SDOperand,SDOperand> Result = TLI.LowerCallTo(getRoot(), I.getType(), - Attrs && Attrs->paramHasAttr(0, SExtAttribute), + Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), FTy->isVarArg(), CallingConv, IsTailCall, Callee, Args, DAG); if (I.getType() != Type::VoidTy) @@ -3617,13 +3617,13 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { // FIXME: Distinguish between a formal with no [sz]ext attribute from one // that is zero extended! - if (Attrs && Attrs->paramHasAttr(j, ZExtAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::ZExt)) Flags &= ~(ISD::ParamFlags::SExt); - if (Attrs && Attrs->paramHasAttr(j, SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::SExt)) Flags |= ISD::ParamFlags::SExt; - if (Attrs && Attrs->paramHasAttr(j, InRegAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::InReg)) Flags |= ISD::ParamFlags::InReg; - if (Attrs && Attrs->paramHasAttr(j, StructRetAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::StructRet)) Flags |= ISD::ParamFlags::StructReturn; Flags |= (OriginalAlignment << ISD::ParamFlags::OrigAlignmentOffs); @@ -3697,10 +3697,10 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { case Promote: { SDOperand Op(Result, i++); if (MVT::isInteger(VT)) { - if (Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt)) Op = DAG.getNode(ISD::AssertSext, Op.getValueType(), Op, DAG.getValueType(VT)); - else if (Attrs && Attrs->paramHasAttr(Idx, ZExtAttribute)) + else if (Attrs && Attrs->paramHasAttr(Idx, ParamAttr::ZExt)) Op = DAG.getNode(ISD::AssertZext, Op.getValueType(), Op, DAG.getValueType(VT)); Op = DAG.getNode(ISD::TRUNCATE, VT, Op); diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp index 6f9f9b2205..09af56c6a8 100644 --- a/lib/Linker/LinkItems.cpp +++ b/lib/Linker/LinkItems.cpp @@ -91,8 +91,12 @@ bool Linker::LinkInLibrary(const std::string& Lib, bool& is_native) { return error("Cannot link archive '" + Pathname.toString() + "'"); break; - case sys::ELF_FileType: - case sys::Mach_O_FileType: + case sys::ELF_Relocatable_FileType: + case sys::ELF_SharedObject_FileType: + case sys::Mach_O_Object_FileType: + case sys::Mach_O_FixedVirtualMemorySharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType: case sys::COFF_FileType: is_native = true; break; @@ -181,8 +185,12 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) { break; } - case sys::ELF_FileType: - case sys::Mach_O_FileType: + case sys::ELF_Relocatable_FileType: + case sys::ELF_SharedObject_FileType: + case sys::Mach_O_Object_FileType: + case sys::Mach_O_FixedVirtualMemorySharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType: case sys::COFF_FileType: is_native = true; break; diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index af502cea9d..f4852bf490 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -356,7 +356,7 @@ void CWriter::printStructReturnPointerFunctionType(std::ostream &Out, if (PrintedType) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ""); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt), ""); PrintedType = true; } if (FTy->isVarArg()) { @@ -368,7 +368,7 @@ void CWriter::printStructReturnPointerFunctionType(std::ostream &Out, FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, RetTy, - /*isSigned=*/Attrs && Attrs->paramHasAttr(0, SExtAttribute), tstr); + /*isSigned=*/Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), tstr); } std::ostream & @@ -430,7 +430,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty, if (I != FTy->param_begin()) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ""); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt), ""); ++Idx; } if (FTy->isVarArg()) { @@ -442,7 +442,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty, FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, FTy->getReturnType(), - /*isSigned=*/Attrs && Attrs->paramHasAttr(0, SExtAttribute), tstr); + /*isSigned=*/Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), tstr); return Out; } case Type::StructTyID: { @@ -1832,7 +1832,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { else ArgName = ""; printType(FunctionInnards, I->getType(), - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt), ArgName); PrintedArg = true; ++Idx; @@ -1853,7 +1853,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { for (; I != E; ++I) { if (PrintedArg) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt)); PrintedArg = true; ++Idx; } @@ -1881,7 +1881,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { // Print out the return type and the signature built above. printType(Out, RetTy, - /*isSigned=*/ Attrs && Attrs->paramHasAttr(0, SExtAttribute), + /*isSigned=*/ Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), FunctionInnards.str()); } @@ -2586,7 +2586,7 @@ void CWriter::visitCallInst(CallInst &I) { (*AI)->getType() != FTy->getParamType(ArgNo)) { Out << '('; printType(Out, FTy->getParamType(ArgNo), - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt)); Out << ')'; } writeOperand(*AI); diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp index 3aa05e4db8..610ab03365 100644 --- a/lib/Target/MSIL/MSILWriter.cpp +++ b/lib/Target/MSIL/MSILWriter.cpp @@ -1133,7 +1133,7 @@ void MSILWriter::printStaticInitializerList() { void MSILWriter::printFunction(const Function& F) { const FunctionType* FTy = F.getFunctionType(); const ParamAttrsList *Attrs = FTy->getParamAttrs(); - bool isSigned = Attrs && Attrs->paramHasAttr(0, SExtAttribute); + bool isSigned = Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt); Out << "\n.method static "; Out << (F.hasInternalLinkage() ? "private " : "public "); if (F.isVarArg()) Out << "vararg "; @@ -1144,7 +1144,7 @@ void MSILWriter::printFunction(const Function& F) { unsigned ArgIdx = 1; for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I!=E; ++I, ++ArgIdx) { - isSigned = Attrs && Attrs->paramHasAttr(ArgIdx, SExtAttribute); + isSigned = Attrs && Attrs->paramHasAttr(ArgIdx, ParamAttr::SExt); if (I!=F.arg_begin()) Out << ", "; Out << getTypeName(I->getType(),isSigned) << getValueName(I); } diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index ad6b7e3b30..f9bac802ff 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -291,7 +291,7 @@ static void calcTypeName(const Type *Ty, if (I != FTy->param_begin()) Result += ", "; calcTypeName(*I, TypeStack, TypeNames, Result); - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) { Result += + " "; Result += Attrs->getParamAttrsTextByIndex(Idx); } @@ -302,7 +302,7 @@ static void calcTypeName(const Type *Ty, Result += "..."; } Result += ")"; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) { Result += " "; Result += Attrs->getParamAttrsTextByIndex(0); } @@ -737,7 +737,7 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { if (I != FTy->param_begin()) Out << ", "; printType(*I); - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) { Out << " " << Attrs->getParamAttrsTextByIndex(Idx); } Idx++; @@ -747,7 +747,7 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { Out << "..."; } Out << ')'; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) Out << ' ' << Attrs->getParamAttrsTextByIndex(0); } else if (const StructType *STy = dyn_cast<StructType>(Ty)) { if (STy->isPacked()) @@ -974,7 +974,7 @@ void AssemblyWriter::printFunction(const Function *F) { // Insert commas as we go... the first arg doesn't get a comma if (I != F->arg_begin()) Out << ", "; printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx) - : uint16_t(NoAttributeSet))); + : uint16_t(ParamAttr::None))); Idx++; } @@ -984,7 +984,7 @@ void AssemblyWriter::printFunction(const Function *F) { Out << "..."; // Output varargs portion of signature! } Out << ')'; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) Out << ' ' << Attrs->getParamAttrsTextByIndex(0); if (F->hasSection()) Out << " section \"" << F->getSection() << '"'; @@ -1013,7 +1013,7 @@ void AssemblyWriter::printArgument(const Argument *Arg, uint16_t Attrs) { // Output type... printType(Arg->getType()); - if (Attrs != NoAttributeSet) + if (Attrs != ParamAttr::None) Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs); // Output name, if available... @@ -1188,11 +1188,11 @@ void AssemblyWriter::printInstruction(const Instruction &I) { if (op > 1) Out << ','; writeOperand(I.getOperand(op), true); - if (PAL && PAL->getParamAttrs(op) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(op) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(op); } Out << " )"; - if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(0) != ParamAttr::None) Out << ' ' << PAL->getParamAttrsTextByIndex(0); } else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) { const PointerType *PTy = cast<PointerType>(Operand->getType()); @@ -1228,12 +1228,12 @@ void AssemblyWriter::printInstruction(const Instruction &I) { if (op > 3) Out << ','; writeOperand(I.getOperand(op), true); - if (PAL && PAL->getParamAttrs(op-2) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(op-2) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(op-2); } Out << " )"; - if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(0) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(0); Out << "\n\t\t\tto"; writeOperand(II->getNormalDest(), true); diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index c6bf331ccb..e2a015fabb 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -81,24 +81,24 @@ ParamAttrsList::getParamAttrs(uint16_t Index) const { for (unsigned i = 0; i < limit; ++i) if (attrs[i].index == Index) return attrs[i].attrs; - return NoAttributeSet; + return ParamAttr::None; } std::string ParamAttrsList::getParamAttrsText(uint16_t Attrs) { std::string Result; - if (Attrs & ZExtAttribute) + if (Attrs & ParamAttr::ZExt) Result += "zext "; - if (Attrs & SExtAttribute) + if (Attrs & ParamAttr::SExt) Result += "sext "; - if (Attrs & NoReturnAttribute) + if (Attrs & ParamAttr::NoReturn) Result += "noreturn "; - if (Attrs & NoUnwindAttribute) + if (Attrs & ParamAttr::NoUnwind) Result += "nounwind "; - if (Attrs & InRegAttribute) + if (Attrs & ParamAttr::InReg) Result += "inreg "; - if (Attrs & StructRetAttribute) + if (Attrs & ParamAttr::StructRet) Result += "sret "; return Result; } @@ -125,7 +125,7 @@ ParamAttrsList::removeAttributes(uint16_t Index, uint16_t Attrs) { for (unsigned i = 0; i < attrs.size(); ++i) if (attrs[i].index == Index) { attrs[i].attrs &= ~Attrs; - if (attrs[i].attrs == NoAttributeSet) + if (attrs[i].attrs == ParamAttr::None) attrs.erase(&attrs[i]); return; } diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index ace800dfb2..10063126e5 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -285,7 +285,7 @@ static std::string getTypeDescription(const Type *Ty, E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) Result += ", "; - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) Result += Attrs->getParamAttrsTextByIndex(Idx); Idx++; Result += getTypeDescription(*I, TypeStack); @@ -295,7 +295,7 @@ static std::string getTypeDescription(const Type *Ty, Result += "..."; } Result += ")"; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) { Result += " " + Attrs->getParamAttrsTextByIndex(0); } break; @@ -1121,7 +1121,7 @@ FunctionType::~FunctionType() { bool FunctionType::isStructReturn() const { if (ParamAttrs) - return ParamAttrs->paramHasAttr(1, StructRetAttribute); + return ParamAttrs->paramHasAttr(1, ParamAttr::StructRet); return false; } |