Commit Graph

122431 Commits

Author SHA1 Message Date
Dan Gohman 9017b846d4 Remove a comment about an alternative approach that wouldn't
actually work, at least as described. LLVM Metadata is not
intended to suppress LLVM IR rules, as it can be stripped at
any time.

llvm-svn: 150821
2012-02-17 18:33:38 +00:00
Jim Grosbach 905c952efa Tidy up.
llvm-svn: 150820
2012-02-17 17:35:10 +00:00
David Chisnall 07f8d3e4e9 Generate the correct EH frame section types on Solaris, this time without breaking other platforms...
llvm-svn: 150819
2012-02-17 17:31:15 +00:00
David Chisnall 85dd309e85 Revert r150814. It turns out that there is a good reason for this after all...
llvm-svn: 150818
2012-02-17 16:51:02 +00:00
Douglas Gregor 23b05417c9 De-nest tentative parsing to disambiguate lambdas from designators; no
functionality change.

llvm-svn: 150817
2012-02-17 16:41:16 +00:00
Jakob Stoklund Olesen fd7d1b47ba Revert r150288, "Allow Post-RA LICM to hoist reserved register reads."
This caused miscompilations on out-of-tree targets, and possibly i386 as
well.

I'll find some other way of hoisting %rip-relative loads from loops
containing calls.

llvm-svn: 150816
2012-02-17 16:40:44 +00:00
Richard Osborne 484980e37e Fix typo in comment.
llvm-svn: 150815
2012-02-17 16:39:47 +00:00
David Chisnall 38e25ab513 Don't lazily allocate eh_frame. We're not lazily allocating things like the LSDA, which are only used when the eh frame is used, so this lazy allocation doesn't really make sense.
Fix the type of eh_frame on Solaris so that Sun ld doesn't fail to combine them (thus making it impossible for the unwind library to find them and breaking exceptions).

llvm-svn: 150814
2012-02-17 16:32:07 +00:00
David Chisnall 368d460d35 ... and it's probably best to use the correct alignment, rather than just guessing that it's the same as the size.
llvm-svn: 150813
2012-02-17 16:30:39 +00:00
Alexey Samsonov 0d0b406aba AddressSanitizer: use custom strtol/atoll functions
llvm-svn: 150812
2012-02-17 16:15:09 +00:00
David Chisnall 8fa1716508 It turns out that putting an 8-byte symbol in a 4-byte section makes Solaris ld sulk. GNU ld is perfectly happy with it, which is worrying for a whole other set of reasons...
Thanks to Anton, Duncan and Rafael for helping me track this down.
Pointy hat to Rafael for introducing the bug in the first place.

llvm-svn: 150811
2012-02-17 16:05:50 +00:00
Nick Lewycky aed0553360 Remove question.
llvm-svn: 150809
2012-02-17 09:55:20 +00:00
Jia Liu 9f6101191b remove Emacs-tag form .cpp files in Mips Backend, and fix some typo.
llvm-svn: 150805
2012-02-17 08:55:11 +00:00
Sebastian Redl eb54f08aee Don't allow non-empty ParenListExprs as array-new initializers.
Don't know what I was thinking there. Fixes PR12023.

llvm-svn: 150804
2012-02-17 08:42:32 +00:00
Sebastian Redl c83ed8248e Basic code generation support for std::initializer_list.
We now generate temporary arrays to back std::initializer_list objects
initialized with braces. The initializer_list is then made to point at
the array. We support both ptr+size and start+end forms, although
the latter is untested.

Array lifetime is correct for temporary std::initializer_lists (e.g.
call arguments) and local variables. It is untested for new expressions
and member initializers.

Things left to do:
Massively increase the amount of testing. I need to write tests for
start+end init lists, temporary objects created as a side effect of
initializing init list objects, new expressions, member initialization,
creation of temporary objects (e.g. std::vector) for initializer lists,
and probably more.
Get lifetime "right" for member initializers and new expressions. Not
that either are very useful.
Implement list-initialization of array new expressions.

llvm-svn: 150803
2012-02-17 08:42:25 +00:00
Alexey Samsonov 8e7bfceb98 AddressSanitizer: fix lint
llvm-svn: 150802
2012-02-17 08:31:10 +00:00
Greg Clayton cc4d0146b4 This checking is part one of trying to add some threading safety to our
internals. The first part of this is to use a new class:

lldb_private::ExecutionContextRef

This class holds onto weak pointers to the target, process, thread and frame
and it also contains the thread ID and frame Stack ID in case the thread and
frame objects go away and come back as new objects that represent the same
logical thread/frame. 

ExecutionContextRef objcets have accessors to access shared pointers for
the target, process, thread and frame which might return NULL if the backing
object is no longer available. This allows for references to persistent program
state without needing to hold a shared pointer to each object and potentially
keeping that object around for longer than it needs to be. 

