Commit Graph

102535 Commits

Author SHA1 Message Date
Ted Kremenek ea6c20adaf Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag. I await any fallout/comments/feedback, although hopefully this will produce no noise for users.
llvm-svn: 127670
2011-03-15 05:22:33 +00:00
Ted Kremenek 1a47f366b7 Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.
llvm-svn: 127669
2011-03-15 05:22:28 +00:00
Evan Cheng e4b8ac9fef Add a peephole optimization to optimize pairs of bitcasts. e.g.
v2 = bitcast v1
...
v3 = bitcast v2
...
   = v3
=>
v2 = bitcast v1
...
   = v1
if v1 and v3 are of in the same register class.

bitcast between i32 and fp (and others) are often not nops since they
are in different register classes. These bitcast instructions are often
left because they are in different basic blocks and cannot be
eliminated by dag combine.

rdar://9104514

llvm-svn: 127668
2011-03-15 05:13:13 +00:00
Evan Cheng 880e299dcd - Add "Bitcast" target instruction property for instructions which perform
nothing more than a bitcast.
- Teach tablegen to automatically infer "Bitcast" property.

llvm-svn: 127667
2011-03-15 05:09:26 +00:00
Ted Kremenek c8c4e5f371 Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.
llvm-svn: 127666
2011-03-15 04:57:38 +00:00
Ted Kremenek 9b15c962a9 UninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVector. No real functionality change, but this is a stepping stone to moving to tri-state logic.
llvm-svn: 127665
2011-03-15 04:57:32 +00:00
Ted Kremenek d3def3841f UninitializedValues: wrap BitVector references in a new class ValueVector. No functionality change. This defines the minimum interface that ValueVector needs to support when we no longer base it strictly on a direct interpretation of BitVector.
llvm-svn: 127664
2011-03-15 04:57:29 +00:00
Ted Kremenek a895fe999d Substitue term "BitVector" with "ValueVector" to prep for further revisions. No functionality change.
llvm-svn: 127663
2011-03-15 04:57:27 +00:00
Greg Clayton 3690964ca1 Added a fix that should help incorrect type uniquing. There was an issue
for templatized types that could cause parts of a std::vector (and I am sure
other STL types) to be incorrectly uniqued to each other wreaking havoc on 
variable display for types within the same executable module.

llvm-svn: 127662
2011-03-15 04:38:20 +00:00
Greg Clayton 3ad0572d2e Make the first vector of "long" instead of "int" so we can tell the difference
easier since "short" ends up with "short int" in the template allocators.

llvm-svn: 127661
2011-03-15 04:29:42 +00:00
Greg Clayton 8f67fd10e9 Added a test case for unique types. In the test case there are two std::vector
types that have different contents. Currently LLDB is incorrectly uniquing,
on MacOSX, the std::vector _VectorImpl class from the two different vector
templates. The DWARF looks like:

0x0000008e:         DW_TAG_structure_type [7] *
                     DW_AT_name( "_Vector_base<int,std::allocator<int> >" )
                     DW_AT_declaration( 0x01 )
                     DW_AT_sibling( {0x00000103} )

0x00000098:             DW_TAG_structure_type [8] *
                         DW_AT_name( "_Vector_impl" )
                         DW_AT_byte_size( 0x18 )
                         DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" )
                         DW_AT_decl_line( 83 )

0x000000a0:                 DW_TAG_inheritance [9]  
                             DW_AT_type( {0x000006fa} ( allocator<int> ) )
                             DW_AT_data_member_location( +0 )
                             DW_AT_accessibility( DW_ACCESS_public )



0x0000011b:         DW_TAG_structure_type [7] *
                     DW_AT_name( "_Vector_base<short int,std::allocator<short int> >" )
                     DW_AT_declaration( 0x01 )
                     DW_AT_sibling( {0x00000190} )

0x00000125:             DW_TAG_structure_type [8] *
                         DW_AT_name( "_Vector_impl" )
                         DW_AT_byte_size( 0x18 )
                         DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" )
                         DW_AT_decl_line( 83 )

0x0000012d:                 DW_TAG_inheritance [9]  
                             DW_AT_type( {0x00000f75} ( allocator<short int> ) )
                             DW_AT_data_member_location( +0 )
                             DW_AT_accessibility( DW_ACCESS_public )


In this case it using DIE 0x00000098 for both 0x00000098 and 0x00000125.

This test will help detect this issue once I have a fix for it. I have a fix
that I am testing.

llvm-svn: 127660
2011-03-15 04:25:12 +00:00
Greg Clayton 616f490777 Added a fix to not re-use object files when doing DWARF with debug map.
llvm-svn: 127659
2011-03-15 03:56:33 +00:00
Ted Kremenek a0a5ca14d0 Rename UninitializedValuesV2 to UninitializedValues.
llvm-svn: 127657
2011-03-15 03:17:07 +00:00
Ted Kremenek 792798549f Remove old UninitializedValues analysis.
llvm-svn: 127656
2011-03-15 03:17:01 +00:00
NAKAMURA Takumi b2beb018b8 lib/Basic/Targets.cpp: __declspec(attr) should be provided on mingw as macro, alias of __attribute__.
On mingw without -fms-extensions, we can provide "as-is" __declspec.

