Commit Graph

201765 Commits

Author SHA1 Message Date
Renato Golin 391544c431 [ARMTargetParser] Removing string parsing from getCPUDefineSuffix. NFC.
Yet another FIXME from ARMTargetParser.

llvm-svn: 238416
2015-05-28 12:11:11 +00:00
Renato Golin 7374fcdb38 [ARMTargetParser] Adding a few more CPUs for Clang CPU detection. NFC.
llvm-svn: 238415
2015-05-28 12:10:37 +00:00
Benjamin Kramer 5377ad62f5 [MC] Replace custom string join function with the one from StringExtras.
NFC.

llvm-svn: 238414
2015-05-28 11:45:32 +00:00
Diego Novillo 63b2ad4f71 Fix PPC failure. Adjust CHECK pattern.
llvm-svn: 238413
2015-05-28 11:25:52 +00:00
Benjamin Kramer dba7ee90b5 Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.

llvm-svn: 238412
2015-05-28 11:24:24 +00:00
Tamas Berghammer 157e84f5a9 Fix breakpoint setting in gdb remote test cases on arm
llvm-svn: 238411
2015-05-28 10:55:01 +00:00
Tamas Berghammer 64d807e95d Fix write register context in EmulateInstructionARM::EmulateADDRdSPImm
llvm-svn: 238410
2015-05-28 10:38:32 +00:00
Yury Gribov 64c701b3f7 [ASan] XFAIL VLA tests on ARM and PowerPC. Patch by Max Ostapenko!
llvm-svn: 238409
2015-05-28 10:30:46 +00:00
Pavel Labath b9d6e89931 Move prctl call in TestChangeProcessGroup to the child
I was hoping the enable-tracing flag will be inherited from the parent. It is not.

llvm-svn: 238408
2015-05-28 10:28:34 +00:00
Yury Gribov 73570f4323 [ASan] Add new interceptors to asan_win_dll_thunk.cc to fix build errors on Windows.
Patch by Maria Guseva!

