summaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2012-01-09 19:13:28 +0000
committerDevang Patel <dpatel@apple.com>2012-01-09 19:13:28 +0000
commit0dbcadaa2fdf7038431931bab090f4467d8e308f (patch)
tree024843df5eaf406047696e818059528b48e25fed /utils/TableGen/CodeGenTarget.cpp
parent8bf295b1bf345dda7f3f5cd12b5c0dafea283e81 (diff)
downloadllvm-0dbcadaa2fdf7038431931bab090f4467d8e308f.tar.gz
llvm-0dbcadaa2fdf7038431931bab090f4467d8e308f.tar.bz2
llvm-0dbcadaa2fdf7038431931bab090f4467d8e308f.tar.xz
Split AsmParser into two components - AsmParser and AsmParserVariant
AsmParser holds info specific to target parser. AsmParserVariant holds info specific to asm variants supported by the target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--utils/TableGen/CodeGenTarget.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index cb9851841e..be3ea74958 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -150,6 +150,26 @@ Record *CodeGenTarget::getAsmParser() const {
return LI[AsmParserNum];
}
+/// getAsmParserVariant - Return the AssmblyParserVariant definition for
+/// this target.
+///
+Record *CodeGenTarget::getAsmParserVariant(unsigned i) const {
+ std::vector<Record*> LI =
+ TargetRec->getValueAsListOfDefs("AssemblyParserVariants");
+ if (i >= LI.size())
+ throw "Target does not have an AsmParserVariant #" + utostr(i) + "!";
+ return LI[i];
+}
+
+/// getAsmParserVariantCount - Return the AssmblyParserVariant definition
+/// available for this target.
+///
+unsigned CodeGenTarget::getAsmParserVariantCount() const {
+ std::vector<Record*> LI =
+ TargetRec->getValueAsListOfDefs("AssemblyParserVariants");
+ return LI.size();
+}
+
/// getAsmWriter - Return the AssemblyWriter definition for this target.
///
Record *CodeGenTarget::getAsmWriter() const {