llvm-svn: 127655
2011-03-15 02:32:50 +00:00
NAKAMURA Takumi 1a780ee8a9 lib/Headers/mm_malloc.h: On Windows, we can expect _mm_malloc would be provided as macro by <malloc.h>.
llvm-svn: 127654
2011-03-15 02:32:43 +00:00
NAKAMURA Takumi 63b4b456be lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.
llvm-svn: 127652
2011-03-15 02:32:36 +00:00
Eli Friedman c4414c6e92 PR9450: Make switch optimization in SimplifyCFG not dependent on the ordering
of pointers in an std::map.

llvm-svn: 127650
2011-03-15 02:23:35 +00:00
Evan Cheng c5c2cfa381 sext(undef) = 0, because the top bits will all be the same.
zext(undef) = 0, because the top bits will be zero.

llvm-svn: 127649
2011-03-15 02:22:10 +00:00
Bill Wendling 928de16793 Testcase for r127630.
llvm-svn: 127648
2011-03-15 01:49:08 +00:00
Sean Callanan f2f4837de3 Basic sanity checks to ensure that 2- and 3-byte
VEX prefixes are working for triadic AVX
instructions.  This concludes the patch set to
enable AVX support for the X86 disassebler.

llvm-svn: 127647
2011-03-15 01:32:46 +00:00
Sean Callanan b60b0bc47e Enabled disassembler support for AVX instructions
in the instruction tables and fixed a few bugs that
were causing decode conflicts.  Rudimentary tests
are coming up in the next patch.

llvm-svn: 127646
2011-03-15 01:28:15 +00:00
Sean Callanan c3fd523731 X86 table-generator and disassembler support for the AVX
instruction set.  This code adds support for the VEX prefix
and for the YMM registers accessible on AVX-enabled
architectures.  Instruction table support that enables AVX
instructions for the disassembler is in an upcoming patch.

llvm-svn: 127644
2011-03-15 01:23:15 +00:00
Andrew Trick a34f1b1f10 Remove getMinusSCEVForExitTest().
This function performed acrobatics to prove no-self-wrap, which we now
have for free.

llvm-svn: 127643
2011-03-15 01:16:14 +00:00
Johnny Chen 7a2873dfbe Fixed an ARM disassembler bug where it does not handle STRi12 correctly because an extra
register operand was erroneously added.  Remove an incorrect assert which triggers the bug.

rdar://problem/9131529

llvm-svn: 127642
2011-03-15 01:13:17 +00:00
Ken Dyck 1c80fd1346 Introduce a CharUnits FieldOffsetInChars variable in AppendField() to
replace some uses of FieldOffsetInBytes. The remaining uses of
FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted
to CharUnits. No change in functionality intended.

llvm-svn: 127641
2011-03-15 01:09:02 +00:00
Bill Wendling 5c25a92011 There are some situations which can cause the URoR hack to infinitely recurse
and then go kablooie. The problem was that it was tracking the PHI nodes anew
each time into this function. But it didn't need to. And because the recursion
didn't know that a PHINode was visited before, it would go ahead and call
itself.

There is a testcase, but unfortunately it's too big to add. This problem will go
away with the EH rewrite.
<rdar://problem/8856298>

llvm-svn: 127640
2011-03-15 01:03:17 +00:00
Argyrios Kyrtzidis 669b0b1521 Stop leaking file descriptors.
After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -working-directory was passed, the code path that actually reuses & closes the already opened file descriptor
was not followed.

llvm-svn: 127639
2011-03-15 00:47:44 +00:00
Andrew Trick f6b01ff422 Propagate SCEV no-wrap flags whenever possible.
This needs review.

llvm-svn: 127638
2011-03-15 00:37:00 +00:00
Jim Grosbach 3af6fe66b9 Clean up ARM tail calls a bit. They're pseudo-instructions for normal branches.
Also more cleanly separate the ARM vs. Thumb functionality. Previously, the
encoding would be incorrect for some Thumb instructions (the indirect calls).

llvm-svn: 127637
2011-03-15 00:30:40 +00:00
Eric Christopher 2139d3148f If we don't know how long a string is we can't fold an _chk version to the
normal version.

Fixes rdar://9123638

llvm-svn: 127636
2011-03-15 00:25:41 +00:00
Jakob Stoklund Olesen fcaa2e1ba4 Revert r127617: "Code generation for noexcept."
The tests fail in a -Asserts build.

