[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Function.cpp Type.cpp
Reid Spencer
reid at x10sys.com
Tue Apr 10 19:44:58 PDT 2007
Changes in directory llvm/lib/VMCore:
AsmWriter.cpp updated: 1.267 -> 1.268
Function.cpp updated: 1.117 -> 1.118
Type.cpp updated: 1.181 -> 1.182
---
Log message:
For PR1146: http://llvm.org/PR1146 :
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.
---
Diffs of the changes: (+22 -22)
AsmWriter.cpp | 22 +++++++++++-----------
Function.cpp | 16 ++++++++--------
Type.cpp | 6 +++---
3 files changed, 22 insertions(+), 22 deletions(-)
Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.267 llvm/lib/VMCore/AsmWriter.cpp:1.268
--- llvm/lib/VMCore/AsmWriter.cpp:1.267 Mon Apr 9 01:10:42 2007
+++ llvm/lib/VMCore/AsmWriter.cpp Tue Apr 10 21:44:19 2007
@@ -291,7 +291,7 @@
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 @@
Result += "...";
}
Result += ")";
- if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) {
+ if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) {
Result += " ";
Result += Attrs->getParamAttrsTextByIndex(0);
}
@@ -737,7 +737,7 @@
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 @@
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 @@
// 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 @@
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 @@
// Output type...
printType(Arg->getType());
- if (Attrs != NoAttributeSet)
+ if (Attrs != ParamAttr::None)
Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs);
// Output name, if available...
@@ -1188,11 +1188,11 @@
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 @@
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);
Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.117 llvm/lib/VMCore/Function.cpp:1.118
--- llvm/lib/VMCore/Function.cpp:1.117 Mon Apr 9 10:01:12 2007
+++ llvm/lib/VMCore/Function.cpp Tue Apr 10 21:44:19 2007
@@ -81,24 +81,24 @@
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 @@
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;
}
Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.181 llvm/lib/VMCore/Type.cpp:1.182
--- llvm/lib/VMCore/Type.cpp:1.181 Mon Apr 9 12:20:18 2007
+++ llvm/lib/VMCore/Type.cpp Tue Apr 10 21:44:19 2007
@@ -285,7 +285,7 @@
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 @@
Result += "...";
}
Result += ")";
- if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) {
+ if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) {
Result += " " + Attrs->getParamAttrsTextByIndex(0);
}
break;
@@ -1121,7 +1121,7 @@
bool FunctionType::isStructReturn() const {
if (ParamAttrs)
- return ParamAttrs->paramHasAttr(1, StructRetAttribute);
+ return ParamAttrs->paramHasAttr(1, ParamAttr::StructRet);
return false;
}
More information about the llvm-commits
mailing list