Commit Graph

112382 Commits

Author SHA1 Message Date
Richard Trieu d33e46e943 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseConditionalForNull()
CheckConditionalOperands()
IsArithmeticBinaryExpr()
DiagnoseConditionalPrecedence()

llvm-svn: 139167
2011-09-06 20:06:39 +00:00
Johnny Chen 1d6bad0b47 Add a data type WatchpointLocationList to the repository. A Target contains an instance of watchpoint location list.
Also add a typefed for WatchpointLocationSP to lldb-forward-rtti.h.

llvm-svn: 139166
2011-09-06 20:05:25 +00:00
Benjamin Kramer 499c68b5f6 Spelling.
llvm-svn: 139165
2011-09-06 19:57:14 +00:00
Richard Trieu 9a52fbb2d0 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleIntegerConversion()
UsualArithmeticConversions()

llvm-svn: 139164
2011-09-06 19:52:52 +00:00
Johnny Chen 86f97a417d DNBBreakpoint::SetEnabled() should take a bool, not a uint32_t, as its input argument.
Plus for watchpoint related functions, add new macros INVALID_NUB_WATCH_ID and
NUB_WATCH_ID_IS_VALID and use them, instead.

llvm-svn: 139163
2011-09-06 19:52:49 +00:00
Ted Kremenek fed48af3de Don't emit -Wpadded warnings without a valid SourceLocation. This can happen when RecordLayoutBuilder is used by Codegen, not Sema.
llvm-svn: 139162
2011-09-06 19:40:45 +00:00
Rafael Espindola 9d96c94278 Fix comment. Noticed by Duncan.
llvm-svn: 139161
2011-09-06 19:29:31 +00:00
Enrico Granata 9128ee2f7a Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
   a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
   in frozen objects ; now such reads transparently move from host to target as required
 - as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
   removed code that enabled to recognize an expression result VO as such
 - introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
   representing a T* or T[], and doing dereferences transparently
   in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
 - as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
   en lieu of doing the raw read itself
 - introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
   this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
   in public layer this returns an SBData, just like GetPointeeData()
 - introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
   the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
   of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
 - added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
 of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
 addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types

llvm-svn: 139160
2011-09-06 19:20:51 +00:00
Duncan Sands f2641e1bc1 Add codegen support for vector select (in the IR this means a select
with a vector condition); such selects become VSELECT codegen nodes.
This patch also removes VSETCC codegen nodes, unifying them with SETCC
nodes (codegen was actually often using SETCC for vector SETCC already).
This ensures that various DAG combiner optimizations kick in for vector
comparisons.  Passes dragonegg bootstrap with no testsuite regressions
(nightly testsuite as well as "make check-all").  Patch mostly by
Nadav Rotem.

llvm-svn: 139159
2011-09-06 19:07:46 +00:00
Eli Friedman cf9b1f6524 Rearrange code so that we pass the right pointer to delete[] when an exception is thrown constructing the array elements in an array new expression. Fixes PR10870.
llvm-svn: 139158
2011-09-06 18:53:03 +00:00
Evan Cheng 0b758ed6ba Fix fall outs from my recent change on how carry bit is modeled during isel.
Now the 'S' instructions, e.g. ADDS, treat S bit as optional operand as well.
Also fix isel hook to correctly set the optional operand.
rdar://10073745

llvm-svn: 139157
2011-09-06 18:52:20 +00:00
Devang Patel c10e52a0c4 Use IRBuilder.
llvm-svn: 139156
2011-09-06 18:49:53 +00:00
Jim Grosbach f471ac3c72 ARM .code directive should always go to the streamer.
Even if there's no mode switch performed, the .code directive should still
be sent to the output streamer. Otherwise, for example, an output asm stream
is not equivalent to the input stream which generated it (a dependency on
the input target triple arm vs. thumb is introduced which was not originally
there).

llvm-svn: 139155
2011-09-06 18:46:23 +00:00
Rafael Espindola db5823dc77 Fix style issues and typos found by Duncan.
llvm-svn: 139154
2011-09-06 18:43:08 +00:00
Richard Trieu cfe3f21cec Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleFloatConversion()
handleComplexIntConvsersion()

llvm-svn: 139153
2011-09-06 18:38:41 +00:00
Bill Wendling 9803abb788 As a first step, emit both the compact unwind and CIE/FDEs for a function.
llvm-svn: 139152
2011-09-06 18:37:11 +00:00
Richard Trieu 5065cdd0ea Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleComplexFloatToComplexFloatConverstion()
handleComplexFloatConversion()