llvm-svn: 127635
2011-03-15 00:18:21 +00:00
Sean Callanan fb0b7583a7 Updated to LLVM/Clang revision 127600.
llvm-svn: 127634
2011-03-15 00:17:19 +00:00
Francois Pichet dfeda09345 Make llvm::Consumer a class (to remove a MSVC warning since Consumer is later forward declared as a struct)
llvm-svn: 127632
2011-03-14 23:07:21 +00:00
Bill Wendling e1fd78f2bc Generate a VTBL instruction instead of a series of loads and stores when we
can. As Nate pointed out, VTBL isn't super performant, but it *has* to be better
than this:

_shuf:
@ BB#0:       @ %entry
  push        {r4, r7, lr}
  add         r7, sp, #4
  sub         sp, #12
  mov         r4, sp
  bic         r4, r4, #7
  mov         sp, r4
  mov         r2, sp
  vmov        d16, r0, r1
  orr         r0, r2, #6
  orr         r3, r2, #7
  vst1.8      {d16[0]}, [r3]
  vst1.8      {d16[5]}, [r0]
  subs        r4, r7, #4
  orr         r0, r2, #5
  vst1.8      {d16[4]}, [r0]
  orr         r0, r2, #4
  vst1.8      {d16[4]}, [r0]
  orr         r0, r2, #3
  vst1.8      {d16[0]}, [r0]
  orr         r0, r2, #2
  vst1.8      {d16[2]}, [r0]
  orr         r0, r2, #1
  vst1.8      {d16[1]}, [r0]
  vst1.8      {d16[3]}, [r2]
  vldr.64     d16, [sp]
  vmov        r0, r1, d16
  mov         sp, r4
  pop         {r4, r7, pc}

The "illegal" testcase in vext.ll is no longer illegal.
<rdar://problem/9078775>

llvm-svn: 127630
2011-03-14 23:02:38 +00:00
John McCall e2eb807601 Version N of the llvm_unreachable patch: VC++ doesn't recognize that abort()
doesn't return, so just go back to using the old runtime function instead
of trying to use abort() when __builtin_unreachable (or an equivalent) isn't
supported.

llvm-svn: 127629
2011-03-14 22:41:50 +00:00
Renato Golin 4b6ae939ca This patch is a big refactoring of llvm-diff. It doesn't add new features, but it re-organizes the old features, so I can insert the MetadataEngine to use the same infrastructure.
llvm-svn: 127627
2011-03-14 22:22:46 +00:00
Jan Sjödin c9a16d581d Check that the AsmParser exists for the native target to enable initialization
function.

llvm-svn: 127626
2011-03-14 22:12:35 +00:00
Douglas Gregor 1e98986160 Disable 'auto' type deduction in Objective-C. It likes 'id' a bit too
much to be useful.

llvm-svn: 127625
2011-03-14 21:43:30 +00:00
Joerg Sonnenberger 161f9a3829 Sort
llvm-svn: 127624
2011-03-14 21:20:46 +00:00
Douglas Gregor 88764cf822 When synthesizing a label declaration based on a goto statement that
cannot yet be resolved, be sure to push the new label declaration into
the right place within the identifier chain. Otherwise, name lookup in
C++ gets confused when searching for names that are lexically closer
than the label. Fixes PR9463.

llvm-svn: 127623
2011-03-14 21:19:51 +00:00
Rafael Espindola 0c1f098284 Switch from internal to linker_private linkage, it is sufficient to please the new linker.
llvm-svn: 127622
2011-03-14 21:08:19 +00:00
Eric Christopher d3cc9fdd8e Fix this test up a bit.
llvm-svn: 127621
2011-03-14 21:05:21 +00:00
Jim Grosbach d97a665cff Trailing whitespace.
llvm-svn: 127620
2011-03-14 20:59:06 +00:00
Owen Anderson 0fabf10388 Ignore isCodeGenOnly instructions when generating diassembly tables.
llvm-svn: 127619
2011-03-14 20:58:49 +00:00
Jakob Stoklund Olesen 59a549b7ec Place context in member variables instead of passing around pointers.
Use the opportunity to get rid of the trailing underscore variable names.

llvm-svn: 127618
2011-03-14 20:57:14 +00:00
Sebastian Redl 97022fd325 Code generation for noexcept.
llvm-svn: 127617
2011-03-14 20:33:20 +00:00
Eric Christopher cf5e83b471 __clear_cache() is varargs and people will occasionally write it without
arguments. Process only the arguments that people write, but process
all of them.

Fixes rdar://8900346

llvm-svn: 127616
2011-03-14 20:30:34 +00:00
John McCall c525e3a114 Okay, some compilers complain if you provide the exception-specification
where none was before.  Just don't declare it and hope it's declared
in every translation unit that needs it.

llvm-svn: 127612
2011-03-14 20:20:29 +00:00
John McCall b9b8ea4018 Fix the exception-specification of abort() when declaring it in C++.
llvm-svn: 127610
2011-03-14 20:10:50 +00:00