summaryrefslogtreecommitdiff
path: root/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-18 21:53:16 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-18 21:53:16 +0000
commit1b0c54f1c5dd61e56cb7cbc435fcb3319cff628f (patch)
treefc692786464bca45139569b988cd5ada7399dfc9 /lib/IR/AsmWriter.cpp
parent1a17bd21ff64968817dedb6cd2b7c809cee90804 (diff)
downloadllvm-1b0c54f1c5dd61e56cb7cbc435fcb3319cff628f.tar.gz
llvm-1b0c54f1c5dd61e56cb7cbc435fcb3319cff628f.tar.bz2
llvm-1b0c54f1c5dd61e56cb7cbc435fcb3319cff628f.tar.xz
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
Diffstat (limited to 'lib/IR/AsmWriter.cpp')
-rw-r--r--lib/IR/AsmWriter.cpp13
1 files changed, 6 insertions, 7 deletions
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,