summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-12 01:12:03 +0000
committerChris Lattner <sabre@nondot.org>2009-01-12 01:12:03 +0000
commita62c302ddd79c525d6fac050974911d36662ebfe (patch)
treeb892a6de9b6f64d5a5edbe35d3fec4e4850d29e8 /utils
parentc3443718540c6662f7502feb76849cf816baaa9f (diff)
downloadllvm-a62c302ddd79c525d6fac050974911d36662ebfe.tar.gz
llvm-a62c302ddd79c525d6fac050974911d36662ebfe.tar.bz2
llvm-a62c302ddd79c525d6fac050974911d36662ebfe.tar.xz
add nocapture attribute to llvm.mem* intrinsics and have tblgen
parse them. tblgen doesn't yet do anything with this info though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/CodeGenIntrinsics.h12
-rw-r--r--utils/TableGen/CodeGenTarget.cpp5
2 files changed, 12 insertions, 5 deletions
diff --git a/utils/TableGen/CodeGenIntrinsics.h b/utils/TableGen/CodeGenIntrinsics.h
index 1170da0f35..dd99e319d6 100644
--- a/utils/TableGen/CodeGenIntrinsics.h
+++ b/utils/TableGen/CodeGenIntrinsics.h
@@ -63,13 +63,17 @@ namespace llvm {
NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem
} ModRef;
- // This is set to true if the intrinsic is overloaded by its argument
- // types.
+ /// This is set to true if the intrinsic is overloaded by its argument
+ /// types.
bool isOverloaded;
- // isCommutative - True if the intrinsic is commutative.
- //
+ /// isCommutative - True if the intrinsic is commutative.
bool isCommutative;
+
+ enum ArgAttribute {
+ NoCapture
+ };
+ std::vector<std::pair<unsigned, ArgAttribute> > ArgumentAttributes;
CodeGenIntrinsic(Record *R);
};
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index 0039a89497..274cc78c35 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -546,7 +546,10 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
ModRef = WriteMem;
else if (Property->getName() == "Commutative")
isCommutative = true;
- else
+ else if (Property->isSubClassOf("NoCapture")) {
+ unsigned ArgNo = Property->getValueAsInt("ArgNo");
+ ArgumentAttributes.push_back(std::make_pair(ArgNo, NoCapture));
+ } else
assert(0 && "Unknown property!");
}
}