Commit Graph

99292 Commits

Author SHA1 Message Date
Cameron Zwarich 67431d7943 Roll out r123609 due to failures on the llvm-x86_64-linux-checks bot.
llvm-svn: 123618
2011-01-17 07:26:51 +00:00
Greg Clayton 388b33b5cd Another fix for the objective C runtime object checker to not use NULL when it isn't defined.
llvm-svn: 123617
2011-01-17 06:17:42 +00:00
Greg Clayton 23af0d896d Fixed the C string summary formatter to not get into an infinite loop for
long strings in "char *" (with any combo if qualifiers).

llvm-svn: 123616
2011-01-17 05:51:02 +00:00
Greg Clayton 7d87b92d2e Fix the objective C object validator that I broke. When we have ObjC runtime
V2 and we only have gdb_class_getClass, then make sure the isa isn't NULL 
before trying to call gdb_class_getClass otherwise we end up deadlocking the
objective C runtime.

llvm-svn: 123615
2011-01-17 04:34:26 +00:00
Greg Clayton 47a15b7c0b Added missing source files.
llvm-svn: 123614
2011-01-17 04:19:51 +00:00
Greg Clayton 6beaaa680a A few of the issue I have been trying to track down and fix have been due to
the way LLDB lazily gets complete definitions for types within the debug info.
When we run across a class/struct/union definition in the DWARF, we will only
parse the full definition if we need to. This works fine for top level types
that are assigned directly to variables and arguments, but when we have a 
variable with a class, lets say "A" for this example, that has a member:
"B *m_b". Initially we don't need to hunt down a definition for this class
unless we are ever asked to do something with it ("expr m_b->getDecl()" for
example). With my previous approach to lazy type completion, we would be able
to take a "A *a" and get a complete type for it, but we wouldn't be able to
then do an "a->m_b->getDecl()" unless we always expanded all types within a
class prior to handing out the type. Expanding everything is very costly and
it would be great if there were a better way.

A few months ago I worked with the llvm/clang folks to have the 
ExternalASTSource class be able to complete classes if there weren't completed
yet:

class ExternalASTSource {
....

    virtual void
    CompleteType (clang::TagDecl *Tag);
    
    virtual void 
    CompleteType (clang::ObjCInterfaceDecl *Class);
};

