Commit Graph

146891 Commits

Author SHA1 Message Date
Rafael Espindola 7b51ae8e0e Add hasExternalLinkageUncached back with the test that Richard provided, but
keep the call at the current location.

llvm-svn: 178741
2013-04-04 04:40:17 +00:00
Richard Smith 5dacbec4aa Don't build this test with modules for now, it's causing buildbot failures.
llvm-svn: 178740
2013-04-04 03:48:33 +00:00
Rafael Espindola 4dc336b20f Avoid computing the linkage instead of avoiding caching it.
This mostly reverts 178733, but keeps the tests.

I don't claim to understand how hidden sub modules work or when we need to see
them (is that documented?), but this has the same semantics and avoids adding
hasExternalLinkageUncached which has the same foot gun potential as the old
hasExternalLinkage.

Last but not least, not computing linkage when it is not needed is more
efficient.

llvm-svn: 178739
2013-04-04 03:27:32 +00:00
Jason Molenda 14aef12e24 Change EnumerateDirectory from using readdir() to using readdir_r()
so it can be re-entered while iterating over a directory safely.

llvm-svn: 178738
2013-04-04 03:19:27 +00:00
Jakob Stoklund Olesen 8cfaffaade Add SPARC v9 support for select on 64-bit compares.
This requires v9 cmov instructions using the %xcc flags instead of the
%icc flags.

Still missing:
- Select floats on %xcc flags.
- Select i64 on %fcc flags.

llvm-svn: 178737
2013-04-04 03:08:00 +00:00
Richard Smith 584f7dcc0e Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.
llvm-svn: 178736
2013-04-04 02:55:24 +00:00
Rafael Espindola 869fe0448b Fix linkage related crash.
This test was exactly the opposite of what it should be. We should check if
there old decl has linkage (where it makes sense) and if the new decl has
the extern keyword.

llvm-svn: 178735
2013-04-04 02:47:57 +00:00
Jim Ingham fce1dad042 The SBValue impl class's GetSP can now fetch the dynamic type or the synthetic
children - which it may have to compute.  Thus it needs to take the API lock.

<rdar://problem/13560869>

llvm-svn: 178734
2013-04-04 02:23:41 +00:00
Richard Smith 86c0d06194 Fix 41 of the 61 tests which fail with modules enabled: we were computing and
caching the linkage for a declaration before we set up its redeclaration chain,
when determining whether a declaration could be a redeclaration of something
from an unimported submodule. We actually want to look at the declaration as if
it were not a redeclaration here, so compute the linkage but don't cache it.

llvm-svn: 178733
2013-04-04 01:51:11 +00:00
Jim Ingham 3495127549 Change the default for "use-fast-stepping" to on.
<rdar://problem/11319574>

llvm-svn: 178732
2013-04-04 01:38:54 +00:00
John McCall e48f389ce6 Be sure to check ARC conventions on the implicit method declarations
of a property just in case the property's getter happens to be +1.
We won't synthesize a getter for such a property, but we will allow
the user to define a +1 method for it.
rdar://13115896

llvm-svn: 178731
2013-04-04 01:38:37 +00:00
Rafael Espindola 5a2af525ab Explicitly add -Wl,--export-all-symbols on mingw/cygwin.
Looks like cmake on windows is not expanding ENABLE_EXPORTS to
-Wl,--export-all-symbols on mingw or cygwin, so add this back.

llvm-svn: 178730
2013-04-04 01:19:55 +00:00
Enrico Granata e98184322a <rdar://problem/13563697>
The __NSArrayI synthetic children provider was running expressions to generate children, which is inefficient for large amounts of data
Reimplementing to use a faster algorithm

llvm-svn: 178729
2013-04-04 01:12:12 +00:00
Greg Clayton 24daef515a <rdar://problem/13198919>
Try and reap process when sending the "k" packet to avoid a race condition. We now wait for at most 1 second to reap the child process that we are killing.

llvm-svn: 178726
2013-04-04 01:01:35 +00:00
Rafael Espindola 76f92277ca Don't export symbols in every binary on linux.
On freebsd this makes sure that symbols are exported on the binaries that need
them. The net result is that we should get symbols in the binaries that need
them on every platform.

On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB.

Patch by Stephen Checkoway.

llvm-svn: 178725
2013-04-04 01:01:32 +00:00
Rafael Espindola 5515ff804f cmake: mark clang as needing exported symbol.
This is a nop right now, but committing this first avoids a temporary breakage
when the llvm files change to not default to exporting symbols.

llvm-svn: 178723
2013-04-04 00:58:40 +00:00
Manman Ren 5a15c9ed9f Debug Info: according to DWARF 2, FORM_ref_addr the same size as an address on
the target system.

It was hard-coded to 4 bytes before. I can't get llvm to generate a
ref_addr on a reasonably sized testing case.

rdar://problem/13559431

