[llvm-commits] [llvm] r147583 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Devang Patel
dpatel at apple.com
Wed Jan 4 16:51:29 PST 2012
Author: dpatel
Date: Wed Jan 4 18:51:28 2012
New Revision: 147583
URL: http://llvm.org/viewvc/llvm-project?rev=147583&view=rev
Log:
Do not hard code asm variant number.
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=147583&r1=147582&r2=147583&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Wed Jan 4 18:51:28 2012
@@ -555,6 +555,9 @@
/// The AsmParser "RegisterPrefix" value.
std::string RegisterPrefix;
+ /// The AsmParser variant number.
+ int AsmVariantNo;
+
/// The classes which are needed for matching.
std::vector<ClassInfo*> Classes;
@@ -643,7 +646,8 @@
void MatchableInfo::Initialize(const AsmMatcherInfo &Info,
SmallPtrSet<Record*, 16> &SingletonRegisters) {
// TODO: Eventually support asmparser for Variant != 0.
- AsmString = CodeGenInstruction::FlattenAsmStringVariants(AsmString, 0);
+ AsmString =
+ CodeGenInstruction::FlattenAsmStringVariants(AsmString, Info.AsmVariantNo);
TokenizeAsmString(Info);
@@ -1105,7 +1109,8 @@
CodeGenTarget &target,
RecordKeeper &records)
: Records(records), AsmParser(asmParser), Target(target),
- RegisterPrefix(AsmParser->getValueAsString("RegisterPrefix")) {
+ RegisterPrefix(AsmParser->getValueAsString("RegisterPrefix")),
+ AsmVariantNo(AsmParser->getValueAsInt("Variant")) {
}
/// BuildOperandMatchInfo - Build the necessary information to handle user
More information about the llvm-commits
mailing list