llvm-svn: 238407
2015-05-28 10:21:59 +00:00
Yury Gribov 0ca65fd83d [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk.
Patch by Maria Guseva.

Differential Revision: http://reviews.llvm.org/D9017

llvm-svn: 238406
2015-05-28 09:24:33 +00:00
Pavel Labath 05a1f2ac4c [NativeProcessLinux] Support inferiors which change their process group
Summary:
Previously, we wait()ed for events from the inferiors process group. This is resulted in a
failure if the inferior changed its process group in the middle of execution. To avoid this, I
pass -1 to the wait() call. The flag __WNOTHREAD makes sure we don't actually wait for events
from any process, but only the processes(threads) which are our children (or traced by us). Since
this happens on the monitor thread, which is dedicated to monitoring a single inferior, we will
be getting events only from this inferior.

Test Plan: All tests pass on linux. I have added a test to check the new functionality.

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10061

llvm-svn: 238405
2015-05-28 08:59:21 +00:00
Renato Golin e1326cadb2 Fix comments in ARMTargetParser. NFC.
llvm-svn: 238404
2015-05-28 08:59:03 +00:00
Yury Gribov 781bce2b94 [ASan] Fix previous commit. Patch by Max Ostapenko!
llvm-svn: 238403
2015-05-28 08:03:28 +00:00
Yury Gribov 98b18599a6 [ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!
Differential Revision: http://reviews.llvm.org/D7098

llvm-svn: 238402
2015-05-28 07:51:49 +00:00
Yury Gribov 63d9764585 [ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!
Differential Revision: http://reviews.llvm.org/D7098

llvm-svn: 238401
2015-05-28 07:49:05 +00:00
Daniel Jasper f841d3a6c1 clang-format: Lower binding strengths created by the [] created by ObjC
method expressions and array literals. They should not bind stronger
than regular parentheses or the braces of braced lists.

Specific test case in JavaScript:
Before:
  var aaaaa: List<
      SomeThing> = [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];

After:
  var aaaaa: List<SomeThing> = [
    new SomeThingAAAAAAAAAAAA(),
    new SomeThingBBBBBBBBB()
  ];

llvm-svn: 238400
2015-05-28 07:21:50 +00:00
Craig Topper 85693aeb43 [TableGen] Use DefInit::getAsString instead of getDef()->getName(). NFC
llvm-svn: 238399
2015-05-28 06:38:32 +00:00
Craig Topper 2a8d4b294c [TableGen] Don't convert types to strings to query what they are. Just use 'isa'
llvm-svn: 238398
2015-05-28 06:38:28 +00:00
David Majnemer 587336d2ad [Reassociate] Canonicalizing 'x [+-] (-Constant * y)' isn't always a win
Canonicalizing 'x [+-] (-Constant * y)' is not a win if we don't *know*
we will open up CSE opportunities.

If the multiply was 'nsw', then negating 'y' requires us to clear the
'nsw' flag.  If this is actually worth pursuing, it is probably more
appropriate to do so in GVN or EarlyCSE.

This fixes PR23675.

llvm-svn: 238397
2015-05-28 06:16:39 +00:00
Jingyue Wu c2a014697a [NaryReassociate] Run EarlyCSE after NaryReassociate
Summary:
This patch made two improvements to NaryReassociate and the NVPTX pipeline

1. Run EarlyCSE/GVN after NaryReassociate to get rid of redundant common
expressions.

2. When adding an instruction to SeenExprs, maps both the SCEV before and after
reassociation to that instruction.

Test Plan: updated @reassociate_gep_nsw in nary-gep.ll

Reviewers: meheff, broune

Reviewed By: broune

Subscribers: dberlin, jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D9947

llvm-svn: 238396
2015-05-28 04:56:52 +00:00
Jason Molenda de905773ae Add quick bit of doc about SBFrame::GetCFA().
llvm-svn: 238395
2015-05-28 04:55:53 +00:00
David Majnemer ae1ed0edfe [Basic] Define __declspec for cygwin
Cygwin (and MinGW) targets define __declspec to __attribute__ unless
-fms-extensions is specified.  It turns out that cygwin headers rely on
the existence of this macro.

llvm-svn: 238394
2015-05-28 04:36:18 +00:00
Greg Clayton 424a5dbc73 Added a new API to SBFrame:
lldb::addr_t SBFrame::GetCFA();

This gets the CFA (call frame address) of the frame so it allows us to take an address that is on the stack and figure out which thread it comes from.

Also modified the heap.py module to be able to find out which variable in a frame's stack frame contains an address. This way when ptr_refs finds a match on the stack, it get then report which variable contains the pointer.

llvm-svn: 238393
2015-05-28 03:27:22 +00:00
Greg Clayton 08765fac3f I finally found the strong reference that was keeping all lldb_private::Process instances from ever destroying themselves: ProcessModID.m_mod_id was holding onto the last stop event with ProcessModID::SetStopEventForLastNaturalStopID(EventSP). This is a bad idea because ProcessEventData contains a strong refereence to the process. This is now fixed by calling ProcessModID::SetStopEventForLastNaturalStopID(EventSP()) to clear this event in Process::SetExitStatus() and in Process::Finalize().
This was the original cause of the file descriptor leaks that would cause the test suite to die after running a few hundred processes since no process would ever get destroyed and the communication channel in ProcessGDBRemote and the ProcessIOHandler would never close their pipes. 

This process leak was previously worked around by closing the pipes when the communication channel was disconnected.

This was found by using "ptr_refs" from the heap.py in the lldb.macosx.heap module. It was able to find all strong references to the Process and helped me to figure out who was holding this extra reference.

llvm-svn: 238392
2015-05-28 03:24:30 +00:00
Chandler Carruth 88862eaefa [x86] Refactor the tests for popcnt.
Extracted from the D6531 patch by Bruno Cardoso Lopes, and re-generated
to reflect the current state of the world. This should let Bruno's D6531
actually show the delta between the approaches by running the x86 test
case update script after re-building.

llvm-svn: 238391
2015-05-28 02:40:15 +00:00
Chandler Carruth 9b0a561b03 [omp] Actually provide a default OpenMP runtime -- libgomp for now.
llvm-svn: 238390
2015-05-28 02:17:15 +00:00
Chandler Carruth 9c6b4f8528 [omp] Re-work Clang's handling of -fopenmp and undo r237769.
This isn't an actual revert of r237769, it just restores the behavior of
the Clang driver prior to it while completely re-implementing how that
behavior works.

This also re-does the work of making the default OpenMP runtime
selectable at CMake (or configure) time to work in the way all of our
other such hooks do (config.h, configure and cmake hooks, etc.).

I've re-implemented how we manage the '-fopenmp' flagset in an important
way. Now, the "default" hook just makes '-fopenmp' equivalent to
'-fopenmp=<default>' rather than a separate special beast. Also, there
is an '-fno-openmp' flag which does the obvious thing. Also, the code is
shared between all the places to select a known OpenMP runtime and act
on it.

Finally, and most significantly, I've taught the driver to inspect the
selected runtime when choosing whether to propagate the '-fopenmp' flag
to the frontend in the CC1 commandline. Without this, it isn't possible
to use Clang with libgomp, even if you were happy with the serial,
boring way in which it worked previously (ignoring all #pragmas but
linking in the library to satisfy direct calls into the runtime).

While I'm here, I've gone ahead and sketched out a path for the future
name of LLVM's OpenMP runtime (libomp) and the legacy support for its
current name (libiomp5) in what seems a more reasonable way.

To re-enable LLVM's OpenMP runtime (which I think should wait until the
normal getting started instructions are a reasonable way for falks to
check out, build, and install Clang with the runtime) all that needs to
change is the default string in the CMakeLists.txt and configure.ac
file. No code changes necessary.

I also added a test for the driver's behavior around OpenMP since it was
*completely missing* previously. Makes it unsurprising that we got it
wrong.

llvm-svn: 238389
2015-05-28 01:52:38 +00:00
Chandler Carruth cc83ce4894 [omp] Add a configuration variable for the default OpenMP runtime.
This will be used in my next commit to Clang.

llvm-svn: 238388
2015-05-28 01:47:22 +00:00
Ekaterina Romanova 2e81434552 Added doxygen comments for the intrinsics.
llvm-svn: 238386
2015-05-28 01:25:25 +00:00
Siva Chandra b100a34cfb [TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elements
Summary: This fixes the test for i386 targets.

Test Plan: dotest.py -C clang --arch i386 TestDataFormatterUnordered

Reviewers: chying, chaoren, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10078

llvm-svn: 238385
2015-05-28 01:18:11 +00:00
Michael J. Spencer 42a738198b Fix unused variable warnings.
llvm-svn: 238384
2015-05-28 00:29:56 +00:00
Michael J. Spencer cc0554d057 Add PHDR and FILL parsing.
llvm-svn: 238383
2015-05-28 00:14:58 +00:00
Richard Trieu 95a192a3ab Update -Winvalid-noreturn to handle destructors better.
When checking if a function is noreturn, consider a codepath to be noreturn if
the path destroys a class and the class destructor, base class destructors, or
member field destructors are marked noreturn.

Differential Revision: http://reviews.llvm.org/D9454

llvm-svn: 238382
2015-05-28 00:14:02 +00:00
Jonathan Peyton caf09fe022 Fix comment about balanced affinity
A while back, Hal mentioned fixing a comment concerning balanced affinity.
http://lists.cs.uiuc.edu/pipermail/openmp-dev/2014-December/000358.html
I forgot about fixing it until now, but now is better than never.

llvm-svn: 238378
2015-05-27 23:27:33 +00:00
Duncan P. N. Exon Smith a68b880d69 AsmPrinter: Avoid a warning in NDEBUG, NFC
Should fix the -Werror release build:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/11113

llvm-svn: 238375
2015-05-27 23:02:36 +00:00
Duncan P. N. Exon Smith 6289892c20 AsmPrinter: Return added DIE from DIE::addChild()
Change `DIE::addChild()` to return a reference to the just-added node,
and update consumers to use it directly.  An upcoming commit will
abstract away (and eventually change) the underlying storage of
`DIE::Children`.

llvm-svn: 238372
2015-05-27 22:59:03 +00:00
Fiona Glaser ca706e54a9 RegisterPressure: fix debug prints in case of physical registers
llvm-svn: 238371
2015-05-27 22:51:47 +00:00
Marshall Clow a7fb9a041d Fix PR#23647 - make_shared<volatile bool> - second try
llvm-svn: 238370
2015-05-27 22:44:47 +00:00
Duncan P. N. Exon Smith 88a8fc5448 AsmPrinter: Stop exposing underlying DIEValue list, NFC
Change the `DIE` API to hide the implementation of the list of
`DIEValue`s.

llvm-svn: 238369
2015-05-27 22:44:06 +00:00
Siva Chandra 825a7681db [TestNamespace] Fix an accidentally committed local change.
Test Plan: dotest.py -p TestNamespace

Reviewers: sivachandra

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10076

llvm-svn: 238368
2015-05-27 22:39:21 +00:00
Evgeniy Stepanov 1f1d9f27fd [asan] Fix build dependency issues with ASan version list file.
CMake pre-3.1 has a bug where a shared library depending on a custom_target
does not really depend on it.

This commit implements a hilariously ugly workaround for this problem, see
code comments for more details.

llvm-svn: 238367
2015-05-27 22:38:01 +00:00
Duncan P. N. Exon Smith f3a6a67ffd AsmPrinter: Remove DIEHash::AttrEntry, NFC
Remove "the most boring struct ever" (thanks to review by Eric).

llvm-svn: 238366
2015-05-27 22:36:37 +00:00
Greg Clayton 4e1042e1bf Allow expresions to have unique expression prefixes:
expr_options = lldb.SBExpressionOptions()
expr_options.SetPrefix('''
struct Foo {
   int a;
   int b;
   int c;
}
'''
expr_result = frame.EvaluateExpression ("Foo foo = { 1, 2, 3}; foo", expr_options)

This fixed a current issue with ptr_refs, cstr_refs and malloc_info so that they can work. If expressions define their own types and then return expression results that use those types, those types get copied into the target's AST context so they persist and the expression results can be still printed and used in future expressions. Code was added to the expression parser to copy the context in which types are defined if they are used as the expression results. So in the case of types defined by expressions, they get defined in a lldb_expr function and that function and _all_ of its statements get copied. Many types of statements are not supported in this copy (array subscript, lambdas, etc) so this causes expressions to fail as they can't copy the result types. To work around this issue I have added code that allows expressions to specify an expression specific prefix. Then when you evaluate the expression you can pass the "expr_options" and have types that can be correctly copied out into the target. I added this as a way to work around an issue, but I also think it is nice to be allowed to specify an expression prefix that can be reused by many expressions, so this feature is very useful.

<rdar://problem/21130675>

llvm-svn: 238365
2015-05-27 22:32:39 +00:00
Duncan P. N. Exon Smith 815a6eb55d AsmPrinter: Store abbreviation data directly in DIE and DIEValue
Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside
the `DIEValue` list.  Besides being a cleaner data structure (avoiding
the parallel arrays), this gives us more freedom to rearrange the
`DIEValue` list.

This fixes the temporary memory regression from 845 MB up to 879 MB, and
drops it further to 829 MB for a net memory decrease of around 1.9%
(incremental decrease around 5.7%).

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238364
2015-05-27 22:31:41 +00:00
Siva Chandra 3154aa23f3 [TestBase.runCmd] Better error message when runCmd fails.
Summary:
Before:
    AssertionError: False is not True : Process is launched successfully

After:
    AssertionError: False is not True : Command 'run a.out' failed.
    >>> error: invalid target, create a target using the 'target create' command
    >>> Process could not be launched successfully

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, vharron

Differential Revision: http://reviews.llvm.org/D9948

llvm-svn: 238363
2015-05-27 22:27:41 +00:00
Duncan P. N. Exon Smith e7e1d0c706 Reapply "AsmPrinter: Change DIEValue to be stored by value"
This reverts commit r238350, effectively reapplying r238349 after fixing
(all?) the problems, all somehow related to how I was using
`AlignedArrayCharUnion<>` inside `DIEValue`:

  - MSVC can only handle `sizeof()` on types, not values.  Change the
    assert.
  - GCC doesn't know the `is_trivially_copyable` type trait.  Instead of
    asserting it, add destructors.
  - Call placement new even when constructing POD (i.e., the pointers).
  - Instead of copying the char buffer, copy the casted classes.

I've left in a couple of `static_assert`s that I think both MSVC and GCC
know how to handle.  If the bots disagree with me, I'll remove them.

  - Check that the constructed type is either standard layout or a
    pointer.  This protects against a programming error: we really want
    the "small" `DIEValue`s to be small and simple, so don't
    accidentally change them not to be.
  - Similarly, check that the size of the buffer is no bigger than a
    `uint64_t` or a pointer.  (I thought checking against
    `sizeof(uint64_t)` would be good enough, but Chandler suggested that
    pointers might sometimes be bigger than that in the context of
    sanitizers.)

I've also committed r238359 in the meantime, which introduces a
DIEValue.def to simplify dispatching between the various types (thanks
to a review comment by David Blaikie).  Without that, this commit would
be almost unintelligible.

Here's the original commit message:
--
Change `DIEValue` to be stored/passed/etc. by value, instead of
reference.  It's now a discriminated union, with a `Val` field storing
the actual type.  The classes that used to inherit from `DIEValue` no
longer do.  There are two categories of these:

  - Small values fit in a single pointer and are stored by value.
  - Large values require auxiliary storage, and are stored by reference.

The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp.  It
was relying on `DIEInteger`s being passed around by reference, so I
replaced that assumption with a `PatchLocation` type that stores a safe
reference to where the `DIEInteger` lives instead.

This commit causes a temporary regression in memory usage, since I've
left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit.  I
measured an increase from 845 MB to 879 MB, around 3.9%.  The follow-up
drops it lower than the starting point, and I've only recently brought
the memory this low anyway, so I'm committing these changes separately
to keep them incremental.  (I also considered swapping the commits, but
the other one first would cause a lot more code churn.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)
--

llvm-svn: 238362
2015-05-27 22:14:58 +00:00
Siva Chandra 27ab2b3143 [TestDataFormatterUnordered] Fix a few typos in the test.
Summary: The typos were exposed by http://reviews.llvm.org/D9948.

Test Plan: dotest.py -p TestDataFormatterUnordered

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10071

llvm-svn: 238361
2015-05-27 22:03:09 +00:00
Diego Novillo aa8b1cb8a4 Set function entry counts with -fprofile-instr-use.
This generates function entry counts from instrumentation profiles.

llvm-svn: 238360
2015-05-27 21:58:42 +00:00
Duncan P. N. Exon Smith ff18927c58 AsmPrinter: Introduce DIEValue.def, NFC
Use a .def macro file to iterate through the various subclasses of
`DIEValue`.

llvm-svn: 238359
2015-05-27 21:15:43 +00:00