Commit Graph

77108 Commits

Author SHA1 Message Date
Daniel Dunbar 19b70bd46c Recognize 'q' as a format length modifier (from BSD).
llvm-svn: 94894
2010-01-30 15:49:20 +00:00
Benjamin Kramer 842bf17366 Use StringRef instead of returning a temporary std::string.
This fixes a really nasty bug in Darwin::getDarwinArchName where we were going
StringRef -> temporary std::string -> StringRef (and return the dead StringRef).
The StringRefs from Triple live as long as the Triple itself, that should be
long enough.

Hopefully 2 of 4 MSVC buildbot failures are gone now.

llvm-svn: 94892
2010-01-30 15:01:47 +00:00
Anton Korobeynikov 25df248382 Fix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Even if they are suported by the core, they can be disabled
(this is just a configuration bit inside some register).

Allow unaligned memops on darwin and conservatively disallow them otherwise.

llvm-svn: 94889
2010-01-30 14:08:12 +00:00
Benjamin Kramer a87bdb793e We don't need to place 0 in the URL string now that we return a StringRef.
- URL can go into read only memory now.
- Compilers will fold away all the strstr calls.

llvm-svn: 94887
2010-01-30 14:01:39 +00:00
Anton Korobeynikov cbc4e98381 Fix alignment for msp430 integer types.
llvm-svn: 94879
2010-01-30 12:55:11 +00:00
Benjamin Kramer f1e1e9596c Silence clang++ warning.
llvm-svn: 94878
2010-01-30 12:15:41 +00:00
Bob Wilson 56600a15ad Check alignment of loads when deciding whether it is safe to execute them
unconditionally.  Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.

llvm-svn: 94875
2010-01-30 04:42:39 +00:00
Anders Carlsson a18f0fbca2 Eliminate yet another old-school PerformCopyInitialization.
llvm-svn: 94874
2010-01-30 01:56:32 +00:00
Evan Cheng 70f714fdbe Allow more tailcall optimization: calls with inputs that are all passed in registers.
llvm-svn: 94873
2010-01-30 01:22:00 +00:00
Evan Cheng 2d5a75b42a Don't forget to transfer target flag when inserting a tailcall instruction.
llvm-svn: 94872
2010-01-30 01:16:15 +00:00
Devang Patel 160c92dd19 Emit declaration DIE for the class static variables.
llvm-svn: 94870
2010-01-30 01:08:30 +00:00
Daniel Dunbar 76e5d70c57 MC/X86 AsmParser: Handle absolute memory operands correctly. We were doing
something totally broken and parsing them as immediates, but the .td file also
had the wrong match class so things sortof worked. Except, that is, that we
would parse
  movl $0, %eax
as
  movl 0, %eax
Feel free to guess how well that worked.

llvm-svn: 94869
2010-01-30 01:02:48 +00:00
Daniel Dunbar cf18153de2 AsmMatcher: Create operand classes before use, apparently records aren't visited
in the order they were declared.

llvm-svn: 94868
2010-01-30 01:02:37 +00:00
Ted Kremenek 9ff02052dd Add format string checking of 'double' arguments. Fixes <rdar://problem/6931734>.
llvm-svn: 94867
2010-01-30 01:02:18 +00:00
Dale Johannesen e057403835 Fix a case where debug_value could affect codegen.
llvm-svn: 94866
2010-01-30 00:57:47 +00:00
Ted Kremenek b0fe9b9a40 Add test case for <rdar://problem/7068334> (which was fixed by r94864).
llvm-svn: 94865
2010-01-30 00:56:00 +00:00
Ted Kremenek c3bdff7c8c Add basic type checking of format string conversion specifiers and their arguments. Thanks to Cristian Draghici for his help with this patch!
llvm-svn: 94864
2010-01-30 00:49:51 +00:00
Bob Wilson 4b71b6c179 Use more specific types to avoid casts. No functionality change.
llvm-svn: 94863
2010-01-30 00:41:10 +00:00
Bob Wilson 2e51136f80 Remove ARM-specific calling convention from this test. Target data is
needed for this test, but otherwise, there's nothing ARM-specific about
it and no need to specify the calling convention.

llvm-svn: 94862
2010-01-30 00:40:23 +00:00
Daniel Dunbar f05d00787a X86.td: Refactor to bring operands that use print_pcrel_imm together.
llvm-svn: 94861
2010-01-30 00:24:12 +00:00
Daniel Dunbar e9aa36c895 FileCheck: When looking for "possible matches", only compare against the prefix
line. Turns out edit_distance can be slow if the string we are scanning for
happens to be quite large.

llvm-svn: 94860
2010-01-30 00:24:06 +00:00
Daniel Dunbar a97adee959 AsmMatcher/X86: Separate out sublass for memory operands that have no segment
register, and use to cleanup a FIXME in X86AsmParser.cpp.

llvm-svn: 94859
2010-01-30 00:24:00 +00:00
Jakob Stoklund Olesen e27dc727e2 Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().
This bug was exposed by my inliner cost changes in r94615, and caused failures
of lencod on most architectures when building with LTO.

This patch fixes lencod and 464.h264ref on x86-64 (and likely others).

llvm-svn: 94858
2010-01-29 23:54:14 +00:00
Daniel Dunbar 7f0421eebb MC/X86: Add a nice X86 assembler matcher test case from Kevin Enderby.
- This test case is auto generated, and has been verified to round-trip
   correctly through llvm-mc by checking the assembled .o file before and after
   piping through llvm-mc. It will be extended over time as the matcher grows
   support for more instructions.

llvm-svn: 94857
2010-01-29 23:32:40 +00:00
Ted Kremenek 605b0113f3 Be a little more permissive than C99: allow 'unsigned' to be used for
the field width and precision of a format specifier instead of just
'int'.  This matches GCC, and fixes <rdar://problem/6079850>.

