[mips] Fix assembler temporary expansion and add associated warnings about the use...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 25 Mar 2014 10:57:07 +0000 (10:57 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 25 Mar 2014 10:57:07 +0000 (10:57 +0000)
commitc141b331b90696f85ebddf8d3d04e1143738b271
treeee8e45bf8e00ca3f62c4a3ab37cd80572aacd2f9
parent6e2aab69a69d3383fe2db77ad06fc5fa4862a65d
[mips] Fix assembler temporary expansion and add associated warnings about the use of $at.

Summary:
The assembler temporary is normally $at ($1) but can be reassigned using
'.set at=$reg'. Regardless of which register is nominated as the assembler
temporary, $at remains $1 when written by the user.

Adds warnings under the following conditions:
* The register nominated as the assembler temporary is used by the user.
* '.set noat' is in effect and $at is used by the user.
Both of these only work for named registers. I have a follow up commit that makes it work for numeric registers as well.

XFAIL set-at-directive.s since it incorrectly tests that $at is redefined by
'.set at=$reg'. Testcases will follow in a separate commit.

Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

Differential Revision: http://llvm-reviews.chandlerc.com/D3167

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204710 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
test/MC/Mips/set-at-directive.s