You can also "Lock" and ExecutionContextRef (which contains weak pointers)
object into an ExecutionContext (which contains strong, or shared pointers)
with code like

ExecutionContext exe_ctx (my_obj->GetExectionContextRef().Lock());

llvm-svn: 150801
2012-02-17 07:49:44 +00:00
Gregory Szorc dd19169988 [clang.py] Implement Type.element_count
llvm-svn: 150800
2012-02-17 07:47:38 +00:00
Gregory Szorc e1e9ec1082 [clang.py] Implement Type.element_type
llvm-svn: 150799
2012-02-17 07:44:46 +00:00
Richard Smith 08a5144621 The clang half of r150794: after the construction of a global or static const
variable ends, if the variable has a trivial destructor and no mutable
subobjects then emit an llvm.invariant.start call for it. globalopt knows to
make the variable const when evaluating this.

llvm-svn: 150798
2012-02-17 07:31:37 +00:00
Eric Christopher 2939e6e136 Index "12" holds the vtable, not "9".
Fixes lots of gdb testsuite failures.

llvm-svn: 150797
2012-02-17 07:09:48 +00:00
Eric Christopher b23b32e43b Typo in variable name.
llvm-svn: 150796
2012-02-17 07:08:46 +00:00
Craig Topper ba172d2d59 Remove the last of the old vector_shuffle patterns from X86 isel.
llvm-svn: 150795
2012-02-17 07:02:34 +00:00
Nick Lewycky 68f9f9d9c8 Add support for invariant.start inside the static constructor evaluator. This is
useful to represent a variable that is const in the source but can't be constant
in the IR because of a non-trivial constructor. If globalopt evaluates the
constructor, and there was an invariant.start with no matching invariant.end
possible, it will mark the global constant afterwards.

llvm-svn: 150794
2012-02-17 06:59:21 +00:00
Richard Smith e070fd2ac8 Bug fix: do not emit static const local variables with mutable members
as constants.

Refactor and simplify all the separate checks for whether a type can be
emitted as a constant.

llvm-svn: 150793
2012-02-17 06:48:11 +00:00
Richard Smith ae819500a1 When performing IRGen on a global, emit it as a constant if:
1) It has a const-qualified type, and
 2) It has no mutable members, and
 3) It has no dynamic initialization, and
 4) It has trivial destruction.
Remove the unnecessary requirement that the type be POD. This allows us to
mark all constexpr objects with no mutable members as 'constant'.

llvm-svn: 150792
2012-02-17 04:54:50 +00:00
Douglas Gregor 7ae3c75d97 Only add 'const' to the type of variables captured in a lambda when
we're capturing it by value in a non-mutable lambda.

llvm-svn: 150791
2012-02-17 04:02:59 +00:00
Douglas Gregor a80cae11f6 Disambiguate between C++11 lambda expressions and C99 array
designators in the parser. In the worst case, this disambiguation
requires tentative parsing just past the closing ']', but for most
cases we'll be able to tell by looking ahead just one token (without
going into the heavyweight tentative parsing machinery).

llvm-svn: 150790
2012-02-17 03:49:44 +00:00
Richard Smith 14a941380a Make sure all remaining parts of the constant evaluator are aware that an array
can be represented by an LValue, and use that to simplify the code a little.

llvm-svn: 150789
2012-02-17 03:35:37 +00:00
John McCall a729c62b81 Whether an argument is required (in contrast with being an
optional argument passed through the variadic ellipsis)
potentially affects how we need to lower it.  Propagate
this information down to the various getFunctionInfo(...)
overloads on CodeGenTypes.  Furthermore, rename those
overloads to clarify their distinct purposes, and make
sure we're calling the right one in the right place.
This has a nice side-effect of making it easier to construct
a function type, since the 'variadic' bit is no longer
separable.

This shouldn't really change anything for our existing
platforms, with one minor exception --- we should now call
variadic ObjC methods with the ... in the "right place"
(see the test case), which I guess matters for anyone
running GNUStep on MIPS.  Mostly it's just a substantial
clean-up.

llvm-svn: 150788
2012-02-17 03:33:10 +00:00
John McCall c833deaa09 Block expressions always have a prototyped function type; expose this
in the AST accessor and micro-optimize it very slightly.

llvm-svn: 150787
2012-02-17 03:32:35 +00:00
John McCall 1e25a97ae2 Add a castAs<U> accessor to CanQual<T>.
llvm-svn: 150786
2012-02-17 03:32:17 +00:00
Enrico Granata 400d1f44d1 reverting unwanted changes to scheme files with previous commit
llvm-svn: 150785
2012-02-17 03:20:23 +00:00
Enrico Granata 864e3e8413 Adding formatters for several useful Objective-C/Cocoa data types. The new categories are not enabled at startup, but can be manually activated if desired.
Adding new API calls to SBValue to be able to retrieve the associated formatters
Some refactoring to FormatNavigator::Get() in order to shrink its size down to more manageable terms (a future, massive, refactoring effort will still be needed)
Test cases added for the above