llvm-svn: 178722
2013-04-04 00:22:54 +00:00
John McCall 770a4c1a37 Protect the values of array and dictionary literals from the
ARC optimizer while they're held in local unsafe buffers.

Based on a patch by Jesse Rusak!

rdar://13573224

llvm-svn: 178721
2013-04-04 00:20:38 +00:00
Nico Weber 69a7914fec Make the ObjC attributes diagnostics a bit more informative.
llvm-svn: 178720
2013-04-04 00:15:10 +00:00
Greg Clayton 9ff5aae5b0 <rdar://problem/12897145>
Changes to lldb made the following fail when it used to work:

% cd /tmp
% lldb ls
error: unable to find executable for '/tmp/ls'

Resolving an executable with no relative path was broken, now its fixed.

llvm-svn: 178719
2013-04-04 00:15:09 +00:00
Greg Clayton d6e6ddd636 Revert code I didn't mean to check in.
llvm-svn: 178718
2013-04-04 00:07:32 +00:00
Greg Clayton abcbfe5369 More support for version 4 of DWARF.
llvm-svn: 178717
2013-04-04 00:00:36 +00:00
Tanya Lattner daa74b93c9 Update OpenCL comments to mention spec section and version.
llvm-svn: 178716
2013-04-03 23:55:58 +00:00
Michael Gottesman 21a4ed3227 Refactored out the helper method FindPredecessorAutoreleaseWithSafePath from ObjCARCOpt::OptimizeReturns.
Now ObjCARCOpt::OptimizeReturns is easy to read and reason about.

llvm-svn: 178715
2013-04-03 23:39:14 +00:00
Michael Gottesman 6908db148b Refactored out the helper function FindPredecessorRetainWithSafePath from ObjCARCOpt::OptimizeReturns.
llvm-svn: 178714
2013-04-03 23:16:05 +00:00
Evan Cheng 51a7a9d712 Make it possible to include llvm-c without including C++ headers. Patch by Filip Pizlo.
llvm-svn: 178713
2013-04-03 23:12:39 +00:00
Michael Gottesman c2d5bf5c53 Small cleanups.
Cleaned up trailing whitespace and added extra slashes in front of a
function level comment so that it follow the convention of having 3
slashes.

llvm-svn: 178712
2013-04-03 23:07:45 +00:00
Douglas Gregor 151976694a <rdar://problem/13560075> Teach name lookup for builtin names to find hidden declarations.
Normal name lookup ignores any hidden declarations. When name lookup
for builtin declarations fails, we just synthesize a new
declaration at the point of use. With modules, this could lead to
multiple declarations of the same builtin, if one came from a (hidden)
submodule that was later made visible. Teach name lookup to always
find builtin names, so we don't create these redundant declarations in
the first place.

llvm-svn: 178711
2013-04-03 23:06:26 +00:00
Michael Gottesman 54dc7fdefb Refactored out a part of ObjCARCOpt::OptimizeReturns into its own method HasSafePathToPredecessorCall.
llvm-svn: 178710
2013-04-03 23:04:28 +00:00
Michael Gottesman 0a1748bb8c Removed an old comment.
llvm-svn: 178709
2013-04-03 23:04:24 +00:00
Greg Clayton 7b619fc159 Playing around with making performance test cases run from within python.
llvm-svn: 178708
2013-04-03 22:59:27 +00:00
Richard Smith e8a9d61f47 Revert accidental commit.
llvm-svn: 178707
2013-04-03 22:50:34 +00:00
Richard Smith c0fbba7d8a Pare back r164351 somewhat. The problem that change was addressing was that we
don't serialize a lookup map for the translation unit outside C++ mode, so we
can't tell when lookup within the TU needs to look within modules. Only apply
the fix outside C++ mode, and only to the translation unit.

llvm-svn: 178706
2013-04-03 22:49:41 +00:00
Michael Gottesman 43e7e00a68 Clean up arc annotations by moving the top/bottom BB annotations into conditional macros that no-op in Release mode instead of #ifdef sections of the code.
This is to follow the example of the DEBUG macro.

llvm-svn: 178705
2013-04-03 22:41:59 +00:00
Greg Clayton de3d01e2c4 <rdar://problem/12789467>
Fixed an attach case for ARM that was imporperly detecting an application bundle when there wasn't one.

llvm-svn: 178704
2013-04-03 21:49:00 +00:00
Arnold Schwaighofer e9b5016411 X86 cost model: Vector shifts are expensive in most cases
The default logic does not correctly identify costs of casts because they are
marked as custom on x86.

For some cases, where the shift amount is a scalar we would be able to generate
better code. Unfortunately, when this is the case the value (the splat) will get
hoisted out of the loop, thereby making it invisible to ISel.

radar://13130673
radar://13537826

