llvm.org GIT mirror llvm / b7a19e9
Add a 'Returned' intrinsic property corresponding to the 'returned' argument attribute This will be used by the upcoming llvm.noalias intrinsic. Differential Revision: http://reviews.llvm.org/D22201 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275034 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 4 years ago
4 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5050
5151 // NoCapture - The specified argument pointer is not captured by the intrinsic.
5252 class NoCapture : IntrinsicProperty {
53 int ArgNo = argNo;
54 }
55
56 // Returned - The specified argument is always the return value of the
57 // intrinsic.
58 class Returned : IntrinsicProperty {
5359 int ArgNo = argNo;
5460 }
5561
107107 /// True if the intrinsic is marked as convergent.
108108 bool isConvergent;
109109
110 enum ArgAttribute { NoCapture, ReadOnly, WriteOnly, ReadNone };
110 enum ArgAttribute { NoCapture, Returned, ReadOnly, WriteOnly, ReadNone };
111111 std::vector> ArgumentAttributes;
112112
113113 CodeGenIntrinsic(Record *R);
591591 else if (Property->isSubClassOf("NoCapture")) {
592592 unsigned ArgNo = Property->getValueAsInt("ArgNo");
593593 ArgumentAttributes.push_back(std::make_pair(ArgNo, NoCapture));
594 } else if (Property->isSubClassOf("Returned")) {
595 unsigned ArgNo = Property->getValueAsInt("ArgNo");
596 ArgumentAttributes.push_back(std::make_pair(ArgNo, Returned));
594597 } else if (Property->isSubClassOf("ReadOnly")) {
595598 unsigned ArgNo = Property->getValueAsInt("ArgNo");
596599 ArgumentAttributes.push_back(std::make_pair(ArgNo, ReadOnly));
547547 OS << "Attribute::NoCapture";
548548 addComma = true;
549549 break;
550 case CodeGenIntrinsic::Returned:
551 if (addComma)
552 OS << ",";
553 OS << "Attribute::Returned";
554 addComma = true;
555 break;
550556 case CodeGenIntrinsic::ReadOnly:
551557 if (addComma)
552558 OS << ",";