llvm-svn: 139151
2011-09-06 18:25:09 +00:00
Owen Anderson 58704ee442 Try again at r138809 (make DSE more aggressive in removing dead stores at the end of a function), now with less deleting stores before memcpy's.
llvm-svn: 139150
2011-09-06 18:14:09 +00:00
Richard Smith a8a5c402bb Advertise support for cxx_range_for as an extension in C++98 mode. Patch by Jean-Daniel Dupas!
Also provide a modicum of test coverage for ranged for in C++98.

llvm-svn: 139149
2011-09-06 18:03:41 +00:00
Jakob Stoklund Olesen 50ef7611aa Atomic pseudos don't use (as in read) CPSR. They clobber it.
llvm-svn: 139148
2011-09-06 17:40:35 +00:00
Devang Patel 5ea5d7965b Now, named mdnode llvm.dbg.cu keeps track of all compile units in a module. Update DebugInfoFinder to collect compile units from llvm.dbg.cu.
llvm-svn: 139147
2011-09-06 17:40:08 +00:00
Douglas Gregor cd0d826001 Finish implementing (de-)serialization of the CXXDefinitionData bits
needed for implicit move constructors and move assignment
operators. Fixes PR10847.

llvm-svn: 139144
2011-09-06 16:38:46 +00:00
Douglas Gregor 146b8e9a58 When performing a derived-to-base cast on the right-hand side of the
synthesized move assignment within an implicitly-defined move
assignment operator, be sure to treat the derived-to-base cast as an
xvalue (rather than an lvalue). Otherwise, we'll end up getting the
wrong constructor.

Optimize a direct call to a trivial move assignment operator to an
aggregate copy, as we do for trivial copy assignment operators, and
update the the assertion in CodeGenFunction::EmitAggregateCopy() to
cope with this optimization.

Fixes PR10860.

llvm-svn: 139143
2011-09-06 16:26:56 +00:00
Duncan Sands a098436b32 Split the init.trampoline intrinsic, which currently combines GCC's
init.trampoline and adjust.trampoline intrinsics, into two intrinsics
like in GCC.  While having one combined intrinsic is tempting, it is
not natural because typically the trampoline initialization needs to
be done in one function, and the result of adjust trampoline is needed
in a different (nested) function.  To get around this llvm-gcc hacks the
nested function lowering code to insert an additional parent variable
holding the adjust.trampoline result that can be accessed from the child
function.  Dragonegg doesn't have the luxury of tweaking GCC code, so it
stored the result of adjust.trampoline in the memory GCC set aside for
the trampoline itself (this is always available in the child function),
and set up some new memory (using an alloca) to hold the trampoline.
Unfortunately this breaks Go which allocates trampoline memory on the
heap and wants to use it even after the parent has exited (!).  Rather
than doing even more hacks to get Go working, it seemed best to just use
two intrinsics like in GCC.  Patch mostly by Sanjoy Das.

llvm-svn: 139140
2011-09-06 13:37:06 +00:00
Nick Lewycky 78664db054 Fix typo in comment again.
llvm-svn: 139139
2011-09-06 07:02:40 +00:00
Nick Lewycky 237878b7ac Apparently we compile the code, not the comments. Thanks Eli!
llvm-svn: 139138
2011-09-06 06:56:00 +00:00
Nick Lewycky 0af94cc50b Fix typo in comment.
llvm-svn: 139137
2011-09-06 06:46:01 +00:00
Nick Lewycky 702cf1eccc Nope! I had it right the first time. Revert the operative part of r139135 and
add more showing of my work.

llvm-svn: 139136
2011-09-06 06:39:54 +00:00
Nick Lewycky 6f86e001d6 Fix flipped sign. While there, show my math.
llvm-svn: 139135
2011-09-06 05:33:18 +00:00
Nick Lewycky db66b82dd5 No no no, fix typo properly!
llvm-svn: 139134
2011-09-06 05:08:09 +00:00
Nick Lewycky 658bdb5133 The logic inside getMulExpr to simplify {a,+,b}*{c,+,d} was wrong, which was
visible given a=b=c=d=1, on iteration #1 (the second iteration). Replace it with
correct math. Fixes PR10383!

llvm-svn: 139133
2011-09-06 05:05:14 +00:00
Richard Smith 3ab15558d7 PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so:
RUN: foo
  RUN: bar || true

is equivalent to:

  RUN: foo && bar || true

which is equivalent to:

  RUN: (foo && bar) || true

This resulted in several of the fixit tests not really testing anything.

llvm-svn: 139132
2011-09-06 03:01:15 +00:00
Johnny Chen 8ed0ef9bae Change the signature of WatchpointLocation ctor so that the second param becomes
'size_t size', instead of 'lldb::tid_t tid'.  Pass size to the StoppointLocation
ctor as well.

