From 1b0c54f1c5dd61e56cb7cbc435fcb3319cff628f Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 18 Jan 2013 21:53:16 +0000 Subject: Use AttributeSet accessor methods instead of Attribute accessor methods. Further encapsulation of the Attribute object. Don't allow direct access to the Attribute object as an aggregate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172853 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/AsmWriter.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/IR/AsmWriter.cpp') diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 1c46a9414a..ff43128a73 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -1557,9 +1557,8 @@ void AssemblyWriter::printFunction(const Function *F) { FunctionType *FT = F->getFunctionType(); const AttributeSet &Attrs = F->getAttributes(); - Attribute RetAttrs = Attrs.getRetAttributes(); - if (RetAttrs.hasAttributes()) - Out << Attrs.getRetAttributes().getAsString() << ' '; + if (Attrs.hasAttributes(AttributeSet::ReturnIndex)) + Out << Attrs.getAsString(AttributeSet::ReturnIndex) << ' '; TypePrinter.print(F->getReturnType(), Out); Out << ' '; WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent()); @@ -1849,8 +1848,8 @@ void AssemblyWriter::printInstruction(const Instruction &I) { Type *RetTy = FTy->getReturnType(); const AttributeSet &PAL = CI->getAttributes(); - if (PAL.getRetAttributes().hasAttributes()) - Out << ' ' << PAL.getRetAttributes().getAsString(); + if (PAL.hasAttributes(AttributeSet::ReturnIndex)) + Out << ' ' << PAL.getAsString(AttributeSet::ReturnIndex); // If possible, print out the short form of the call instruction. We can // only do this if the first argument is a pointer to a nonvararg function, @@ -1888,8 +1887,8 @@ void AssemblyWriter::printInstruction(const Instruction &I) { PrintCallingConv(II->getCallingConv(), Out); } - if (PAL.getRetAttributes().hasAttributes()) - Out << ' ' << PAL.getRetAttributes().getAsString(); + if (PAL.hasAttributes(AttributeSet::ReturnIndex)) + Out << ' ' << PAL.getAsString(AttributeSet::ReturnIndex); // If possible, print out the short form of the invoke instruction. We can // only do this if the first argument is a pointer to a nonvararg function, -- cgit v1.2.3