This was great, because we can now have the class that is producing the AST
(SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources
and the object that creates the forward declaration types can now also
complete them anywhere within the clang type system.

This patch makes a few major changes:
- lldb_private::Module classes now own the AST context. Previously the TypeList
  objects did.
- The DWARF parsers now sign up as an external AST sources so they can complete
  types.
- All of the pure clang type system wrapper code we have in LLDB (ClangASTContext,
  ClangASTType, and more) can now be iterating through children of any type,
  and if a class/union/struct type (clang::RecordType or ObjC interface) 
  is found that is incomplete, we can ask the AST to get the definition. 
- The SymbolFileDWARFDebugMap class now will create and use a single AST that
  all child SymbolFileDWARF classes will share (much like what happens when
  we have a complete linked DWARF for an executable).
  
We will need to modify some of the ClangUserExpression code to take more 
advantage of this completion ability in the near future. Meanwhile we should
be better off now that we can be accessing any children of variables through
pointers and always be able to resolve the clang type if needed.

llvm-svn: 123613
2011-01-17 03:46:26 +00:00
Anders Carlsson 0acd4cfc33 Remove dead code.
llvm-svn: 123612
2011-01-17 03:13:24 +00:00
Anders Carlsson 5610490cdf Change ParseOptionalCXX0XVirtSpecifierSeq to take a VirtSpecifiers struct.
Enforce C++[class.mem]p8:
A virt-specifier-seq shall contain at most one of each virt-specifier.

llvm-svn: 123611
2011-01-17 03:05:47 +00:00
Francois Pichet 7cade2cd2f Suppress warning "switch statement contains 'default' but no 'case' labels" on MSVC.
llvm-svn: 123610
2011-01-17 02:07:17 +00:00
Cameron Zwarich 814cd9233e Eliminate the use of dominance frontiers in PromoteMemToReg. In addition to
eliminating a potentially quadratic data structure, this also gives a 17%
speedup when running -scalarrepl on test-suite + SPEC2000 + SPEC2006. My initial
experiment gave a greater speedup around 25%, but I moved the dominator tree
level computation from dominator tree construction to PromoteMemToReg.

Since this approach to computing IDFs has a much lower overhead than the old
code using precomputed DFs, it is worth looking at using this new code for the
second scalarrepl pass as well.

llvm-svn: 123609
2011-01-17 01:08:59 +00:00
Francois Pichet 7d92ee3852 Remove a c++ file test I inadvertently added in Sema last week.
llvm-svn: 123608
2011-01-17 01:08:01 +00:00
Francois Pichet 834bfbf147 Revert r123600.
llvm-svn: 123607
2011-01-17 00:56:42 +00:00
Anders Carlsson 11fdbbc1ad Begin work on supporting "N3206: Override control: Eliminating Attributes", from
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm

This lands support for parsing virt-specifier-seq after member functions, including the
contextual keywords 'final', and 'override'. The keywords are not yet used for anything.

llvm-svn: 123606
2011-01-16 23:56:42 +00:00
Michael J. Spencer 5ce56081c7 UnRevert "Revert "Archive: Replace all internal uses of PathV1 with PathV2. The external API still uses PathV1.""
llvm-svn: 123605
2011-01-16 23:39:59 +00:00
Michael J. Spencer ec202ee69a Fix rename.
llvm-svn: 123604
2011-01-16 22:18:41 +00:00
Anders Carlsson 128ddbf412 Fix a bug where the -Wmissing-noreturn would always treat constructors with base or member initializers as noreturn.
llvm-svn: 123603
2011-01-16 22:12:43 +00:00
Anders Carlsson 36ecb1f208 Add AnalysisContext::dumpCFG.
llvm-svn: 123602
2011-01-16 22:05:23 +00:00
Nick Lewycky 872a453ada Test for lazy value info's ability to prove the absense of NULLs in pointers.
llvm-svn: 123601
2011-01-16 21:57:20 +00:00
Francois Pichet cb0527c20d Downgrade ext_enumerator_too_large from ExtWarn to Extension in Microsoft mode. Otherwise you can warnings flooding trying to selfhost clang with fms-extensions because of "unsigned int" -> "signed int" enumerator conversion.
llvm-svn: 123600
2011-01-16 21:44:17 +00:00
Michael J. Spencer 4e51541319 Make everyone happy this time.
llvm-svn: 123599
2011-01-16 21:34:34 +00:00
Anton Korobeynikov 27fc8f6467 Provide instruction sizes for ARMv5 variants of MUL instructions.
This fixes PR8987

llvm-svn: 123598
2011-01-16 21:28:33 +00:00
Anders Carlsson 6a5171ba68 Update README.txt to remove the DAE enhancement.
llvm-svn: 123597
2011-01-16 21:26:15 +00:00
Anders Carlsson d3db83349e Teach DAE to look for functions whose arguments are unused, and change all callers to pass in an undefvalue instead.
llvm-svn: 123596
2011-01-16 21:25:33 +00:00
Michael J. Spencer 405e958ac3 UnRevert "Revert the archive part of "Support/PathV2: Add identify_magic.""
This reverts commit dd103021a889a986a181ce36ed7b0e8dc9b645e1.

llvm-svn: 123595
2011-01-16 21:13:51 +00:00
Michael J. Spencer 12a620fd58 Try and fix this test. For some reason llvm-ar thinks that the file exists when
it shouldn't, but I have no way to verify that it doesn't actually exist on the
buildbot.

llvm-svn: 123594
2011-01-16 20:52:58 +00:00
Michael J. Spencer c2caa2133c Revert the archive part of "Support/PathV2: Add identify_magic."
llvm-svn: 123593
2011-01-16 19:56:42 +00:00
Stephen Wilson 2103e25e19 Initial support for a DynamicLoader plugin on Linux.
This patch is enough to have shared objects recognized by LLDB.  We can handle
position independent executables.  We can handle dynamically loaded modules
brought in via dlopen.

The DYLDRendezvous class provides an interface to a structure present in the
address space of ELF-based processes.  This structure provides the address of a
function which is called by the linker each time a shared object is loaded and
unloaded (thus a breakpoint at that address will let LLDB intercept such
events), a list of entries describing the currently loaded shared objects, plus
a few other things.

On Linux, processes are brought up with an auxiliary vector on the stack.  One
element in this vector contains the (possibly dynamic) entry address of the
process.  One does not need to walk the stack to find this information as it is
also available under /proc/<pid>/auxv.  The new AuxVector class provides a
convenient read-only view of this auxiliary vector information.  We use the
dynamic entry address and the address as specified in the object file to compute
the actual load address of the inferior image.  This strategy works for both
normal executables and PIE's.

llvm-svn: 123592
2011-01-16 19:45:39 +00:00
Rafael Espindola ec517cdf24 Update tests.
llvm-svn: 123591
2011-01-16 18:02:57 +00:00
Chris Lattner 7c9f4c9c2b tidy up a comment, as suggested by duncan
llvm-svn: 123590
2011-01-16 17:46:19 +00:00
Rafael Espindola cba4c33949 Only put unnamed_addr constants in mergeable sections. Fixes PR8297.
llvm-svn: 123585
2011-01-16 17:19:34 +00:00
Rafael Espindola 751677a040 Don't merge two constants if we care about the address of both.
This fixes the original testcase in PR8927. It also causes a clang
binary built with a patched clang to increase in size by 0.21%.

We can probably get some of the size back by writing a pass that
detects that a global never has its pointer compared and adds
unnamed_addr to it (maybe extend global opt). It is also possible that
there are some other cases clang could add unnamed_addr to.

I will investigate extending globalopt next.

llvm-svn: 123584
2011-01-16 17:05:09 +00:00
Stephen Wilson 811975d59e Make a mandatory call to DestroyThread() in ~LinuxThread().
llvm-svn: 123583
2011-01-16 16:56:16 +00:00
Douglas Gregor c124e59c90 Emit an extension diagnostic for C99 designated initializers that appear in C++ code
llvm-svn: 123582
2011-01-16 16:13:16 +00:00
Douglas Gregor cef1a03eb5 Tweak the partial ordering rules for function templates to prefer a
non-variadic function template over a variadic one. This matches GCC
and the intent of the C++0x wording, in a way that I think is likely
to be acceptable to the committee.

llvm-svn: 123581
2011-01-16 16:03:23 +00:00
Jay Foad bbb91f2b22 Simplify the construction and destruction of Uses. Simplify
User::dropHungOffUses().

llvm-svn: 123580
2011-01-16 15:30:52 +00:00
Owen Anderson ec3b10fc56 Reduce and merge testcases.
llvm-svn: 123579
2011-01-16 09:13:31 +00:00
Chris Lattner 35a2e65bcb fix PR8514, a bug where the "heroic" transformation of shift/and
into and/shift would cause nodes to move around and a dangling pointer
to happen.  The code tried to avoid this with a HandleSDNode, but 
got the details wrong.

llvm-svn: 123578
2011-01-16 08:48:11 +00:00
Jay Foad 5ded9df82a Remove unnecessary specialization OperandTraits<User>.
llvm-svn: 123577
2011-01-16 08:23:16 +00:00
Chris Lattner 906bb9047a improve compatibility with GCC: when generating the ".d" filename to use
and the filename has multiple .'s in it, use the last.  For example, "foo.bar.cpp"
should produce "foo.bar.d" not "foo.d".  Patch by Johan Boule in PR8391

llvm-svn: 123576
2011-01-16 08:14:11 +00:00
Jay Foad 59809c7a62 Move the implementation of the User class into a new source file,
User.cpp.

llvm-svn: 123575
2011-01-16 08:10:57 +00:00
Chris Lattner e5f8de8639 fix PR8932, a case where arg promotion could infinitely promote.
llvm-svn: 123574
2011-01-16 08:09:24 +00:00
Chris Lattner ed1fb92cfe simplify a little
llvm-svn: 123573
2011-01-16 07:11:21 +00:00
Chris Lattner c326ebd118 add some commentary
llvm-svn: 123572
2011-01-16 06:39:44 +00:00
Chris Lattner 6fab2e9418 if an alloca is only ever accessed as a unit, and is accessed with load/store instructions,
then don't try to decimate it into its individual pieces.  This will just make a mess of the
IR and is pointless if none of the elements are individually accessed.  This was generating
really terrible code for std::bitset (PR8980) because it happens to be lowered by clang
as an {[8 x i8]} structure instead of {i64}.

The testcase now is optimized to:

define i64 @test2(i64 %X) {
  br label %L2

L2:                                               ; preds = %0
  ret i64 %X
}

before we generated:

define i64 @test2(i64 %X) {
  %sroa.store.elt = lshr i64 %X, 56
  %1 = trunc i64 %sroa.store.elt to i8
  %sroa.store.elt8 = lshr i64 %X, 48
  %2 = trunc i64 %sroa.store.elt8 to i8
  %sroa.store.elt9 = lshr i64 %X, 40
  %3 = trunc i64 %sroa.store.elt9 to i8
  %sroa.store.elt10 = lshr i64 %X, 32
  %4 = trunc i64 %sroa.store.elt10 to i8
  %sroa.store.elt11 = lshr i64 %X, 24
  %5 = trunc i64 %sroa.store.elt11 to i8
  %sroa.store.elt12 = lshr i64 %X, 16
  %6 = trunc i64 %sroa.store.elt12 to i8
  %sroa.store.elt13 = lshr i64 %X, 8
  %7 = trunc i64 %sroa.store.elt13 to i8
  %8 = trunc i64 %X to i8
  br label %L2

L2:                                               ; preds = %0
  %9 = zext i8 %1 to i64
  %10 = shl i64 %9, 56
  %11 = zext i8 %2 to i64
  %12 = shl i64 %11, 48
  %13 = or i64 %12, %10
  %14 = zext i8 %3 to i64
  %15 = shl i64 %14, 40
  %16 = or i64 %15, %13
  %17 = zext i8 %4 to i64
  %18 = shl i64 %17, 32
  %19 = or i64 %18, %16
  %20 = zext i8 %5 to i64
  %21 = shl i64 %20, 24
  %22 = or i64 %21, %19
  %23 = zext i8 %6 to i64
  %24 = shl i64 %23, 16
  %25 = or i64 %24, %22
  %26 = zext i8 %7 to i64
  %27 = shl i64 %26, 8
  %28 = or i64 %27, %25
  %29 = zext i8 %8 to i64
  %30 = or i64 %29, %28
  ret i64 %30
}

In this case, instcombine was able to eliminate the nonsense, but in PR8980 enough
PHIs are in play that instcombine backs off.  It's better to not generate this stuff
in the first place.

llvm-svn: 123571
2011-01-16 06:18:28 +00:00
Chris Lattner 7cd8cf7d24 Use an irbuilder to get some trivial constant folding when doing a store
of a constant.

llvm-svn: 123570
2011-01-16 05:58:24 +00:00
Chris Lattner adb1a233b1 remove a dead check, this was needed before we had an explicit veto on uses of phis.
llvm-svn: 123569
2011-01-16 05:37:55 +00:00
Chris Lattner d55581ded8 enhance FoldOpIntoPhi in instcombine to try harder when a phi has
multiple uses.  In some cases, all the uses are the same operation,
so instcombine can go ahead and promote the phi.  In the testcase
this pushes an add out of the loop.

llvm-svn: 123568
2011-01-16 05:28:59 +00:00
Evan Cheng 572756ac11 Spill R4 if it's going to be used to restore SP from FP.
llvm-svn: 123567
2011-01-16 05:14:33 +00:00
Chris Lattner ea7131a062 remove the AllowAggressive argument to FoldOpIntoPhi. It is forced to false in the
first line of the function because it isn't a good idea, even for compares.

llvm-svn: 123566
2011-01-16 05:14:26 +00:00
Chris Lattner ff2e737714 more cleanups: use the IR builder.
llvm-svn: 123565
2011-01-16 05:08:00 +00:00