llvm-svn: 139131
2011-09-06 02:52:28 +00:00
Nick Lewycky b1438c763a Revert r139126 due to selfhost failures reported by buildbots.
llvm-svn: 139130
2011-09-06 02:43:13 +00:00
Peter Collingbourne 2e8201422d Add missing dependency
Spotted by Ninja.

llvm-svn: 139129
2011-09-06 02:08:40 +00:00
Peter Collingbourne 15a26dacbc Fix typo
llvm-svn: 139128
2011-09-06 02:08:36 +00:00
Peter Collingbourne fa9771ffec Add the resource directory to the search path for Driver::GetFilePath,
as well as the search path printed by -print-search-dirs.

The main purpose of this change is to cause -print-file-name=include
to print the path to the include directory under Clang's resource
directory, instead of the system compiler's include directory, whose
header files Clang may not be able to parse.  Some build scripts will
do something like:
  $(CC) -nostdinc -I`$(CC) -print-file-name=include`
to exclude all header paths except the compiler's.

llvm-svn: 139127
2011-09-06 02:08:31 +00:00
Nick Lewycky c4c43fbb07 Teach SCEV to report a max backedge count in one interesting case in
HowFarToZero; the case for a canonical loop.

llvm-svn: 139126
2011-09-05 23:25:16 +00:00
Nick Lewycky 73df7e3830 Add a new MC bit for NaCl (Native Client) mode. NaCl requires that certain
instructions are more aligned than the CPU requires, and adds some additional
directives, to follow in future patches. Patch by David Meyer!

llvm-svn: 139125
2011-09-05 21:51:43 +00:00
Nick Lewycky df06b6e069 Update the C++ backend to use the new ArrayRef'ified APIs. Patch by arrowdodger!
llvm-svn: 139124
2011-09-05 18:50:59 +00:00
Nick Lewycky f1a5f57d2f Fix typo in comment.
llvm-svn: 139122
2011-09-05 18:35:03 +00:00
Benjamin Kramer 4b79c21ef2 InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match.
Fixes clang selfhost.

llvm-svn: 139120
2011-09-05 18:16:19 +00:00
Duncan Sands 29192d042e Delete trivial landing pads that just continue unwinding the caught
exception.

llvm-svn: 139117
2011-09-05 12:57:57 +00:00
Benjamin Kramer 17ff23c708 Speed up BCPL comment lexing by looking aggressively for newlines and then scannig backwards to see if the newline is escaped.
3% speedup in preprocessing all of clang with -Eonly. Also includes a small testcase for coverage.

llvm-svn: 139116
2011-09-05 07:19:39 +00:00
Benjamin Kramer dbfb18a0a9 Use the Lexer's definition of whitespace here.
llvm-svn: 139115
2011-09-05 07:19:35 +00:00
Benjamin Kramer e007e80fc0 Stop cluttering the test directory with temporary files.
llvm-svn: 139114
2011-09-05 07:19:32 +00:00
Duncan Sands fd26a954a8 Add some simple insertvalue simplifications, for the purpose of cleaning
up do-nothing exception handling code produced by dragonegg.

llvm-svn: 139113
2011-09-05 06:52:48 +00:00
Chandler Carruth 58b3749d6c Enable -Wdangling-fields by default in Clang. I've run this warning over
a very large chunk of code and found zero false positives. I've only
found a few bugs, but that likely is because bugs of this nature
actually do manifest. We've also identified several bugs that were
caught by Valgrind, but would have been caught faster and more easily
with this warning.

If anyone has concerns, or this causes fallout on any build bots, lemme
know. I'm happy to just put it under -Wmost.

llvm-svn: 139112
2011-09-05 05:47:35 +00:00
Richard Smith a528507418 Implement the suggested resolution of WG21 N3307 issue 19: When determining whether a class is an aggregate in C++0x, treat all functions which are neither deleted nor defaulted as user-provided, not just special member functions. The wording of the standard only defines the term "user-provided" for special member functions, but the intent seems to be that any function can be user-provided.
llvm-svn: 139111
2011-09-05 02:13:09 +00:00
Benjamin Kramer 0ca1ad0783 Use canonical forms for the branch probability zero heutistic.
- Drop support for X >u 0, it's equivalent to X != 0 and should be canonicalized into the latter.
- Add X < 1 -> unlikely, which is what instcombine canonicalizes X <= 0 into.
- Add X > -1 -> likely, which is what instcombine canonicalizes X >= 0 into.

llvm-svn: 139110
2011-09-04 23:53:04 +00:00