History log of /external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
de2d8694e25a814696358e95141f4b1aa4d8847e 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r275480

Bug: http://b/31320715

This merges commit 7dcf7f03e005379ef2f06db96aa93f06186b66d5 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Iaf3738f74312d875e69f61d604ac058f381a2a1a
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f3ef5332fa3f4d5ec72c178a2b19dac363a19383 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r256229

http://b/26987366

Change-Id: I1f29c4676a8abe633ab5707dded58d846c973d50
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6948897e478cbd66626159776a8017b3c18579b9 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r239765

Bug: 20140355: This rebase pulls the upstream fix for the spurious
warnings mentioned in the bug.

Change-Id: I7fd24253c50f4d48d900875dcf43ce3f1721a3da
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4c5e43da7792f75567b693105cc53e3f1992ad98 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master llvm for rebase to r233350

Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ebe69fe11e48d322045d5949c83283927a0d790b 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r230699.

Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
37ed9c199ca639565f6ce88105f9e39e898d82d0 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r222494.

Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c6a4f5e819217e1e12c458aed8e7b122e23a3a58 21-Jul-2014 Stephen Hines <srhines@google.com> Update LLVM for rebase to r212749.

Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e3ba15c794839abe076e3e2bdf6c626396a19d4d 12-Oct-2013 Will Dietz <wdietz2@illinois.edu> Add missing #include's to cctype when using isdigit/alpha/etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8819c84aed10777ba91d4e862229882b8da0b272 01-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove several unused variables.

Patch by Alp Toker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
107cfa2169299fe67caebe7d1f0d405ce727e420 16-Sep-2013 Tim Northover <tnorthover@apple.com> TableGen: fix constness of new comparison function.

libc++ didn't seem to like a non-const call operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
03f9197d62dddfb70e70acb5563518f589d29251 16-Sep-2013 Tim Northover <tnorthover@apple.com> TableGen: give asm match classes deterministic order.

TableGen was sorting the entries in some of its internal data
structures by pointer. This order filtered through to the final
matching table and affected the diagnostics produced on bad assembly
occasionally.

It also turns out STL algorithms are ridiculously easy to misuse on
containers with custom order methods. (No bugs before, or now that I
know of, but plenty in the middle).

This should fix the sanitizer bot, which ends up with weird pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6dd670af758ee111593f81f355325e1b5960b870 16-Sep-2013 Tim Northover <tnorthover@apple.com> AsmMatcher: emit subtarget feature enum in deterministic order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
715d98d657491b3fb8ea0e14643e9801b2f9628c 12-Sep-2013 Joey Gouly <joey.gouly@arm.com> Add an instruction deprecation feature to TableGen.

The 'Deprecated' class allows you to specify a SubtargetFeature that the
instruction is deprecated on.

The 'ComplexDeprecationPredicate' class allows you to define a custom
predicate that is called to check for deprecation.
For example:
ComplexDeprecationPredicate<"MCR">

would mean you would have to define the following function:
bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
std::string &Info)

Which returns 'false' for not deprecated, and 'true' for deprecated
and store the warning message in 'Info'.

The MCTargetAsmParser constructor was chaned to take an extra argument of
the MCInstrInfo class, so out-of-tree targets will need to be changed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
aae60d1dc417dffb1b2486c8e7ca546cf3777901 29-Aug-2013 Craig Topper <craig.topper@gmail.com> Move StringToOffsetTable into the TableGen include directory so I can use it in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1f85736c97980507833f1933796bf600f7efde67 12-Aug-2013 Richard Sandiford <rsandifo@linux.vnet.ibm.com> Revert r188164: Stablize MCK_Reg ordering in AsmMatcherEmitter

Apparently caused a failure on Darwin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
dfb5ceae90c016ba4ca8a7f1a3b79c360d888f30 12-Aug-2013 Richard Sandiford <rsandifo@linux.vnet.ibm.com> Stablize MCK_Reg ordering in AsmMatcherEmitter

clang bootstraps intermittently failed for me due a difference in
the MCK_Reg ordering in ARMGenAsmMatcher.inc. E.g. in my latest
run the stage 1 and stage 3 versions were the same but the stage 2
one was different (though still functionally correct). This meant
that the .o comparison failed.

MCK_Regs were assigned by iterating over a std::set< std::set<Record*> >,
and since std::set is sorted lexicographically, the order depended on the
order of the pointer values. This patch replaces the pointer ordering
with LessRecordByID.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
47cfec02842f885b46ea0d3c812793e660691640 07-Aug-2013 Reid Kleckner <reid@kleckner.net> Remove some std stream usage from Support and TableGen

LLVM's coding standards recommend raw_ostream and MemoryBuffer for
reading and writing text.

This has the side effect of allowing clang to compile more of Support
and TableGen in the Microsoft C++ ABI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
588f408b95c83e9b59c0777925d2ae70ac445fae 01-Aug-2013 Vladimir Medic <Vladimir.Medic@imgtec.com> Moving definition of MnemonicContainsDot field from class Instruction to class AsmParser as suggested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f63ef914b67593e4b20a0b85e889380c20b41f55 24-Jul-2013 Craig Topper <craig.topper@gmail.com> Split generated asm mnemonic matching table into a separate table for each asm variant.

This removes the need to store the asm variant in each row of the single table that existed before. Shaves ~16K off the size of X86AsmParser.o.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9273151c3bbc96c9b2911caffe3e1a724261cd06 16-Jul-2013 Vladimir Medic <Vladimir.Medic@imgtec.com> This patch allows targets to define weather the instruction mnemonics in asm matcher tables will contain '.' character.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
54911a5303f44694c43608eedf2142e9d65d7c22 15-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Teaching llvm-tblgen to not emit a switch statement when there are no case statements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d999062f31b5e0a2f12d70a54ffdb02be8363657 27-Apr-2013 Ulrich Weigand <ulrich.weigand@de.ibm.com> Handle tied sub-operands in AsmMatcherEmitter

The problem this patch addresses is the handling of register tie
constraints in AsmMatcherEmitter, where one operand is tied to a
sub-operand of another operand. The typical scenario for this to
happen is the tie between the "write-back" register of a pre-inc
instruction, and the base register sub-operand of the memory address
operand of that instruction.