llvm-svn: 178703
2013-04-03 21:46:05 +00:00
Greg Clayton bc43cab51d <rdar://problem/13384801>
Make lldb_private::RegularExpression thread safe everywhere. This was done by removing the m_matches array from the lldb_private::RegularExpression class and putting it into the new lldb_private::RegularExpression::Match class. When executing a regular expression you now have the option to create a lldb_private::RegularExpression::Match object and pass a pointer in if you want to get parenthesized matching. If you don't want any matching, you pass in NULL. The lldb_private::RegularExpression::Match object is initialized with the number of matches you desire. Any matching strings are now extracted from the lldb_private::RegularExpression::Match objects. This makes the regular expression objects thread safe and as a result many more regex objects were turned into static objects that end up using a local lldb_private::RegularExpression::Match object when executing.

llvm-svn: 178702
2013-04-03 21:37:16 +00:00
Anna Zaks d3254b4462 [analyzer] Allow tracknullOrUndef look through the ternary operator even when condition is unknown
Improvement of r178684 and r178685.

Jordan has pointed out that I should not rely on the value of the condition to know which expression branch
has been taken. It will not work in cases the branch condition is an unknown value (ex: we do not track the constraints for floats).
The better way of doing this would be to find out if the current node is the right or left successor of the node
that has the ternary operator as a terminator (which is how this is done in other places, like ConditionBRVisitor).

llvm-svn: 178701
2013-04-03 21:34:12 +00:00
Rafael Espindola f24933f65e Fix build.
This should fix the build breakage caused by the api change in 178663.

llvm-svn: 178700
2013-04-03 21:29:21 +00:00
Argyrios Kyrtzidis f0eaa64c98 [preprocessor] Minor optimization following r178671.
Don't bother looking for parameter index of 'B' token if 'A' is not a parameter.

llvm-svn: 178699
2013-04-03 21:29:07 +00:00
John McCall c70fca60da Complain about attempts to befriend declarations via a using
declaration.  Patch by Stephen Lin!

llvm-svn: 178698
2013-04-03 21:19:47 +00:00
Jordan Rose 8647ffcda5 [analyzer] Correctly handle destructors for lifetime-extended temporaries.
The lifetime of a temporary can be extended when it is immediately bound
to a local reference:

  const Value &MyVal = Value("temporary");

In this case, the temporary object's lifetime is extended for the entire
scope of the reference; at the end of the scope it is destroyed.

The analyzer was modeling this improperly in two ways:
- Since we don't model temporary constructors just yet, we create a fake
  temporary region when it comes time to "materialize" a temporary into
  a real object (lvalue). This wasn't taking base casts into account when
  the bindings being materialized was Unknown; now it always respects base
  casts except when the temporary region is itself a pointer.
- When actually destroying the region, the analyzer did not actually load
  from the reference variable -- it was basically destroying the reference
  instead of its referent. Now it does do the load.

This will be more useful whenever we finally start modeling temporaries,
or at least those that get bound to local reference variables.

<rdar://problem/13552274>

llvm-svn: 178697
2013-04-03 21:16:58 +00:00
Greg Clayton a75f0ca30e <rdar://problem/13561911>
Modify LLDB to handle DW_FORM_ref_addr attributes for DWARF3 and DWARF4.

llvm-svn: 178696
2013-04-03 21:09:33 +00:00
Rafael Espindola 26cf0b5130 Update for API change for handling mips64el.
llvm-svn: 178695
2013-04-03 21:03:19 +00:00
Rafael Espindola 2025e8b820 Implement the "mips endian" for r_info.
Normally r_info is just a 32 of 64 bit number matching the endian of the rest
of the file. Unfortunately, mips 64 bit little endian is special: The top 32
bits are a little endian number and the following 32 are a big endian one.

llvm-svn: 178694
2013-04-03 21:02:51 +00:00
Rafael Espindola 13de1566d0 Update the lld testsuite for the llvm-readobj format change.
llvm-svn: 178693
2013-04-03 20:53:45 +00:00
Jason Molenda c01e1b72ad #include clang's AST/DeclCXX.h to pick up CXXRecordDecl definition,
needed for some versions of clang.

llvm-svn: 178692
2013-04-03 20:32:17 +00:00
Howard Hinnant ea48b6dcd0 Fix stupid but harmless type-o. Fixes http://llvm.org/bugs/show_bug.cgi?id=15657.
llvm-svn: 178691
2013-04-03 20:29:45 +00:00
Howard Hinnant 1347d33451 The move / swap members were not correctly taking all of the possible states of the basic_stringbuf into account. Just rewrote these members. Test included. This fixes http://llvm.org/bugs/show_bug.cgi?id=15659.
llvm-svn: 178690
2013-04-03 20:21:29 +00:00
Richard Osborne 122acb216c [XCore] Check disassembly of the st8 instruction.
llvm-svn: 178689
2013-04-03 20:07:11 +00:00