llvm-svn: 150784
2012-02-17 03:18:30 +00:00
Douglas Gregor 355efbb2e0 Rework the Sema/AST/IRgen dance for the lambda closure type's
conversion to function pointer. Rather than having IRgen synthesize
the body of this function, we instead introduce a static member
function "__invoke" with the same signature as the lambda's
operator() in the AST. Sema then generates a body for the conversion
to function pointer which simply returns the address of __invoke. This
approach makes it easier to evaluate a call to the conversion function
as a constant, makes the linkage of the __invoke function follow the
normal rules for member functions, and may make life easier down the
road if we ever want to constexpr'ify some of lambdas.

Note that IR generation is responsible for filling in the body of
__invoke (Sema just adds a dummy body), because the body can't
generally be expressed in C++.

Eli, please review!

llvm-svn: 150783
2012-02-17 03:02:34 +00:00
Akira Hatanaka d608bac682 Do not promote i32 arguments to i64. This was causing unnecessary sign extension
instructions to be emitted.

llvm-svn: 150782
2012-02-17 02:20:26 +00:00
Greg Clayton 23a17953e7 Fixed an error with the 'G' packet on ARM when using the default GDB
register set where it could get an error when trying to restore the
fake "f0" - "f7" 12 byte float regs.

llvm-svn: 150781
2012-02-17 02:13:09 +00:00
Bill Wendling aa9a3eae79 Remove redundant comment. Use a more efficient datatype.
llvm-svn: 150780
2012-02-17 02:12:54 +00:00
Bill Wendling 0a8fec2762 Fix some grammar-os and formatting.
llvm-svn: 150779
2012-02-17 02:09:28 +00:00
Lang Hames 3eedcce906 Reverse iterator - should be incrementing rather than decrementing.
llvm-svn: 150778
2012-02-17 01:54:11 +00:00
Richard Smith 50965d9331 Tests for the fixits which Doug added in r150727.
llvm-svn: 150777
2012-02-17 01:39:04 +00:00
Richard Smith 1002d10aaa Reject continue/break statements within members of local functions nested within
loop and switch statements, by teaching Scope that a function scope never has
a continue/break parent for the purposes of control flow. Remove the hack in
block and lambda expressions which worked around this by pretending that such
expressions were continue/break scopes.

Remove Scope::ControlParent, since it's unused.

In passing, teach default statements to recover properly from a missing ';', and
add a fixit for same to both default and case labels (the latter already
recovered correctly).

llvm-svn: 150776
2012-02-17 01:35:32 +00:00
Jia Liu dd6c1cd4e8 add Emacs tag and fix some comment error in file headers
llvm-svn: 150775
2012-02-17 01:23:50 +00:00
Chad Rosier fcd29ae390 [fast-isel] Add support for returning non-legal types with no sign- or zero-
entend flag.

llvm-svn: 150774
2012-02-17 01:21:28 +00:00
Lang Hames d9f2152a2e MachineScheduler shouldn't use/preserve LiveDebugVariables.
llvm-svn: 150773
2012-02-17 01:11:37 +00:00
Sean Callanan 95e5c63012 Added a new disassembler plugin, DisassemblerLLVMC,
which uses the Disassembler.h interface to the LLVM
disassemblers rather than the EnhancedDisassembly.h
interface.  Disassembler.h is a better-maintained
API and will be stabler in the long term.

Currently the output from Disassembler.h does not
provide for symbolic disassembly in all the places
that the old disassembler did, so I have gated (and
disabled) the disassembler.  It'll be easy to flip
the switch later.

In the meantime, to enable the new disassembler,
uncomment "#define USE_NEW_DISASSEMBLER" in
lldb.cpp.

llvm-svn: 150772
2012-02-17 00:53:45 +00:00
Lang Hames def9c61e4b Oops - isRegLiveIntoSuccessor is used in non-assert builds now. Remove NDEBUG guards.
llvm-svn: 150771
2012-02-17 00:51:32 +00:00
Richard Smith 5d108606cc PR12012: Fix a regression in r150419 where we would try (and fail) to
zero-initialize class types with virtual bases when constant-evaluating an
initializer.

llvm-svn: 150770
2012-02-17 00:44:16 +00:00
Lang Hames 5bade3dc6e Re-enable 150652 and 150654 - Make FPSCR non-reserved, and make MachineCSE bail on reserved registers. This *should* be safe as of r150786.
llvm-svn: 150769
2012-02-17 00:27:16 +00:00
Lang Hames 0d72bb49f0 Turn off assertion, conservatively compute liveness for live-in un-allocatable registers.
llvm-svn: 150768
2012-02-17 00:18:18 +00:00