llvm-svn: 94856
2010-01-29 23:32:22 +00:00
Johnny Chen 34a6afc68d Modified encoding bits specification for VFP instructions. In particular, the D
bit (Inst{22}) and the M bit (Inst{5}) should be left unspecified.  For binary
format instructions, Inst{6} and Inst{4} need to specified for proper decodings.

llvm-svn: 94855
2010-01-29 23:21:10 +00:00
Dan Gohman 5ded1424b0 Print a comment next to "materializable" global values, to distinguish
them from values that are not actually defined in the module.

llvm-svn: 94854
2010-01-29 23:12:36 +00:00
Evan Cheng 25217ffaed PPC is not ready for sibcall optimization.
llvm-svn: 94853
2010-01-29 23:05:56 +00:00
Ted Kremenek ba775fe5c7 Fix spacing.
llvm-svn: 94852
2010-01-29 23:00:35 +00:00
Ted Kremenek 79db7b7b17 Per a suggestion from Cristian Draghici, add a method to FormatSpecifier that returns the expected type of the matching data argument. It isn't complete, but should handle several of the important cases.
llvm-svn: 94851
2010-01-29 22:59:32 +00:00
Bob Wilson 1b8453067b Preserve load alignment in instcombine transformations. I've been unable to
create a testcase where this matters.  The select+load transformation only
occurs when isSafeToLoadUnconditionally is true, and in those situations,
instcombine also changes the underlying objects to be aligned.  This seems
like a good idea regardless, and I've verified that it doesn't pessimize
the subsequent realignment.

llvm-svn: 94850
2010-01-29 22:39:21 +00:00
Devang Patel bb4820dc8e Use appropriate context for typedefs.
llvm-svn: 94849
2010-01-29 22:29:31 +00:00
Dan Gohman 2bf486eb14 Minor code cleanup.
llvm-svn: 94848
2010-01-29 21:57:46 +00:00
Dan Gohman df22bbf76c Skip whitespace when looking for a potential intended match.
Before:

<stdin>:94:1: note: possible intended match here
 movsd 4096(%rsi), %xmm0
^

After:
<stdin>:94:2: note: possible intended match here
 movsd 4096(%rsi), %xmm0
 ^

llvm-svn: 94847
2010-01-29 21:55:16 +00:00
Dan Gohman 838fb09a75 Fix the position of the caret in the FileCheck error message.
Before:

test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
                                 ^

After:

test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
         ^

llvm-svn: 94846
2010-01-29 21:53:18 +00:00
Junjie Gu 6abe6cb8b5 Make sure the size is doubled (not 4x).
llvm-svn: 94845
2010-01-29 21:34:26 +00:00
Sean Callanan fd86e790cc Removed symbols from .exports that are not yet in
the library.

llvm-svn: 94844
2010-01-29 21:21:44 +00:00
Dale Johannesen ad00f03e86 Add assertion to humor the paranoid.
llvm-svn: 94843
2010-01-29 21:21:28 +00:00
Victor Hernandez 6b7f4216b6 We were not writing bitcode for function-local metadata whose operands have been erased (making it not have any more function-local operands)
llvm-svn: 94842
2010-01-29 21:19:19 +00:00
Eric Christopher 5a0e174863 Revert my last couple of patches. They appear to have broken bison.
llvm-svn: 94841
2010-01-29 21:16:24 +00:00
Jeffrey Yasskin b36dc68f61 Rename two IRReader.h functions to indicate that they return a Module
that loads its contents lazily from bitcode.  I think these are the
only remaining mis-named functions.

llvm-svn: 94840
2010-01-29 21:11:04 +00:00
Daniel Dunbar 1299819f71 Driver: Don't honor -std-default for C++, this makes it hard to run the gdb test
suite with clang++ enabled.

The right fix here is PR6175, although we would still have to find a different
work around for the gdb test suite.

llvm-svn: 94838
2010-01-29 21:03:02 +00:00
Ted Kremenek 8d9842d43f Switch Sema over to using the new implementation of format string
checking.  It passes all existing tests, and the diagnostics have been
refined to provide better range information (we now highlight
individual format specifiers) and more precise wording in the
diagnostics.

llvm-svn: 94837
2010-01-29 20:55:36 +00:00
Bob Wilson 34e10c2218 Use uint64_t instead of unsigned for offsets and sizes.
llvm-svn: 94835
2010-01-29 20:34:28 +00:00
Ted Kremenek 23a71a1cdf Enhancements to the alternate (WIP) format string checking:
- Add ConversionSpecifier::consumesDataArgument() as a helper method
  to determine if a conversion specifier requires a matching argument.
- Add support for glibc-specific '%m' conversion
- Add an extra callback to HandleNull() for locations within the
  format specifier that have a null character

llvm-svn: 94834
2010-01-29 20:29:53 +00:00
Dan Gohman 6bd1dee261 Add svn:ignore properties.
llvm-svn: 94833
2010-01-29 19:43:48 +00:00
Douglas Gregor aa6050b0e2 PR5909 had a test case for binding of const, non-volatile references
to bitfields. Add it here.

llvm-svn: 94832
2010-01-29 19:42:41 +00:00
Douglas Gregor d1e08648c6 Fix reference-binding when we have a reference to const volatile type;
previously, we were allowing this to bind to a temporary. Now, we
don't; add test-cases and improve diagnostics.

llvm-svn: 94831
2010-01-29 19:39:15 +00:00
Ted Kremenek db4b7710f7 Fix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead of '='.
llvm-svn: 94830
2010-01-29 19:38:24 +00:00
Bob Wilson 7c42b9d51e Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.

llvm-svn: 94829
2010-01-29 19:19:08 +00:00