The current AsmMatcherEmitter code attempts to handle tied
operands by emitting the operand as usual first, and emitting
a CVT_Tied node when handling the second (tied) operand. However,
this really only works correctly if the tied operand does not
have sub-operands (and isn't a sub-operand itself). Under those
circumstances, a wrong MC operand list is generated.

In discussions with Jim Grosbach, it turned out that the MC operand
list really ought not to contain tied operands in the first place;
instead, it ought to consist of exactly those operands that are
named in the AsmString. However, getting there requires significant
rework of (some) targets.

This patch fixes the immediate problem, and at the same time makes
one (small) step in the direction of the long-term solution, by
implementing two changes:

1. Restricts the AsmMatcherEmitter handling of tied operands to
apply solely to simple operands (not complex operands or
sub-operand of such).

This means that at least we don't get silently corrupt MC operand
lists as output. However, if we do have tied sub-operands, they
would now no longer be handled at all, except for:

2. If we have an operand that does not occur in the AsmString,
and also isn't handled as tied operand, simply emit a dummy
MC operand (constant 0).

This works as long as target code never attempts to access
MC operands that do no not occur in the AsmString (and are
not tied simple operands), which happens to be the case for
all targets where this situation can occur (ARM and PowerPC).

[ Note that this change means that many of the ARM custom
converters are now superfluous, since the implement the
same "hack" now performed already by common code. ]

Longer term, we ought to fix targets to never access *any*
MC operand that does not occur in the AsmString (including
tied simple operands), and then finally completely remove
all such operands from the MC operand list.

Patch approved by Jim Grosbach.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
88eb89b89f9426feb7be9b19d1a664b37c590bdb 19-Apr-2013 Chad Rosier <mcrosier@apple.com> [asm parser] Add support for predicating MnemonicAlias based on the assembler
variant/dialect. Addresses a FIXME in the emitMnemonicAliases function.
Use and test case to come shortly.
rdar://13688439 and part of PR13340.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fa05def52c6bb8266d856a9af2de6fa066d93d44 06-Feb-2013 Jim Grosbach <grosbach@apple.com> Allow targets to add custom asm operand matching logic.

For example, ARM has several instructions with a literal '#0' immediate in the syntax
that's not represented as an actual operand. The asm matcher is expected a token
operand, but the parser will have created an immediate operand. This is currently
handled by dedicated per-instruction C++ munging of the ParsedAsmOperand list, but
will be better handled by this hook.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1c99a7f4892a24eb227802e042917d05d8cd415f 16-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Address the FIXME in AsmParser.cpp.

// FIXME: Constraints are hard coded to 'm', but we need an 'r'
// constraint for addressof. This needs to be cleaned up!

Test cases are already in place. Specifically,
clang/test/CodeGen/ms-inline-asm.c t15(), t16(), and t24().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
12da505d938ecfbc49b203e454bada99eda950e3 10-Jan-2013 Tim Northover <Tim.Northover@arm.com> Remove locale-dependence of enum mangling and use existing function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
88abcde3b47dcd9b64e8b0cd6558481d692609eb 10-Jan-2013 Tim Northover <Tim.Northover@arm.com> Make TableGen mangle operand method names before putting in enum.

The purpose of this patch is to allow PredicateMethods to be set to something
like "isUImm<8>", calling a C++ template method to reduce code duplication. For
this to work, the PredicateMethod must be mangled into a valid C++ identifier
for insertion into an enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4ffd89fa4d2788611187d1a534d2ed46adf1702c 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort the #include lines for utils/...

I've tried to find main moudle headers where possible, but the TableGen
stuff may warrant someone else looking at it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
61131ab15fd593a2e295d79fe2714e7bc21f2ec8 25-Oct-2012 Joerg Sonnenberger <joerg@bec.de> Remove exception handling usage from tblgen.

Most places can use PrintFatalError as the unwinding mechanism was not
used for anything other than printing the error. The single exception
was CodeGenDAGPatterns.cpp, where intermediate errors during type
resolution were ignored to simplify incremental platform development.
This use is replaced by an error flag in TreePattern and bailout earlier
in various places if it is set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6e006d3de882784527d4d9cc92b1a91f6773505e 13-Oct-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use the new API introduced in r165830 in lieu of the
MapAndConstraints vector. Also remove the unused Kind argument.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3f7b7f8ce0b050fc6a0100839d9c5a84198b2aed 10-Oct-2012 Sean Silva <silvas@purdue.edu> tblgen: Use semantically correct RTTI functions.

Also, some minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b 10-Oct-2012 Sean Silva <silvas@purdue.edu> tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.

Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>.
That will happen in a future patch.

There are also two dyn_cast_or_null<>'s slipped in instead of
dyn_cast<>'s, since they were causing crashes with just dyn_cast<>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9ba9d4d76bfa8de2b05cbce02a5a3ff7d46cb331 05-Oct-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a few typedefs to simplify future changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d494a3bfc5a4c9a335775669cfd6d804bc88d00a 04-Oct-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Default to the 'm' constraint. This matches the behavior of the
MSVC compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c69bb70deb5b596941bb1de180d1554f9a411062 02-Oct-2012 Chad Rosier <mcrosier@apple.com> Fix 80-column violations. Cleanup whitespace in generated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
22685876ed7231f32f7d1698c00acab22825b74c 02-Oct-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add the convertToMapAndConstraints() function that is used to
map constraints and MCInst operands to inline asm operands. This replaces the
getMCInstOperandNum() function.

The logic to determine the constraints are not in place, so we still default to
a register constraint (i.e., "r"). Also, we no longer build the MCInst but
rather return just the opcode to get the MCInstrDesc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2590c2e1e9e2f2a7f28672c10c2df55566238dfa 25-Sep-2012 Chad Rosier <mcrosier@apple.com> Rather then have a wrapper function, have tblgen instantiate the implementation.
Also remove an unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
00796a1b15a83247e19c2445a6ff7a31e72299a4 24-Sep-2012 Chad Rosier <mcrosier@apple.com> Rather then have a wrapper function, have tblgen instantiate the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d717a066c6ddaff401b9259579b265eeafb83b6e 22-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6018944afd2931a15829223d4e3862495cb4ec7c 21-Sep-2012 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b2df610b44902124c22f3661a39bffd5341da62d 19-Sep-2012 Sean Silva <silvas@purdue.edu> Iterate deterministicaly over ClassInfo*'s

Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
decfdf548b43c80c3dd81ff1cc3639b80ed33a3e 19-Sep-2012 Sean Silva <silvas@purdue.edu> Iterate deterministically over register classes

Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3a3644436695d835bb4e1e2a0c7f3cc82a2807c2 18-Sep-2012 Craig Topper <craig.topper@gmail.com> Make custom operand parsing mnemonic indices use the same mnemonic table as the match table. Reorder fields in OperandMatchEntry to provide the least amount of padding for in tree targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fee7f01d1e193266b9ca88ef6b5466d543e4cec4 18-Sep-2012 Craig Topper <craig.topper@gmail.com> Use variable type for index into mnemonic table. Shrinks size of index field on in tree targets. Saving static data space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b198f5c8979d46d75a08c1710a160f8e102b9ba8 18-Sep-2012 Craig Topper <craig.topper@gmail.com> Mark asm matcher conversion table as const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
be480ff607285157361a100e72ac5ed84ccce328 18-Sep-2012 Craig Topper <craig.topper@gmail.com> Fix typo in comment. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4e0ae44b3a1b5f7157351764fd125c7c85959797 15-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix Doxygen issues: wrap code examples in \code and use \p to refer to
parameters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a562dc7228990797a259f4fef4acb95a83b23e0d 12-Sep-2012 Jim Grosbach <grosbach@apple.com> TableGen: Convert an assert() to a proper diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5d637d7e93c1f6058c16b41b8ac7dd36c61b4a5c 05-Sep-2012 Chad Rosier <mcrosier@apple.com> Fix function name per coding standard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
90e11f8c95146c2d3718e9b3de71ee6628347b05 05-Sep-2012 Chad Rosier <mcrosier@apple.com> Fix function name per coding standard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2dc88d94c34294184368ef0d9663342be2d42811 03-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Make comment more verbose and add an assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2cc97def7434345e399e4f5f3f2001d6d7a93c6f 03-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Asm operands can map to one or more MCOperands. Therefore, add
the NumMCOperands argument to the GetMCInstOperandNum() function that is set
to the number of MCOperands this asm operand mapped to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
038f3e31276f8cc86d91d0e4513e1a3ddb8509ba 03-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add an interface to the GetMCInstOperandNum() function in the
MCTargetAsmParser class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ad2d3e637a3a9eb368e71a1672331ee5e7809fe8 03-Sep-2012 Chad Rosier <mcrosier@apple.com> Remove extraneous return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
87d910efc676d6d249dcfb054a9e3b8d97843bfc 03-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Return the MCOperandNum instead of passing a reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c4d2560a2010456f4eea0007eb71829d5668e7dd 03-Sep-2012 Chad Rosier <mcrosier@apple.com> Removed unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3a86e1396230748f17a521915bc802939a787eac 03-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Expose the Kind and Opcode variables from the
MatchInstructionImpl() function.

These values are used by the ConvertToMCInst() function to index into the
ConversionTable. The values are also needed to call the GetMCInstOperandNum()
function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
756d2cc2f7f6745603fdc0ec1ed4476d06385845 01-Sep-2012 Chad Rosier <mcrosier@apple.com> Remove an unused argument. The MCInst opcode is set in the ConvertToMCInst()
function nowadays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
359956dc1be35df4f8179eb14cea617c3ef10dd7 31-Aug-2012 Chad Rosier <mcrosier@apple.com> With the fix in r162954/162955 every cvt function returns true. Thus, have
the ConvertToMCInst() return void, rather then a bool. Update all the cvt
functions as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
389536cf4404b96b26b54d301044c75ed7003d19 30-Aug-2012 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
04508c6cb734ab1119a076f94b1c9fe8c4240b7d 30-Aug-2012 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0bad086d6dd2ee2d4ab8269ace959f7fb9cb3b9d 30-Aug-2012 Chad Rosier <mcrosier@apple.com> Hoist a check to eliminate obvious mismatches as early as possible. Also, fix
an 80-column violation in the generated code. No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
62316fa00a342bdb618e4c020c8e8606f541db92 30-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a new function, GetMCInstOperandNum, to the
AsmMatcherEmitter. This function maps inline assembly operands to MCInst
operands.

For example, '__asm mov j, eax' is represented by the follow MCInst:

<MCInst 1460 <MCOperand Reg:0> <MCOperand Imm:1> <MCOperand Reg:0>
<MCOperand Expr:(j)> <MCOperand Reg:0> <MCOperand Reg:43>>

The first 5 MCInst operands are a result of j matching as a memory operand
consisting of a BaseReg (Reg:0), MemScale (Imm:1), MemIndexReg(Reg:0),
Expr (Expr:(j), and a MemSegReg (Reg:0). The 6th MCInst operand represents
the eax register (Reg:43).

This translation is necessary to determine the Input and Output Exprs. If a
single asm operand maps to multiple MCInst operands, the index of the first
MCInst operand is returned. Ideally, it would return the operand we really
care out (i.e., the Expr:(j) in this case), but I haven't found an easy way
of doing this yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2b70dfaaebcc436c53b2c86cd8a9574baba47253 29-Aug-2012 Andrew Trick <atrick@apple.com> Fix a nondeterminism in the ARM assembler.

Adding arbitrary records to ARM.td would break
basic-arm-instructions.s because selection of nop vs mov r0,r0 was
ambiguous (this will be tested by a subsequent addition to ARM.td).
An imperfect but sensible fix is to give precedence to match rules
that have more constraints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
376a8a773e38fdcd9102a40e08ab1e0661d645d9 23-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Print out the location of expanded multiclass defs in TableGen errors.

When reporting an error for a defm, we would previously only report the
location of the outer defm, which is not always where the error is.

Now we also print the location of the expanded multiclass defs:

lib/Target/X86/X86InstrSSE.td:2902:12: error: foo
defm ADD : basic_sse12_fp_binop_s<0x58, "add", fadd, SSE_ALU_ITINS_S>,
^
lib/Target/X86/X86InstrSSE.td:2801:11: note: instantiated from multiclass
defm PD : sse12_fp_packed<opc, !strconcat(OpcodeStr, "pd"), OpNode, VR128,
^
lib/Target/X86/X86InstrSSE.td:194:5: note: instantiated from multiclass
def rm : PI<opc, MRMSrcMem, (outs RC:$dst), (ins RC:$src1, x86memop:$src2),
^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c8f267f66931c4358f11a2934e8b6234d9b7f0bd 22-Aug-2012 Jim Grosbach <grosbach@apple.com> TblGen: Make asm-matcher ConvertToMCInst() table driven.

No change in interface or functionality. Purely under-the-hood
details of the generated function that change.

The X86 assembly parser is reduced in size by over 15% and ARM by
over 10%.

No performance change by my measurements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4c1d2baa7c3303302fec9a15ebc4021bd5d45002 21-Aug-2012 Chad Rosier <mcrosier@apple.com> Formatting. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
72e9b6aeb48d9496bac9db8b02c88a618b464588 17-Aug-2012 Akira Hatanaka <ahatanaka@mips.com> Add stub methods for mips assembly matcher.

Patch by Vladimir Medic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
087642f8638b08bf236b2cf8f0feb4df34c568f4 04-Aug-2012 Bill Wendling <isanbard@gmail.com> Remove extraneous ';'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b885dc8d39fd5ffe4be01059ca6d8977374db02f 17-Jul-2012 Owen Anderson <resistor@mac.com> Defer checking for registers in the MC AsmMatcher until the after user-defined match classes have been checked. This allows the creation of MatchClass's that are supersets of a register class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
151d81d1e7c5d37fb7c234cadb2101d5f0150d69 12-Jul-2012 Jim Grosbach <grosbach@apple.com> TableGen: Assembly matcher 'insufficient operands' diagnostic.

Make sure the tblgen'erated asm matcher correctly returns numoperands+1
as the ErrorInfo when the problem was that there weren't enough operands
specified.

rdar://9142751

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ef970c10918dde1e84b8e14a28dc7cf0a93c7c95 27-Jun-2012 Jim Grosbach <grosbach@apple.com> TableGen: AsmMatcher diagnostics preference detail.

Don't override a custom diagnostic w/ a generic InvalidOperand, all else
being equal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4dbfdfba6c92b6224bf58364371569f5780844d3 23-Jun-2012 Jim Grosbach <grosbach@apple.com> TableGen: AsmMatcher support for better operand diagnostics.

"Invalid operand" may be a completely correct diagnostic, but it's often
insufficiently specific to really help identify and fix the problem in
assembly source. Allow a target to specify a more-specific diagnostic kind
for each AsmOperandClass derived definition and use that to provide
more detailed diagnostics when an operant of that class resulted in a
match failure.

rdar://8987109

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
325bd661ff57787efddc6b302230f22e9c187655 18-Jun-2012 Jim Grosbach <grosbach@apple.com> TableGen: AsmMatcher missing-features list minimization.

When returning a 'cannot match due to missing CPU features' error code,
if there are multiple potential matches with different feature sets,
return the smallest set of missing features from the alternatives as
that's most likely to be the one that's desired.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6f36fa981a59461466e12e5056ba209d289b81b1 11-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Write llvm-tblgen backends as functions instead of sub-classes.

The TableGenBackend base class doesn't do much, and will be removed
completely soon.

Patch by Sean Silva!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8e27c9615938298bd03a7884964a0f5e0e80542d 06-May-2012 Jim Grosbach <grosbach@apple.com> TableGen: AsmMatcher diagnostic when missing instruction mnemonic.

Previously, if an instruction definition was missing the mnemonic,
the next line would just assert(). Issue a real diagnostic instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f657da2e4896732f306a9e62261418112e7337ce 02-May-2012 Douglas Gregor <dgregor@apple.com> Move llvm-tblgen's StringMatcher into the TableGen library so it can
be used by clang-tblgen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8030e1a0df630ec6ed1cd5ec673f6472558a4dbe 25-Apr-2012 Craig Topper <craig.topper@gmail.com> Add ifdef around getSubtargetFeatureName in tablegen output file so that only targets that want the function get it. This prevents other targets from getting an unused function warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
14ce6fac242228dacc5c08040e544141a96880e5 25-Apr-2012 Jim Grosbach <grosbach@apple.com> ARM: improved assembler diagnostics for missing CPU features.

When an instruction match is found, but the subtarget features it
requires are not available (missing floating point unit, or thumb vs arm
mode, for example), issue a diagnostic that identifies what the feature
mismatch is.

rdar://11257547

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c1922c72adedadb414a3d19c3f150bfe1bc755a5 20-Apr-2012 Jim Grosbach <grosbach@apple.com> TableGen support for auto-generating assembly two-operand aliases.

Assembly matchers for instructions with a two-operand form. ARM is full
of these, for example:
add {Rd}, Rn, Rm // Rd is optional and is the same as Rn if omitted.

The property TwoOperandAliasConstraint on the instruction definition controls
when, and if, an alias will be formed. No explicit InstAlias definitions
are required.

rdar://11255754

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b423d18a00eed4968d6df7415449259b09b7d67e 19-Apr-2012 Jim Grosbach <grosbach@apple.com> Use a SmallVector instead of std::vector for ResOperands.

There's almost always a small number of instruction operands, so
use a SmallVector and save on heap allocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8caecdea56c830f3fc80ed67fff121c83de0e364 19-Apr-2012 Jim Grosbach <grosbach@apple.com> Update some internal naming conventions to modern style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d4824fc8aa1df5501600dd2a73c6da823f3b02db 19-Apr-2012 Jim Grosbach <grosbach@apple.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
67cd20d0396a68e61858736b7943dd352f1b0d0b 17-Apr-2012 Jim Grosbach <grosbach@apple.com> Sanity check error handling for TokenAlias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
65da6fc8af561e77620bd86b83be8ca50acfdd30 17-Apr-2012 Jim Grosbach <grosbach@apple.com> Tidy up. 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
11fc6467e6a7bbd39037ec488d1138c5518fd17e 11-Apr-2012 Jim Grosbach <grosbach@apple.com> Tidy up. Remove hard tab characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fab3f7ee6f2adca5037f597ce4f28c5acdcbd852 02-Apr-2012 Craig Topper <craig.topper@gmail.com> Reorder fields in MatchEntry and OperandMatchEntry to reduce padding. A bit tricky due to the target specific sizes for some of the fields so the ordering is only optimal for the targets in the tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7044cce1a30539e2ec779f49546d13d7db5a33df 15-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make MnemonicTable const again. That part of r152202 was OK.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
dd20af266c6c25932f54fac057cb4cdf4d479ec5 15-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't assume all mnemonics fit in 64k.

We currently assume that all targets have less than 64k opcodes. We
shouldn't limit it further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
bcfa982c4866fee5f86dca8c4bfc7425a9629f0d 15-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo."

We cannot limit the concatenated instruction names to 64K. ARM is
already at 32K, and it is easy to imagine a target with more
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
88d2fa438a5b9feb7da77e4beeaa00944ae4168e 08-Mar-2012 Craig Topper <craig.topper@gmail.com> Re-commit r152202 hopefully fixing the MSVC linker error.

Original commit message:
Use uint16_t to store InstrNameIndices in MCInstrInfo. Add asserts to protect all 16-bit string table offsets. Also make sure the string to offset table string is not larger than 65536 characters since larger string literals aren't portable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3c777947f4fdd94f061f8ac4a118a8db03da88a8 07-Mar-2012 Chad Rosier <mcrosier@apple.com> Revert r152202 as it's causing internal buildbot failures.

Original commit message:
Use uint16_t to store InstrNameIndices in MCInstrInfo. Add asserts to protect
all 16-bit string table offsets. Also make sure the string to offset table
string is not larger than 65536 characters since larger string literals aren't
portable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d3c9d9447ed7b5b8d3800b871ff162ae2df9fd5b 07-Mar-2012 Craig Topper <craig.topper@gmail.com> Use uint16_t to store InstrNameIndices in MCInstrInfo. Add asserts to protect all 16-bit string table offsets. Also make sure the string to offset table string is not larger than 65536 characters since larger string literals aren't portable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b08bb34a6f49c79e963aac52030c0cbeb0526f86 03-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Perform the string table optimization for OperandMatchEntries too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a4c5ecfb1bc0101c1b42a4d81bb427482b52cecf 03-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Shrink the asm matcher tables.

- Shrink the opcode field to 16 bits.
- Shrink the AsmVariantID field to 8 bits.
- Store the mnemonic string in a string table, store a 16 bit index.
- Store a pascal-style length byte in the string instead of a null terminator,
so we can avoid calling strlen on every entry we visit during mnemonic search.

Shrinks X86AsmParser.o from 434k to 201k on x86_64 and eliminates relocs from the table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
194f3fa9eadc7dfe9f1750c16e1c2a8ebe11c88c 01-Mar-2012 Jim Grosbach <grosbach@apple.com> Revert "Emit the SubRegTable with the smallest possible integer type."

This reverts commit 151760.

We want to move getSubReg() from TargetRegisterInfo into MCRegisterInfo,
but to do that, the type of the lookup table needs to be the same for
all targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b9ace0215d20e29a0e59de2917178ad5e308a835 29-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Emit the SubRegTable with the smallest possible integer type.

Doesn't help ARM with its massive register set, but halves the size on x86 and all other targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
655b8de7b2ab773a977e0c524307e71354d8af29 05-Feb-2012 Craig Topper <craig.topper@gmail.com> Convert assert(0) to llvm_unreachable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f35307ceac57194094f207f0920fbd22231f5331 24-Jan-2012 Jim Grosbach <grosbach@apple.com> Tidy up. Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
40bced0306e953c3d0fec19db4c4770b0e3c787e 17-Jan-2012 Devang Patel <dpatel@apple.com> Intel syntax: Ignore mnemonic aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
56315d319c104dc96187444e1e19711a1c801166 10-Jan-2012 Devang Patel <dpatel@apple.com> Record asm variant id in MatchEntry and check it while matching instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2bd335470f8939782f3df7f6180282d3825d4f09 10-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unnecessary default cases in switches that cover all enum values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d06b01c038e00f6af50a1b6d4c71389037e00212 09-Jan-2012 Devang Patel <dpatel@apple.com> Use descriptive variable name and remove incorrect operand number check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0dbcadaa2fdf7038431931bab090f4467d8e308f 09-Jan-2012 Devang Patel <dpatel@apple.com> 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
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
63faf82d0377f0a878d643ca2aacc02c35811b3e 07-Jan-2012 Devang Patel <dpatel@apple.com> Refactor.

Store AsmParser info locally. A small step towards emitting match entries for multiple asm variants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b78307fc58025713fd98c8414fa8f29720f37a76 07-Jan-2012 Devang Patel <dpatel@apple.com> Eliminate an error check that may not work with all asm syntax variants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
59f7ee0400f88809fde200e293bd5444a736a526 05-Jan-2012 Devang Patel <dpatel@apple.com> Do not hard code asm variant number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a66512e59142f36ae653460891c058d5e78e07e3 07-Dec-2011 Jim Grosbach <grosbach@apple.com> Extend AsmMatcher token literal matching to allow aliasing.

For example, ARM allows:
vmov.u32 s4, #0 -> vmov.i32, #0
'u32' is a more specific designator for the 32-bit integer type specifier
and is legal for any instruction which accepts 'i32' as a datatype suffix.

We want to say,
def : TokenAlias<".u32", ".i32">;

This works by marking the match class of 'From' as a subclass of the
match class of 'To'.

rdar://10435076



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3d5d8f6b768619ed65f79606d5c981c1e056c7e8 06-Dec-2011 Jim Grosbach <grosbach@apple.com> Tidy up. Fix naming convention stuff for some internal functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4a2242cea0e9fdb36276807b1d4ddd7cd1a15bd4 01-Dec-2011 Jim Grosbach <grosbach@apple.com> Replace an assert() with an actual diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
48c1f84b104fd32109d809a56f5ebbf461c0910c 29-Oct-2011 Jim Grosbach <grosbach@apple.com> Allow InstAlias's to use immediate matcher patterns that xform the value.

For example,

On ARM, "mov r3, #-3" is an alias for "mvn r3, #2", so we want to use a
matcher pattern that handles the bitwise negation when mapping to t2MVNi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
af482cf301cf35eebb3a67a3540e16b102b92246 17-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Pick low-hanging MatchEntry shrinkage fruit.

Shaves 200k off Release-Asserts clang binaries on i386.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6fea31e7300fe012b0b2984d6bc0338d02b054d3 04-Oct-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> TableGen: Privatize CodeGenRegisterClass::TheDef and Name.

When TableGen starts creating its own register classes, the synthesized
classes won't have a Record reference. All register classes must have a
name, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7c788888872233748da10a8177a9a1eb176c1bc8 01-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Move TableGen's parser and entry point into a library

This is the first step towards splitting LLVM and Clang's tblgen executables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
29f018cee616e4082e5005bc9adee4dc777e621c 30-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch to ArrayRef<CodeGenRegisterClass*>.

This makes it possible to allocate CodeGenRegisterClass instances
dynamically and reorder them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
578071a08734a4eb76484ba0a8d9f10b6e322184 16-Aug-2011 Jim Grosbach <grosbach@apple.com> Prefer diagnostics from target predicate in asm matcher.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
19cb7f491fbc7cb5d0bbd10e201f9d5093e6d4e5 16-Aug-2011 Jim Grosbach <grosbach@apple.com> MCTargetAsmParser target match predicate support.

Allow a target assembly parser to do context sensitive constraint checking
on a potential instruction match. This will be used, for example, to handle
Thumb2 IT block parsing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
47a24ab4d72dc0f78c2027327cb9a69d6de2bbcd 15-Aug-2011 Jim Grosbach <grosbach@apple.com> Move MatchResultTy enum into base class definition.

No need for it to be redefined as part of every derived target asm parser
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
05bce0beee87512e52428d4b80f5a8e79a949576 30-Jul-2011 David Greene <greened@obbligato.org> Unconstify Inits

Remove const qualifiers from Init references, per Chris' request.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f37dd02f7743ebd2424480361f5a7db510495c4f 29-Jul-2011 David Greene <greened@obbligato.org> [AVX] Constify Inits

Make references to Inits const everywhere. This is the final step
before making them unique.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
94b9550a32d189704a8eae55505edf62662c0534 26-Jul-2011 Evan Cheng <evan.cheng@apple.com> Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
893818347e9d7b34ea99ae9c984934c9b6bf92da 15-Jul-2011 Kevin Enderby <enderby@apple.com> Have tblgen produce code that tolerates operands that return an invalid match class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d568b3f55294917d1cc701da14a8a7daeb6563e6 12-Jul-2011 Eric Christopher <echristo@apple.com> Revert r134921, 134917, 134908 and 134907. They're causing failures
in multiple buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d4a9066c93da9a5aab47ca228d82e796fdec70c0 11-Jul-2011 David Greene <greened@obbligato.org> [AVX] Make Inits Foldable

Manage Inits in a FoldingSet. This provides several benefits:

- Memory for Inits is properly managed

- Duplicate Inits are folded into Flyweights, saving memory

- It enforces const-correctness, protecting against certain classes
of bugs

The above benefits allow Inits to be used in more contexts, which in
turn provides more dynamism to TableGen. This enhanced capability
will be used by the AVX code generator to a fold common patterns
together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6043548bfea3939534948969763a2b13c448f068 08-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Fix dangling pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fbc38d2c16bc2fb923efdbbd6035ec8233fb4856 08-Jul-2011 Evan Cheng <evan.cheng@apple.com> Fix a dangling reference. Patch by Dave Abrahams. pr10311

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ebdeeab812beec0385b445f3d4c41a114e0d972f 08-Jul-2011 Evan Cheng <evan.cheng@apple.com> Eliminate asm parser's dependency on TargetMachine:
- Each target asm parser now creates its own MCSubtatgetInfo (if needed).
- Changed AssemblerPredicate to take subtarget features which tablegen uses
to generate asm matcher subtarget feature queries. e.g.
"ModeThumb,FeatureThumb2" is translated to
"(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
bea6f615eefae279e53bbb63a31d2c3c67274c45 27-Jun-2011 Owen Anderson <resistor@mac.com> Add support for alternative register names, useful for instructions whose operands are logically equivalent to existing registers, but happen to be printed specially. For example, an instruciton that prints d0[0] instead of s0.
Patch by Jim Grosbach.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0b6a44afb92fed0365b6709c1f46b0c5e49e1a72 22-Jun-2011 Jim Grosbach <grosbach@apple.com> Consolidate some TableGen diagnostic helper functions.

TableGen had diagnostic printers sprinkled about in a few places. Pull them
together into a single location in Error.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
abdbc84b4ed4276ed3def50f554e3ba156325717 18-Jun-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Store CodeGenRegisters as pointers so they won't be reallocated.

Reuse the CodeGenRegBank DenseMap in a few places that would build their
own or use linear search.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ae1920b1efa72c1789d562df4746110d0c2e10bd 15-Jun-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Give CodeGenRegisterClass a real sorted member set.

Make the Elements vector private and expose an ArrayRef through
getOrder() instead. getOrder will eventually provide multiple
user-specified allocation orders.

Use the sorted member set for member and subclass tests. Clean up a lot
of ad hoc searches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b9d5af05fdc0867ed772c4bbfe3f3acc9fb3d628 03-May-2011 Jim Grosbach <grosbach@apple.com> Tidy up. Add missing newline to generated file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7a2bdde0a0eebcd2125055e0eacaca040f0b766c 15-Apr-2011 Chris Lattner <sabre@nondot.org> Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
27b83d4ff2264d9a0e2367d92543efe4c0148931 01-Apr-2011 Daniel Dunbar <daniel@zuster.org> tlbgen/MC: StringRef's to temporary objects considered harmful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6ef6ceda6883d0ee543d8da86d16b0fcdcecab96 18-Feb-2011 Joerg Sonnenberger <joerg@bec.de> Check that MnemonicAlias doesn't map back to the same string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f922c47143d247cbae14b294a0bada139bcd35f6 12-Feb-2011 Jim Grosbach <grosbach@apple.com> AsmMatcher custom operand parser failure enhancements.

Teach the AsmMatcher handling to distinguish between an error custom-parsing
an operand and a failure to match. The former should propogate the error
upwards, while the latter should continue attempting to parse with
alternative matchers.

Update the ARM asm parser accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
84cb033bf30b6f93ae2fbea71513970147e08dc2 11-Feb-2011 Jim Grosbach <grosbach@apple.com> Tidy out asm matcher .inc output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b45c7c270c2845b8ad3322ef44a1ce2032ed0113 10-Feb-2011 Bill Wendling <isanbard@gmail.com> Don't return before calling the post-processing function(s).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b9db0c50d84b06b4b567c29375b7db92b5dab077 10-Feb-2011 Jim Grosbach <grosbach@apple.com> Do AsmMatcher operand classification per-opcode.

When matching operands for a candidate opcode match in the auto-generated
AsmMatcher, check each operand against the expected operand match class.
Previously, operands were classified independently of the opcode being
handled, which led to difficulties when operand match classes were
more complicated than simple subclass relationships.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e7a54520b3435c006c4f97c56fe970350981ea3c 07-Feb-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Implement support for custom target specific asm parsing of operands.
Motivation: Improve the parsing of not usual (different from registers or
immediates) operand forms.

This commit implements only the generic support. The ARM specific modifications
will come next.

A table like the one below is autogenerated for every instruction
containing a 'ParserMethod' in its AsmOperandClass

static const OperandMatchEntry OperandMatchTable[20] = {
/* Mnemonic, Operand List Mask, Operand Class, Features */
{ "cdp", 29 /* 0, 2, 3, 4 */, MCK_Coproc, Feature_IsThumb|Feature_HasV6 },
{ "cdp", 58 /* 1, 3, 4, 5 */, MCK_Coproc, Feature_IsARM },

A matcher function very similar (but lot more naive) to
MatchInstructionImpl scans the table. After the mnemonic match, the
features are checked and if the "to be parsed" operand index is
present in the mask, there's a real match. Then, a switch like the one
below dispatch the parsing to the custom method provided in
'ParseMethod':

case MCK_Coproc:
return TryParseCoprocessorOperandName(Operands);




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5c228a945fe3e25a12d0f7e2e9b26b548d6f29f5 05-Feb-2011 Daniel Dunbar <daniel@zuster.org> MC/AsmMatcher: Sink ConvertToMCInst into the TargetAsmParser instance, which
implicitly allows custom conversions to be member functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b412915ff6229b3e2dffedcfb0f3fb7e85259841 04-Feb-2011 Daniel Dunbar <daniel@zuster.org> MC/AsmParser: Add support for allowing the conversion process to fail (via
custom conversion functions).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
cf12067ae08dc7911c860070eaf2830dc1dc4ff7 04-Feb-2011 Daniel Dunbar <daniel@zuster.org> MC/AsmMatcher: Add support for custom conversion functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
79fcb6dec3e6e30a30835ebc781e5abc275e12e9 02-Feb-2011 Kevin Enderby <enderby@apple.com> Changed the TableGen created MatchInstructionImpl() setting of ErrorInfo.

The algorithm for identifying which operand is invalid will now always point to
some operand and not the mnemonic sometimes. The change is now that ErrorInfo
is the index of the highest operand that does not match for any of the matching
mnemonics records. And no longer the ~0U value when the mnemonic matches and
not every record with a matching mnemonic has the same mismatching operand
index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1fe3aa15e9cdc4981d7a125d87eaf257c1d75af1 26-Jan-2011 Bob Wilson <bob.wilson@apple.com> Add a MnemonicIsValid method to the asm matcher.
Patch by Bill Wendling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1f64ac403549413b7d5c735d8530257f8661943b 26-Jan-2011 Bob Wilson <bob.wilson@apple.com> Fix spelling of CouldMatchAmbiguouslyWith method name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
828295bb301d6cd3683751c2da1c2dd22ec6423f 26-Jan-2011 Bob Wilson <bob.wilson@apple.com> Whitespace and 80-column fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a49c7dfb360154070c08b8eb94ad31711d1babae 26-Jan-2011 Bob Wilson <bob.wilson@apple.com> Improve the AsmMatcher's ability to handle suboperands.

When an operand class is defined with MIOperandInfo set to a list of
suboperands, the AsmMatcher has so far required that operand to also define
a custom ParserMatchClass, and InstAlias patterns have not been able to
set the individual suboperands separately. This patch removes both of those
restrictions. If a "compound" operand does not override the default
ParserMatchClass, then the AsmMatcher will now parse its suboperands
separately. If an InstAlias operand has the same class as the corresponding
compound operand, then it will be handled as before; but if that check fails,
TableGen will now try to match up a sequence of InstAlias operands with the
corresponding suboperands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c0a7007d3a6a7bb31eec568b9dfdb8fb137702e5 25-Jan-2011 Daniel Dunbar <daniel@zuster.org> tblgen/AsmMatcherEmitter: Fix alias handling to honor -match-prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0ef755d9051a79680326d6144a2401660fc93e57 22-Jan-2011 Bill Wendling <isanbard@gmail.com> ARM uses '.' in their tokens. Give it a name instead of a numeric value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
906bc368bc0fe18682edc0743ada41f62e436383 20-Jan-2011 Bob Wilson <bob.wilson@apple.com> Tidy comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5e8f2a65ca2044815039129610876dfc4de3ebfa 20-Jan-2011 Bob Wilson <bob.wilson@apple.com> Precompute InstAlias operand mapping to result instruction operand indices.

There should be no functional change from this, but I think it's simpler this
way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6cd0b17ba7f7efae41966c4a36ee725523d38575 19-Jan-2011 Owen Anderson <resistor@mac.com> When matching asm operands, always try to match the most restricted type first.
Unfortunately, while this is the "right" thing to do, it breaks some ARM
asm parsing tests because MemMode5 and ThumbMemModeReg are ambiguous. This
is tricky to resolve since neither is a subset of the other.

XFAIL the test for now. The old way was broken in other ways, just ways
we didn't happen to be testing, and our ARM asm parsing is going to require
significant revisiting at a later point anyways.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
55b5e85643b189636758188f11b598c45178407f 18-Jan-2011 Daniel Dunbar <daniel@zuster.org> Formatting tweak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
dc1a2bd3aa199693413f39dd723cc14a77e9f131 14-Jan-2011 Bob Wilson <bob.wilson@apple.com> Fix some tablegen issues to allow using zero_reg for InstAlias definitions.

This is needed to allow an InstAlias for an instruction with an "OptionalDef"
result register (like ARM's cc_out) where you want to set the optional register
to reg0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
083203dde8bd50e1be47ac6509ae52f43abcd12a 10-Jan-2011 Daniel Dunbar <daniel@zuster.org> MC/AsmMatcher: Fix indirect 80-col viola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9c6b60eb28d2717008f8d6ff52f7666ebc81113d 15-Dec-2010 Chris Lattner <sabre@nondot.org> various cleanups to tblgen, patch by Garrison Venn!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
67db883487fca3472fdde51e931657e22d4d0495 13-Dec-2010 Chris Lattner <sabre@nondot.org> eliminate the Records global variable, patch by Garrison Venn!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
bd9c77bc9ad384d046a7967d160ad96f61916d9d 19-Nov-2010 Bill Wendling <isanbard@gmail.com> Give the exclamation point a name instead of a number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7ad3147f98eb4e84c24629e88a7d8bb1e04df3d4 06-Nov-2010 Chris Lattner <sabre@nondot.org> pass literals like $$1 through to the asm matcher. This isn't right yet, but doesn't hurt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
90fd797dc739319347861d4f3984bc8952ae9a29 06-Nov-2010 Chris Lattner <sabre@nondot.org> add (and document) the ability for alias results to have
fixed physical registers. Start moving fp comparison
aliases to the .td file (which default to using %st1 if
nothing is specified).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
98c870f87b7f0c996a9ba67003d88d434d6dbcd0 06-Nov-2010 Chris Lattner <sabre@nondot.org> generalize alias support to allow the result of an alias to
add fixed immediate values. Move the aad and aam aliases to
use this, and document it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5bde7345980587284bda6d42a68cdb151fbf5d6b 06-Nov-2010 Chris Lattner <sabre@nondot.org> fix a bug where we had an implicit assumption that the
result instruction operand numbering matched the result pattern.

Fixing this allows us to move the xchg/test aliases to the .td file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
414098571b19fc248fda2be194082cfd012d2729 06-Nov-2010 Chris Lattner <sabre@nondot.org> fix some bugs in the alias support, unblocking changing of "clr" aliases
from c++ hacks to proper .td InstAlias definitions. Change them!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
662e5a30e864e71111b885d3da3cdd184772035d 06-Nov-2010 Chris Lattner <sabre@nondot.org> Reimplement BuildResultOperands to be in terms of the result instruction's
operand list instead of the operand list redundantly declared on the alias
or instruction.

With this change, we finally remove the ins/outs list on the alias. Before:
def : InstAlias<(outs GR16:$dst), (ins GR8 :$src),
"movsx $src, $dst",
(MOVSX16rr8W GR16:$dst, GR8:$src)>;
After:
def : InstAlias<"movsx $src, $dst",
(MOVSX16rr8W GR16:$dst, GR8:$src)>;

This also makes the alias mechanism more general and powerful, which will
be exploited in subsequent patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3f2c8e474b8775aa1f3c2c0cb817b7f9f564e068 06-Nov-2010 Chris Lattner <sabre@nondot.org> implement more checking to reject things like:
(someinst GR16:$foo, GR32:$foo)

Reimplement BuildAliasOperandReference to be correctly
based on the names of operands in the result pattern,
instead of on the instruction operand definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9cdf42858960b9903587c39d5341cf63b3e665db 06-Nov-2010 Chris Lattner <sabre@nondot.org> simplify


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5abd1ebcb380664ae5010395b217e01f7190046c 06-Nov-2010 Chris Lattner <sabre@nondot.org> fix another fixme, replacing a string with a semantic pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
225549f775db61c5dba10e14758f4b43c53ef593 06-Nov-2010 Chris Lattner <sabre@nondot.org> disolve a hack, having CodeGenInstAlias decode the alias in the .td
file instead of the asmmatcher.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c07bd40a649991d46c95cf6afe2c4ada4ac49f13 04-Nov-2010 Chris Lattner <sabre@nondot.org> partition operand processing between aliases and instructions.
Right now the code is partitioned but the behavior is the same.
This should be improved in the near future. This removes some
uses of TheOperandList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5f4280cd2d2d1aeb527c8b161acaa1870cf6ee82 04-Nov-2010 Chris Lattner <sabre@nondot.org> pull name slicing out of BuildInstructionOperandReference so
it doesn't do any lexical stuff anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ba3b5b638287e374d0c98fc5efdf866a3cee33b6 04-Nov-2010 Chris Lattner <sabre@nondot.org> cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
567820c1e0454935ca5415ed419da63b84684cb7 04-Nov-2010 Chris Lattner <sabre@nondot.org> replace SrcOpNum with SrcOpName, eliminating a numering dependency
on the incoming operand list. This also makes the code simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0bb780c0e0cea50e6076fcb44c08caa50b7ecba7 04-Nov-2010 Chris Lattner <sabre@nondot.org> strength reduce some code, resolving a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1d13bda737bad3e0cea28cbd65a221ab27abdb9b 04-Nov-2010 Chris Lattner <sabre@nondot.org> take a big step to making aliases more general and less of a hack:
now matchables contain an explicit list of how to populate each
operand in the result instruction instead of having them somehow
magically be correlated to the input inst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c0b14a250b61beb78d75d10c3124bbfd5355905c 03-Nov-2010 Chris Lattner <sabre@nondot.org> rename Operand -> AsmOperand for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a1ca91af4e01b413cd1d1b3fa9d8d24fa99d9293 03-Nov-2010 Chris Lattner <sabre@nondot.org> Completely reject instructions that have an operand in their
ins/outs list that isn't specified by their asmstring. Previously
the asmmatcher would just force a 0 register into it, which clearly
isn't right. Mark a bunch of ARM instructions that use this as
isCodeGenOnly. Some of them are clearly pseudo instructions (like
t2TBB) others use a weird hasExtraSrcRegAllocReq thing that will
either need to be removed or the asmmatcher will need to be taught
about it (someday).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d51257a4368d52e2340073bc7ccd83f3c3f1c04d 03-Nov-2010 Chris Lattner <sabre@nondot.org> make MatchableInfo::Validate reject instructions (like LDR_PRE in ARM)
that have complicated tying going on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9b0d4bfca0f23d39f5f2aef6b6740267a26ee17c 02-Nov-2010 Chris Lattner <sabre@nondot.org> rewrite EmitConvertToMCInst to iterate over the MCInst operands,
filling them in one at a time. Previously this iterated over the
asmoperands, which left the problem of "holes". The new approach
simplifies things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
dda855de8b3c60bce5d1d0d9eb11470c9710e30f 02-Nov-2010 Chris Lattner <sabre@nondot.org> merge two large parallel loops in EmitConvertToMCInst, no change
in the generated .inc files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ec6f096c36f4144ff9b3b24c2939720cdcbb7bcc 02-Nov-2010 Chris Lattner <sabre@nondot.org> a bunch of random cleanup, move a helper to CGT where it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3b5aec67ef174c74ff6620ddd71ad3b0cb39030c 02-Nov-2010 Chris Lattner <sabre@nondot.org> add and update comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d19ec05e0785152e7a520ffd4a88da4459a380aa 02-Nov-2010 Chris Lattner <sabre@nondot.org> refactor/cleanup MatchableInfo by eliminating the Tokens array,
merging it into a Token field in Operand, and moving the first
token to an explicit mnemonic field. These were parallel
arrays before (except for the mnemonic) which kept confusing me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3116fef7b970eb7dbc2aa7daa9ea01e96c401bbf 02-Nov-2010 Chris Lattner <sabre@nondot.org> rename operands -> asmoperands to be more descriptive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e66b7ebfb426c7ed9bc911e9708321e2d8510b41 02-Nov-2010 Chris Lattner <sabre@nondot.org> fix computation of ambiguous instructions to not ignore the mnemonic.
FWIW, X86 has 254 ambiguous instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4c9f4e4002bfdb059684a8dafef8993a5ec27a23 02-Nov-2010 Chris Lattner <sabre@nondot.org> give MatchableInfo::Operand a constructor


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b501d4f673c0db267a76800339f9943f2ce6fe33 01-Nov-2010 Chris Lattner <sabre@nondot.org> Implement enough of the missing instalias support to get
aliases installed and working. They now work when the
matched pattern and the result instruction have exactly
the same operand list.

This is now enough for us to define proper aliases for
movzx and movsx, implementing rdar://8017633 and PR7459.

Note that we do not accept instructions like:
movzx 0(%rsp), %rsi

GAS accepts this instruction, but it doesn't make any
sense because we don't know the size of the memory
operand. It could be 8/16/32 bits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
22bc5c4184a497353e33195dd12541a4f08b008a 01-Nov-2010 Chris Lattner <sabre@nondot.org> rename InstructionInfo -> MatchableInfo since it now
represents InstAliases as well. Rename
isAssemblerInstruction -> Validate since that is what
it does (modulo the ARM $lane hack).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c2d67bbf806486984d4c9551abfd66c7f766c45b 01-Nov-2010 Chris Lattner <sabre@nondot.org> refactor initialization of InstructionInfo to be sharable between
instructions and InstAliases. Start creating InstructionInfo's
for Aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4164f6bbbf4ebce676e8a6c0a0cf7a78ef46a0f3 01-Nov-2010 Chris Lattner <sabre@nondot.org> make the asm matcher emitter reject instructions that have comments
in their asmstring. Fix the two x86 "NOREX" instructions that have them.
If these comments are important, the instlowering stuff can print them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5bc93878069b7d9c567c8a04ebfa329636822c5e 01-Nov-2010 Chris Lattner <sabre@nondot.org> refactor InstructionInfo to not have a pointer to CodeGenInstruction
member, and make isAssemblerInstruction() a method (pushing some code
around inside it).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c76e80ded753b78a72be0db40fcdba543435d818 01-Nov-2010 Chris Lattner <sabre@nondot.org> define a new CodeGenInstAlias. It has an asmstring and operand list for now,
todo: the result field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c240bb0ede0541426254d0e0dc81d891beda4b22 01-Nov-2010 Chris Lattner <sabre@nondot.org> factor the operand list (and related fields/operations) out of
CodeGenInstruction into its own helper class. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
79b3cddfa2eeb9ed7f93daf8e4f3c3d87779c3ab 01-Nov-2010 Chris Lattner <sabre@nondot.org> avoid needless throw/catch/rethrow, stringref'ize some simple stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f78081145695baa5d0b004e674c4561245b13b52 01-Nov-2010 Chris Lattner <sabre@nondot.org> eliminate the old InstFormatName which is always "AsmString",
simplify CodeGenInstruction. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4a74ee7203d119232d9c6df33946c01611e433f8 01-Nov-2010 Chris Lattner <sabre@nondot.org> all predicates on an MnemonicAlias must be AssemblerPredicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1de88235781c45c0afc0c7500d65b59775196c4c 01-Nov-2010 Chris Lattner <sabre@nondot.org> change the singleton register handling code to be based on Record*'s
instead of strings, simplifying it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
02bcbc97fbf55803c660729aa9d2c154a2101331 01-Nov-2010 Chris Lattner <sabre@nondot.org> Give AsmMatcherInfo a CodeGenTarget, which simplifies a bunch of
argument passing. Consolidate all SingletonRegister detection
and handling into a new
InstructionInfo::getSingletonRegisterForToken method instead of
having it scattered about. No change in generated .inc files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4d43d0fd996a01c2cd21fd51082bc1bba783ef3c 01-Nov-2010 Chris Lattner <sabre@nondot.org> move FlattenVariants out of AsmMatcherEmitter into a shared
CodeGenInstruction::FlattenAsmStringVariants method. Use it
to simplify the code in AsmWriterInst, which now no longer
needs to worry about variants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
52de0ef9220e321224fe092f82303bc027e8f418 01-Nov-2010 Chris Lattner <sabre@nondot.org> add a FIXME, $lane in ARM is an issue that needs to be resolved before
this can start rejecting instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4d1189f3857c627a5e771207e486b00cb22c36be 01-Nov-2010 Chris Lattner <sabre@nondot.org> reject instructions that contain a \n in their asmstring. Mark
various X86 and ARM instructions that are bitten by this as isCodeGenOnly,
as they are.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
150d20e8fcadda6600bbb2e188c17a35b8ec7cbd 31-Oct-2010 Chris Lattner <sabre@nondot.org> fix the !eq operator in tblgen to return a bit instead of an int.

Use this to make the X86 and ARM targets set isCodeGenOnly=1
automatically for their instructions that have Format=Pseudo,
resolving a hack in tblgen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a4a3a5e3c212e7b4ac84fec94c9a140f120f3ff6 31-Oct-2010 Chris Lattner <sabre@nondot.org> two changes: make the asmmatcher generator ignore ARM pseudos properly,
and make it a hard error for instructions to not have an asm string.
These instructions should be marked isCodeGenOnly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
39ee036f407bd0c94cb993cf9b97348843cfafa4 31-Oct-2010 Chris Lattner <sabre@nondot.org> reapply r117858 with apparent editor malfunction fixed (somehow I
got a dulicated line).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8b2f0822f3e9e5727b2188872a9db76bc6b87cc6 31-Oct-2010 Chris Lattner <sabre@nondot.org> revert r117858 while I check out a failure I missed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
efa53760feb23935c29176a94e937f02c3aa5683 31-Oct-2010 Chris Lattner <sabre@nondot.org> the asm matcher can't handle operands with modifiers (like ${foo:bar}).
Instead of silently ignoring these instructions, emit a hard error and
force the target author to either refactor the target or mark the
instruction 'isCodeGenOnly'.

Mark a few instructions in ARM and MBlaze as isCodeGenOnly the are
doing this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6fa152c8fb3f36456955fbdf9e95e365f3e21ec8 30-Oct-2010 Chris Lattner <sabre@nondot.org> have GetAliasRequiredFeatures get its features from
AsmMatcherInfo so we don't have two places that know the
feature -> enum mapping. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0aed1e770149301af473ce05a83f73be01c06fe0 30-Oct-2010 Chris Lattner <sabre@nondot.org> simplify code that creates SubtargetFeatureInfo, ensuring that features
that are only used by MnemonicAliases will be found.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8cf8bcc40c977713e51fb85fb9f24a0ecfbde24b 30-Oct-2010 Chris Lattner <sabre@nondot.org> fix typos and some serious bugs in feature handling (but not for
cases that are currently exercised). Thanks to Frits van Bommel for
the great review!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0f899c78e18e39a8ccd08386aaa493a1b9a712a3 30-Oct-2010 Chris Lattner <sabre@nondot.org> Resolve a terrible hack in tblgen: instead of hardcoding
"In32BitMode" and "In64BitMode" into tblgen, allow any
predicate that inherits from AssemblerPredicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
693173feefaa326fad0e386470846fb3199ba381 30-Oct-2010 Chris Lattner <sabre@nondot.org> Implement (and document!) support for MnemonicAlias's to have Requires
directives, allowing things like this:

def : MnemonicAlias<"pop", "popl">, Requires<[In32BitMode]>;
def : MnemonicAlias<"pop", "popq">, Requires<[In64BitMode]>;

Move the rest of the X86 MnemonicAliases over to the .td file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8cc0a6b788a17b3afc779e9da90f5203c8b78436 30-Oct-2010 Chris Lattner <sabre@nondot.org> fix build problem


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4fd32c66481c107a4f32cbec0c3017d9c6154a93 30-Oct-2010 Chris Lattner <sabre@nondot.org> diagnose targets that define two alises with the same 'from' mnemonic
with a useful error message instead of having tblgen explode with an
assert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7fd4489de11bdf06f6c852d42abafea013b76f28 30-Oct-2010 Chris Lattner <sabre@nondot.org> emit the mnemonic aliases in their own helper function instead of
inline into MatchInstructionImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
674c1dcca21f5edf9f7380902971fc5471c0bd4a 30-Oct-2010 Chris Lattner <sabre@nondot.org> implement (and document!) the first kind of MC assembler alias, which
just remaps one mnemonic to another. Convert a few of the X86 aliases
from .cpp to .td code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a7c78220c4ce0c79801044774355b97b731bceda 30-Oct-2010 Jim Grosbach <grosbach@apple.com> trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4e692ab5eeb6cf49dbb9ec9ade21cd91b081ba10 28-Oct-2010 Chris Lattner <sabre@nondot.org> fix the asmmatcher generator to handle targets with no RegisterPrefix
(like ARM) correctly. With this change, we can now match "bx lr"
because we recognize lr as a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
bb16824dc3e2ba660e8b79f49046c418aa8e1be7 08-Oct-2010 Jim Grosbach <grosbach@apple.com> A few 80 column cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
32c685cb67ff7701f4970ef61765cae7a50f255c 07-Sep-2010 Chris Lattner <sabre@nondot.org> attempt to appease msvc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e53ee3b112810068b8ca229aff211fc497069273 07-Sep-2010 Gabor Greif <ggreif@gmail.com> fix comment typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9bb9fa19a5e121b83866867ad1d8f7bf2618c1a0 07-Sep-2010 Chris Lattner <sabre@nondot.org> generalize my previous operand loc info hack. If the same operand
is busted for all variants, report it as the location. This allows
us to get the operand right for bugs like:

t.s:3:12: error: invalid operand for instruction
outb %al, %gs
^

Even though there are reg/imm and reg/reg forms of this instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ce4a3355d96971e7edcbff3c1975f83e1ddcb8f2 07-Sep-2010 Chris Lattner <sabre@nondot.org> in the case where an instruction only has one implementation
of a mneumonic, report operand errors with better location
info. For example, we now report:

t.s:6:14: error: invalid operand for instruction
cwtl $1
^

but we fail for common cases like:

t.s:11:4: error: invalid operand for instruction
addl $1, $1
^

because we don't know if this is supposed to be the reg/imm or imm/reg
form.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a008e8ac73cb3cf2eaf006fbb1b62905c8626758 06-Sep-2010 Chris Lattner <sabre@nondot.org> Now that we know if we had a total fail on the instruction mnemonic,
give a more detailed error. Before:

t.s:11:4: error: unrecognized instruction
addl $1, $1
^
t.s:12:4: error: unrecognized instruction
f2efqefa $1
^

After:

t.s:11:4: error: invalid operand for instruction
addl $1, $1
^
t.s:12:4: error: invalid instruction mnemonic 'f2efqefa'
f2efqefa $1
^

This fixes rdar://8017912 - llvm-mc says "unrecognized instruction" when it means "invalid operands"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fa0d74d58e6c70ef032afb5f83680276dc4d7370 06-Sep-2010 Chris Lattner <sabre@nondot.org> simplify DEBUG_WITH_TYPE usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
44b0daad44791ff249a0bc533a5e58e978c2ca31 06-Sep-2010 Chris Lattner <sabre@nondot.org> this if can now be an assert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
80db4e51d2a44bc623b5892bed2351406890b9aa 06-Sep-2010 Chris Lattner <sabre@nondot.org> ;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2b1f943444d1853204725c7b45b1e1032be39958 06-Sep-2010 Chris Lattner <sabre@nondot.org> now that the opcode is trivially exposed, start matching instructions
by doing a binary search over the mnemonic instead of doing a linear
search through all possible instructions. This implements rdar://7785064


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
96352e5ceb9a2fee7b6e67384afd77493b5c6e5b 06-Sep-2010 Chris Lattner <sabre@nondot.org> emit the match table at global scope instead of within the
MatchInstructionImpl. This makes it easier to read/understand
MatchInstructionImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e206fcf0e9c7e79c7f42ff2151f3fb58cba70674 06-Sep-2010 Chris Lattner <sabre@nondot.org> special case the mnemonic operand of the instruction in the
generated matcher, emiting it as a column in the MatchEntry
table instead of forcing it to go through classification and
everything else. Making it be classified caused tblgen to
produce a ton of one-off classes for each mneumonic. This
should reduce the size of the generated matcher significantly
while paving the way for future improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
87410368e1bd50408e787f6ece0e58d94c53c1e1 06-Sep-2010 Chris Lattner <sabre@nondot.org> The "ambiguous instructions" check only produces anything with -debug,
so only do the N^2 loop with debug mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ec6789f4f97ca1701c163132b6e3388366463090 06-Sep-2010 Chris Lattner <sabre@nondot.org> have tblgen detect when an instruction would have matched, but
failed because a subtarget feature was not enabled. Use this to
remove a bunch of hacks from the X86AsmParser for rejecting things
like popfl in 64-bit mode. Previously these hacks weren't needed,
but were important to get a message better than "invalid instruction"
when used in the wrong mode.

This also fixes bugs where pushal would not be rejected correctly in
32-bit mode (just pusha).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
79ed3f77e8b87615b80054ca6e4e3ba5e07445bd 06-Sep-2010 Chris Lattner <sabre@nondot.org> change MatchInstructionImpl to return an enum instead of bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0692ee676f8cdad25ad09a868bf597af4115c9d9 06-Sep-2010 Chris Lattner <sabre@nondot.org> have AsmMatcherEmitter.cpp produce the hunk of code that gets included
into the middle of the class, and rework how the different sections of
the generated file are conditionally included for simplicity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5845e5c62b42d025557765006515156691a6a8b1 06-Sep-2010 Chris Lattner <sabre@nondot.org> factor the snazzy string matcher code that Daniel hates
out of AsmMatcherEmitter.cpp into its own class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4f98f834593f0a107268d19a557b63f0da33a751 12-Aug-2010 Daniel Dunbar <daniel@zuster.org> tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl',
target specific parsers can adapt the TargetAsmParser to this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4d39b6728dcdcf131bc0739f4ee0f90c836bf94f 11-Aug-2010 Daniel Dunbar <daniel@zuster.org> tblgen/AsmMatcher: Treat '.' in assembly strings as a token separator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a9ba5fe2bde747fadcb57c5304bc4700fc155704 11-Aug-2010 Daniel Dunbar <daniel@zuster.org> tblgen/AsmMatcher: Downgrade instructions with tied operands to a debug-only warning, for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
54074b5f04f5affc77b5c6f3e5d8062b50384831 19-Jul-2010 Daniel Dunbar <daniel@zuster.org> TblGen/AsmMatcher: Add support for honoring instruction Requires<[]> attributes as part of the matcher.
- Currently includes a hack to limit ourselves to "In32BitMode" and "In64BitMode", because we don't have the other infrastructure to properly deal with setting SSE, etc. features on X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3472766f9eb7d66f234c390ce1b3a8b76f0ee9ce 12-Jul-2010 Duncan Sands <baldrick@free.fr> Convert some tab stops into spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
368a4565034b907943f5c0173574eb47939b74bf 27-May-2010 Daniel Dunbar <daniel@zuster.org> AsmMatcher: Ensure classes are totally ordered, so we can std::sort them reliably.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
54ddf3d9c756881021afcb869a6ec892a21aef5b 22-May-2010 Daniel Dunbar <daniel@zuster.org> tblgen/AsmMatcher: Change AsmOperandClass to allow a list of superclasses instead of just one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
4f83e73a6d4d96a1a83bfd258b3bf937297c2957 04-May-2010 Daniel Dunbar <daniel@zuster.org> MC/Matcher: Add support for over-riding the default MatchInstruction function
name (for example, to allow targets to interpose the actual MatchInstruction
function).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
f65027842e82027dd6e8020586a299aaa548e355 19-Mar-2010 Chris Lattner <sabre@nondot.org> change Target.getInstructionsByEnumValue to return a reference
to a vector that CGT stores instead of synthesizing it on every
call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b61e09de6d0cd7241ddc6dee3efef416552eec3b 19-Mar-2010 Chris Lattner <sabre@nondot.org> don't go through getInstructions().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8cc9c0c487128c4d675d45803a0711c3e43534af 18-Mar-2010 Daniel Dunbar <daniel@zuster.org> MC/AsmMatcher: Add support for target specific "instruction cleanup" functions,
to allow custom post-processing of matched instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
3b6910dcd466bf091b386bb136f42522c89473f7 12-Feb-2010 Daniel Dunbar <daniel@zuster.org> MC: Fix bug where trailing tied operands were forgotten; the X86 assembler
matcher is now free of implicit operands!
- Still need to clean up the code now that we don't to worry about implicit
operands, and to make it a hard error if an instruction fails to specify all
of its operands for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
bef529182f3931f4d13e885d91a0beb7aa81ced2 10-Feb-2010 Daniel Dunbar <daniel@zuster.org> MC/AsmMatcher: Tweak conversion function name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
af61681cedb42a0e9f84560316d74f4ddeb2d2b6 10-Feb-2010 Daniel Dunbar <daniel@zuster.org> MC/AsmMatcher: Add support for creating tied operands when constructing MCInsts.
- Pretty messy, but we need to rework how we handle tied operands in MCInst
anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b8d6e98e566724f58344d275a4bd675249bb713a 09-Feb-2010 Chris Lattner <sabre@nondot.org> pass stringref by value instead of by const&


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e1f6de3fbd892ea3f918a26912660cf316866fc1 03-Feb-2010 Daniel Dunbar <daniel@zuster.org> AsmMatcherEmitter: Use stable_sort when reordering instructions, so that order
is still deterministic even amongst ambiguous instructions (eventually ambiguous
match orders will be a hard error, but we aren't there yet).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a2f5e00347641d1b46ce4f65bf9378fecce9be14 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> AsmMatcher: Create operand classes before use, apparently records aren't visited
in the order they were declared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
e9b466d4f09de3b46c0d0d1e71cabddc7cc9021b 23-Jan-2010 Sean Callanan <scallanan@apple.com> Modified the register matcher function in AsmMatcher to
be static. Also made it possible for clients to get it
and no other functions from ...GenAsmMatcher.inc by
defining REGISTERS_ONLY before including GenAsmMatcher.inc.
This sets the stage for target-specific lexers that can
identify registers and return AsmToken::Register as
appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1402f0b2cac017ab997f71ab4909a2ccfea7be4b 23-Jan-2010 Daniel Dunbar <daniel@zuster.org> AsmMatcher: Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
9898671a74d3fc924347e679c45edaa685b3fe6e 14-Jan-2010 Chris Lattner <sabre@nondot.org> Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands. A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives
targets the ability to use polymorphic operands if they want to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
1095f2ae261d231a63d329b0ebbf6eaf566ff429 12-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Match hard coded registers (e.g. 'shldl %cl, %eax, %eax')

We now match all of 403.gcc (as emitted by clang). :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7417b761c2d88335bd77d38911ff8d323fc4a4f2 12-Aug-2009 Daniel Dunbar <daniel@zuster.org> Add 'isCodeGenOnly' bit to Instruction .td records.
- Used to mark fake instructions which don't correspond to an actual machine
instruction (or are duplicates of a real instruction). This is to be used for
"special cases" in the .td files, which should be ignored by things like the
assembler and disassembler. We still need a good solution to handle pervasive
duplication, like with the Int_ instructions.

- Set the bit on fake "mov 0" style instructions, which allows turning an
assembler matcher warning into a hard error.

- -2 FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
59fc42debd571bbafc52c20bc418fdc3f4d00188 11-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Allow target to specific a comment delimiter, which will be
used to strip hard coded comments out of .td assembly strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8409bfbbc306bc051fbd8b049804103ca7df2f63 11-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Fix two thinkos in determining whether two classes are
related.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ea6408f8cd17b065e414611e01a7133d118429e9 11-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Implement automatic classification of RegisterClass operands.
- This drops us to 123 ambiguous instructions (previously ~500) on X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5c468e3d7006e854fd41b29d5539a7adcee53904 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Allow .td users to redefine the names of the methods to call
on target specific operands for testing class membership and converting to
MCInst operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
ac6b4f2c0c03bd90435477ed5b705205d28601d0 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Remove some code which has been obsoleted by move to
explicit parser match classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
338825c1928b956b2cbcc2c165a60afddd100398 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Change assembler parser match classes to their own record
structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fdb1f493ab6bcfb5603b9f497195492d92aceacb 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Check for matches with super classes when matching
instruction operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
db2ddb5dc57319eff249144f1d9a553a3278d2e0 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Fix thinko in ClassInfo::operator<.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
72fa87f0cfe22faa575280dbac8dbc9225dfb12d 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Add hack to ignore Int_* and *_Int instructions for now, to
make it easier to see interesting ambiguities.
- Also, check that user doesn't try to redefine the super class. This is a wart
in the current design, in that assembler match classes aren't explicitly
declared somewhere (so there isn't a unique place to declare the super
class). This should probably be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
5fe6338ac859707f797bf6db6d043bb5f4d944a1 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Implement user defined super classes.
- We can now discriminate SUB32ri8 from SUB32ri, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2b54481a77696d47dc9220cd7a36155599750904 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Separate instruction ordering for ambiguity detection.
- We want the ordering operation to be simple, since we run it on every
match. The old ordering is also not a strict weak ordering when there are
ambiguities, which makes MSVC unhappy.

- While we are at it, detect all ambiguities instead of just the adjacent
ones. There are actually 655, for X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
6745d42e8e51ba6b9546d6fa62e0c1b1e0f3982a 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Define match classes in the .td file.
-2 FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
606e8ad796f72824f5509e2657c44eca025d4baf 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmParser: Sketch infrastructure for ordering instructions & detecting
ambiguities.
- Currently there are 483 ambiguities to resolve. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
8246bef02aa6ef00242c9f318ecd32ff85d92bc6 09-Aug-2009 Chris Lattner <sabre@nondot.org> fix edito


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
af3e9d43a2d8ba3cf5f65f54bd928846bec3ab67 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Tweak string matcher (missed a newline).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
72ffae90ce9750b46b9a7cc84e5c11dae9274ebe 09-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Tweak string matcher.
- Track whether we need to insert an explicit 'break'.

- Invert conditional when matching a single prefix to reduce
nesting/bracing/breaking.

- wc -l of X86GenAsmMatcher.inc decreased by 10%. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
245f05843f7f17406f394696e7330950e6d88e6d 08-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Switch token matching to use the new string matcher.

Also, redefined MatchRegisterName to just return the register value or a
sentinel, to simplify the generated code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
70add884e4967f511e2cbb35c61534186b9b418a 08-Aug-2009 Chris Lattner <sabre@nondot.org> add a little function to do arbitrary string pattern matching in a
much more efficient way than a sequence of if's. Switch MatchRegisterName
to use it. It would be nice if someone could factor this out to a shared
place in tblgen :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d39bd3aa5c795e55c0e2c4a5c72dab58ce1a1576 08-Aug-2009 Chris Lattner <sabre@nondot.org> add another const


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
c6049534605af5f13d1b5149488b0a9efd294582 08-Aug-2009 Chris Lattner <sabre@nondot.org> remove a useless anon-ns, make table const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fa1165abb8fec9383d640b0696a9f397b9153baf 08-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> MSVC doesn't like member variables with the same name as the class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a3741fa28b1a397ebfd623ef9d14e978df94ce47 08-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Improve match code.
- This doesn't actually improve the algorithm (its still linear), but the
generated (match) code is now fairly compact and table driven. Still need a
generic string matcher.

- The table still needs to be compressed, this is quite simple to do and should
shrink it to under 16k.

- This also simplifies and restructures the code to make the match classes more
explicit, in anticipation of resolving ambiguities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
b7479c035534b1c240117cd0aea8342393160da8 08-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Switch to a unified function to convert operands to MCInst,
so that terminal states are as simple as possible.
- If we were willing to assume that the order that operands get inserted in the
MCInst is fixed we could actually dispose with this altogether, although it
might be nice to have the flexibility to change it later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2234e5eee6d196594d42e6f2be51e176bf5e5f6e 07-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Move emit for register -> enum matcher into a separate routine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
2724915c171b08fa9f7f9e54a46ea81708d9c5b2 07-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Tweaks in response to feedback.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
20927f26fcd7d0394bc60c58c61d879a83adac0d 07-Aug-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc/AsmMatcher: Move to a slightly more sane matching design.
- Still not very sane, but a least its not 60k lines on X86. :)

- In terms of correctness, currently some things are hard wired for X86, and we
still don't properly resolve ambiguities (this is ignoring the instructions
we don't even match due to funny .td stuff or other corner cases).

The high level changes:
1. Represent tokens which are significant for matching explicitly as separate
operands. This uniformly handles not only the instruction mnemonic, but
also 'signficiant' syntax like the '*' in "call * ...".

2. Separate the matching of operands to an instruction from the construction of
the MCInst. In theory this can be done during matching, but since the number
of variations is small I think it makes sense to decompose the problems.

3. Improved a few of the mechanisms to at least successfully flatten / tokenize
the assembly strings for PowerPC and ARM.

4. The comment at the top of AsmMatcherEmitter.cpp explains the approach I'm
moving towards for handling ambiguous instructions. The high-bit is to infer
a partial ordering of the operand classes (and force the user to specify one
if we can't) and use that to resolve ambiguities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
53a7f16dcc96de71fa46f641c59470586548081e 04-Aug-2009 Daniel Dunbar <daniel@zuster.org> TableGen / AsmMatcher: Tweaks to avoid generating completely bogus match
functions.
- Fix variant flattening when the variant embeds an operand reference.

- Ignore instructions which reference an operand multiple times (e.g., "xorb
$dst, $dst"), and operands which have extra flags (e.g., "$dst:subreg32").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
cdcb388a589846e7e7ca8c88f77cf53933539074 02-Aug-2009 Daniel Dunbar <daniel@zuster.org> Change MCOperand to use Create style instead of Make style for constructing
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
a027d222e18ea9028e9e12ae2f5cd566889b599a 31-Jul-2009 Daniel Dunbar <daniel@zuster.org> llvm-mc: Match a few X86 instructions.
- This is "experimental" code, I am feeling my way around and working out the
best way to do things (and learning tblgen in the process). Comments welcome,
but keep in mind this stuff will change radically.

- This is enough to match "subb" and friends, but not much else. The next step is to
automatically generate the matchers for individual operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
7212f809662ea3d54974e5ab64f612fb138e3ec9 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove unintended changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
fe09b2098ac483f6d6ce6ea4ab237a9539bdb6b9 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Twines: Don't allow implicit conversion from integers, this is too tricky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
0e2771f4c4a6e1ffc664eb23487087f824340255 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Match X86 register names to number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
22be5225ff88ffaab83c36fa133e70586b91166d 17-Jul-2009 Daniel Dunbar <daniel@zuster.org> tblgen/AsmMatcher: Emit simple matcher for register names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp
d51ffcf303070b0a5aea7f365b85f6f969c384cb 11-Jul-2009 Daniel Dunbar <daniel@zuster.org> Stub out assembly matcher (.s -> MCInst) tblgen backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/utils/TableGen/AsmMatcherEmitter.cpp