Chris Lattner
bdedd983a9
attempt to appease msvc
...
llvm-svn: 113198
2010-09-07 06:10:48 +00:00
Gabor Greif
cb72b44075
fix comment typos
...
llvm-svn: 113197
2010-09-07 06:06:06 +00:00
Chris Lattner
9f2c0da214
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.
llvm-svn: 113183
2010-09-06 23:37:39 +00:00
Chris Lattner
6bfa0d9988
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.
llvm-svn: 113178
2010-09-06 22:11:18 +00:00
Chris Lattner
bb5e19cb63
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"
llvm-svn: 113176
2010-09-06 21:54:15 +00:00
Chris Lattner
fd211fc740
simplify DEBUG_WITH_TYPE usage
...
llvm-svn: 113174
2010-09-06 21:28:52 +00:00
Chris Lattner
4a6911275e
this if can now be an assert.
...
llvm-svn: 113173
2010-09-06 21:25:43 +00:00
Chris Lattner
90ef8a5d5a
;
...
llvm-svn: 113172
2010-09-06 21:23:43 +00:00
Chris Lattner
7b80f3c39c
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
llvm-svn: 113171
2010-09-06 21:22:45 +00:00
Chris Lattner
e443a993fb
emit the match table at global scope instead of within the
...
MatchInstructionImpl. This makes it easier to read/understand
MatchInstructionImpl.
llvm-svn: 113170
2010-09-06 21:08:38 +00:00
Chris Lattner
d323dac9bd
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.
llvm-svn: 113169
2010-09-06 21:01:37 +00:00
Chris Lattner
72d2fb8001
The "ambiguous instructions" check only produces anything with -debug,
...
so only do the N^2 loop with debug mode.
llvm-svn: 113168
2010-09-06 20:21:47 +00:00
Chris Lattner
68f7c5b750
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).
llvm-svn: 113166
2010-09-06 20:08:02 +00:00
Chris Lattner
22bb9cb511
change MatchInstructionImpl to return an enum instead of bool.
...
llvm-svn: 113165
2010-09-06 19:22:17 +00:00
Chris Lattner
45a204be76
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.
llvm-svn: 113163
2010-09-06 19:11:01 +00:00
Chris Lattner
1f45ad0aba
emit the LLVM intrinsic name -> intrinsic number mapping table with
...
StringMatcher instead of a linear sequence of memcmps.
llvm-svn: 113145
2010-09-06 03:58:45 +00:00
Chris Lattner
8615b37209
allow specifying an indentation level for the string matcher.
...
llvm-svn: 113143
2010-09-06 03:50:59 +00:00
Chris Lattner
8d0ee62652
emit the __builtin -> intrinsic map with StringMatcher instead of a
...
copy of a close relative of it.
llvm-svn: 113142
2010-09-06 03:14:45 +00:00
Chris Lattner
81f696e142
same bug, another place.
...
llvm-svn: 113141
2010-09-06 03:12:27 +00:00
Chris Lattner
6075477174
fix a critical bug where the generated table would say
...
"1 strings to match" in a comment, which isn't gramatic.
llvm-svn: 113140
2010-09-06 03:11:10 +00:00
Chris Lattner
b58e070f0c
update cmake
...
llvm-svn: 113139
2010-09-06 02:58:25 +00:00
Chris Lattner
df487455cb
factor the snazzy string matcher code that Daniel hates
...
out of AsmMatcherEmitter.cpp into its own class.
llvm-svn: 113137
2010-09-06 02:01:51 +00:00
Chris Lattner
9feb462669
slightly improve the runtime and code size of the Intrinsics info table by not
...
comparing the "llvm." prefix in the memcmp, and not storing it in the string literal.
llvm-svn: 113136
2010-09-06 01:44:44 +00:00
Chris Lattner
f92de84645
zap dead code.
...
llvm-svn: 113071
2010-09-04 17:45:58 +00:00
David Greene
903408c475
Generalize getFieldType to work on all TypedInits. Add a couple of testcases from
...
Amaury Pouly.
llvm-svn: 113010
2010-09-03 21:00:49 +00:00
Jakob Stoklund Olesen
9f5c5e6e85
Stop emitting predicate functions. They are no longer used.
...
llvm-svn: 112924
2010-09-03 00:39:50 +00:00
Chris Lattner
97758ab924
remove dead code.
...
llvm-svn: 112707
2010-09-01 15:39:31 +00:00
Dan Gohman
f9e09104f1
Make tool_output_file's raw_ostream instance a member variable instead
...
of a base class.
This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.
llvm-svn: 112706
2010-09-01 14:20:41 +00:00
Chris Lattner
7a86b354fc
more dead thing zapping.
...
llvm-svn: 112353
2010-08-28 03:43:50 +00:00
Chris Lattner
faae20ef23
zap dead method
...
llvm-svn: 112352
2010-08-28 03:42:45 +00:00
Bob Wilson
d107dd5cd2
Fix a comment typo.
...
llvm-svn: 112302
2010-08-27 21:56:59 +00:00
Eric Christopher
7637f43217
Allow strict subclasses of register classes, this way we can handle
...
ARM instructions with:
foo GPR, rGPR
which happens a lot.
llvm-svn: 112025
2010-08-25 04:58:56 +00:00
Eric Christopher
70a1a20101
Split out register class subclassing to a separate function and clean up
...
accordingly. No functional change.
llvm-svn: 112008
2010-08-25 00:41:18 +00:00
Eric Christopher
109fe5d8f8
Fix comment.
...
llvm-svn: 111996
2010-08-24 23:21:59 +00:00
Mikhail Glushenkov
d99b1c6feb
llvmc: Improve error handling in EmitEdgeClasses().
...
llvm-svn: 111886
2010-08-24 01:10:22 +00:00
Mikhail Glushenkov
8001ceb30e
llvmc: Make syntax more consistent.
...
CompilationGraph and LanguageMap definitions do not use special syntax anymore.
llvm-svn: 111862
2010-08-23 23:21:23 +00:00
Mikhail Glushenkov
68d96f1d5c
llvmc: Allow multiple LanguageMaps.
...
llvm-svn: 111829
2010-08-23 19:24:16 +00:00
Mikhail Glushenkov
14e2900dfd
llvmc: Properly handle (error) in edge properties.
...
llvm-svn: 111827
2010-08-23 19:24:08 +00:00
Mikhail Glushenkov
d70ada534a
llvmc: Do not mention plugins in the code.
...
llvm-svn: 111826
2010-08-23 19:24:00 +00:00
Chandler Carruth
e0ed6ee921
Fix some GCC warnings by providing a virtual destructor in the base of a class
...
hierarchy with virtual methods and using llvm_unreachable to properly indicate
unreachable states which would otherwise leave variables uninitialized.
llvm-svn: 111803
2010-08-23 08:25:07 +00:00
Mikhail Glushenkov
05e7815f9f
llvmc: Fix alias generation.
...
llvm-svn: 111662
2010-08-20 18:16:26 +00:00
Dan Gohman
88c800c375
Convert tablegen to use tool_output_file.
...
llvm-svn: 111644
2010-08-20 16:45:58 +00:00
Mikhail Glushenkov
f0f98cc3de
llvmc: Do not prefix option names with AutoGenerated.
...
Since they now live in the namespace 'autogenerated'.
llvm-svn: 111620
2010-08-20 11:24:51 +00:00
Mikhail Glushenkov
63df898925
llvmc: Cut global namespace pollution.
...
llvm-svn: 111619
2010-08-20 11:24:44 +00:00
Mikhail Glushenkov
201390919b
llvmc: Update examples.
...
llvm-svn: 111553
2010-08-19 20:04:19 +00:00
Eli Friedman
cb04139235
Use std::string instead of StringRef in ClangAttrEmitter.cpp; per report on
...
cfe-dev, fixes an error compiling with MSVC. Using a StringRef here doesn't
look safe in any case.
llvm-svn: 111513
2010-08-19 06:11:05 +00:00
Alexis Hunt
5e797f1877
Add include missing for VC build.
...
llvm-svn: 111484
2010-08-19 00:19:03 +00:00
Alexis Hunt
4686927dba
Remove three spurious semicolons
...
llvm-svn: 111480
2010-08-19 00:03:05 +00:00
Alexis Hunt
068811ea03
Finish full attribute class emission for clang.
...
For more information, see the accompanying clang patch.
llvm-svn: 111454
2010-08-18 23:23:09 +00:00
Eric Christopher
7e10a7fd22
Remove predicate workaround, we're going to require that predicate
...
and optional def operands are handled in the backend support.
llvm-svn: 111220
2010-08-17 01:18:37 +00:00