1. Apr 23, 2015
    • Filipe Cabecinhas's avatar
      Verify sizes when trying to read a BitcodeAbbrevOp · ee48fead
      Filipe Cabecinhas authored
      Summary:
      Make sure the abbrev operands are valid and that we can read/skip them
      afterwards.
      
      Bug found with AFL fuzz.
      
      Reviewers: rafael
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D9030
      
      llvm-svn: 235595
      ee48fead
    • Daniel Sanders's avatar
      [asan] debug_mapping.cc should also pass when the leading digit of SHADOW_SCALE is hexadecimal. · 9316d89d
      Daniel Sanders authored
      Summary:
      Previously the CHECK directive for SHADOW_SCALE only matched decimal digits
      causing it to match '7' on x86_64 instead of the whole value.
      
      This fixes a failure on mips-linux-gnu targets where the leading digit is 'a'.
      
      Reviewers: kcc, sagar, timurrrr
      
      Reviewed By: timurrrr
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D9199
      
      llvm-svn: 235594
      9316d89d
    • Timur Iskhodzhanov's avatar
      ac990bfc
    • Daniel Jasper's avatar
      clang-format: Allow splitting "= default" and "= delete". · caf84fe2
      Daniel Jasper authored
      Otherwise, this can violate the column limit.
      
      llvm-svn: 235592
      caf84fe2
    • Timur Iskhodzhanov's avatar
      [ASan/Win] Initialize sandbox-related stuff when asked to · d0be0a98
      Timur Iskhodzhanov authored
      llvm-svn: 235591
      d0be0a98
    • Timur Iskhodzhanov's avatar
      [ASan/Win] Don't forget to set *last_error if OpenFile fails · 8a67368c
      Timur Iskhodzhanov authored
      llvm-svn: 235590
      8a67368c
    • Ilia K's avatar
      MI fix allowing multiple logging instances of lldb-mi to run simultaneously. · 3b0494c3
      Ilia K authored
      Summary:
      Currently if two instances of lldb-mi are running with logging enabled using '--log' the log file conflicts. This produces the following error 
      MI: Error: File Handler. Error Permission denied opening 'C:\Users\Ewan\LLVM\build\Debug\bin\lldb-mi-log.txt'
      
      Fixed in this patch by renaming lldb-mi-log.txt based on the date, e.g. lldb-mi-log.txt-20150316163631.log, and moving the file into the temp directory by using the --log-dir option.
      
      Regrading previous review comments the P_tmpdir macro is defined in Windows but always points to "\", which doesn't help much. Also when using the Windows API for GetTempPath() dynamic memory seems much more messy.
      
      Patch from ewan@codeplay.com
      
      Reviewers: abidh, EwanCrawford
      
      Subscribers: zturner, lldb-commits, deepak2427
      
      Differential Revision: http://reviews.llvm.org/D9054
      
      llvm-svn: 235589
      3b0494c3
    • Tobias Grosser's avatar
      JScoP Import/Export: Ensure parameters have the same isl_id · 2165de88
      Tobias Grosser authored
      When reading parameters from a JSON file parameters with identical names
      may be related to different isl_ids, which then causes isl to treat them
      as differnet objects. This does not cause issues at the moment, but has
      shown problematic in subsequent schedule tree changes.
      
      This commit will be tested by the following changes.
      
      llvm-svn: 235588
      2165de88
    • Tamas Berghammer's avatar
      Update cpsr register in BLX instruction emulation · 10c7d300
      Tamas Berghammer authored
      Write the new cpsr value into the cpsr register if the BL or the BLX
      instruction change the instruction set on arm.
      
      Differential revision: http://reviews.llvm.org/D9188
      
      llvm-svn: 235585
      10c7d300
    • Tamas Berghammer's avatar
      Fix test expectation in TestNoreturnUnwind · f959520e
      Tamas Berghammer authored
      The test case lookinhg for the abort function in the stack trace.
      Previously it lookd for a function which ends with "abort" but on some
      system there are multiple such functions (e.g.: on android abort calls
      __libc_android_abort) what made the test fail. This CL change the
      behaviour to look for the abort function based on a fix list of names.
      
      llvm-svn: 235584
      f959520e
    • Daniel Jasper's avatar
      clang-format: Don't add unwanted space when creating new arrays. · 532a0314
      Daniel Jasper authored
      Before:
        char** newargv = new char* [argc];
      
      After:
        char** newargv = new char*[argc];
      
      llvm-svn: 235583
      532a0314
    • Daniel Jasper's avatar
      clang-format: [Proto] Don't linewrap top-level options. · 1b998815
      Daniel Jasper authored
      They are very similar to import statements.
      
      llvm-svn: 235582
      1b998815
    • Dmitry Vyukov's avatar
      tsan: support setuid call · 3658f6fc
      Dmitry Vyukov authored
      Currently the call hangs because the background thread
      does not handle SIGSETXID signal.
      
      llvm-svn: 235581
      3658f6fc
    • Daniel Jasper's avatar
      clang-format: Support nested block formatting with ColumnLimit=0. · 289afc07
      Daniel Jasper authored
      llvm-svn: 235580
      289afc07
    • Pavel Labath's avatar
      [NativeProcessLinux] Fix race condition during inferior thread creation · 5fd24c67
      Pavel Labath authored
      The following situation occured if we were stopping a process (due to breakpoint, watchpoint, ...
      hit) while a new thread was being created.
      - process has two threads: A and B.
      - thread A hits a breakpoint: we send a STOP signal to thread B and register a callback with
        ThreadStateCoordinator to send a stop notification after the thread stops.
      - thread B stops, but not due to the SIGSTOP, but on a thread creation event (of a new thread C).
        We are unaware of our desire to stop, so we queue ThreadStopped and RequestResume operations
        with TSC, so the thread can continue running.
      - TSC receives the ThreadStopped event, sees that all threads are stopped and fires the delayed
        stop notification.
      - immediately after that TSC gets the RequestResume operation, so it resumes the thread.
      
      At this point the state is inconsistent because LLDB thinks the process is stopped and will start
      issuing commands to it, but one of the threads is in fact running. Things eventually break.
      
      I address this problem by omitting the two TSC events altogether and Resuming the thread B
      directly. This way the short stop is invisible to the TSC and the delayed notification will not
      fire. We will fire the notification when we actually process the SIGSTOP on thread B.
      
      When we get the initial SIGSTOP for thread C, we also resume the thread and send a
      ThreadWasCreated message (is_stopped = false) to the TSC. This way, the TSC can stop the thread
      on its own and handle the stop event later. This way the state of the new thread is correctly
      handled as well (thanks Chaoren for the idea).
      
      This patch also removes the synchronisation between the thread creation notifications on threads
      B and C. The need for this synchronisation is unclear (the comments seem to hint that the new
      thread is "fully created" only after we process both events, but I have noticed no regressions in
      treating it as "created" even after just processing the initial C event), but it is a source for
      many kinds of obscure races, since it introduces a new thread state "Launching" and the rest of
      the code does not handle this state at all (what happens if we get a resume request from LLDB
      while this thread is launching? what happens if we get a stop request? etc.).
      
      This fixes the "spurious $O packet" problem in TestPrintStackTraces.py. However, the test remains
      disabled on i386 due to the VDSO issue.
      
      Test Plan:
      TestPrintStackTraces works on x86_64. No regressions in the rest of the test suite.
      
      Reviewers: vharron, chaoren
      
      Subscribers: lldb-commits
      
      Differential Revision: http://reviews.llvm.org/D9145
      
      llvm-svn: 235579
      5fd24c67
    • Simon Pilgrim's avatar
      [DAGCombiner] Remove extra bitcasts surrounding vector shuffles · 86b034ba
      Simon Pilgrim authored
      Patch to remove extra bitcasts from shuffles, this is often a legacy of XformToShuffleWithZero being used to combine bitmaskings (of float vectors bitcast to integer vectors) into shuffles: bitcast(shuffle(bitcast(s0),bitcast(s1))) -> shuffle(s0,s1)
      
      Differential Revision: http://reviews.llvm.org/D9097
      
      llvm-svn: 235578
      86b034ba
    • Karthik Bhat's avatar
      Move common loop utility function isInductionPHI into LoopUtils.cpp · 24e6cc2d
      Karthik Bhat authored
      This patch refactors the definition of common utility function "isInductionPHI" to LoopUtils.cpp.
      This fixes compilation error when configured with -DBUILD_SHARED_LIBS=ON
      
      llvm-svn: 235577
      24e6cc2d
    • Alexey Bataev's avatar
      [OPENMP] Fix for failed tests for 'omp atomic write' construct. · 112a7bf9
      Alexey Bataev authored
      llvm-svn: 235576
      112a7bf9
    • David Majnemer's avatar
      [MS ABI] Add support for mangling VLA types · 9595b7da
      David Majnemer authored
      Treat a VLA type like an incomplete array type.
      
      llvm-svn: 235575
      9595b7da
    • Mohit K. Bhakkad's avatar
      [LLDB][MIPS] Add MIPS32 and MIPS64 core revisions · e8659b5d
      Mohit K. Bhakkad authored
      Patch by Jaydeep Patil
      
      Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32.
      
      DYLDRendezvous.cpp:
      On Linux link map struct does not contain extra load offset field.
      
      Reviewers: clayborg
      Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
      Differential Revision: http://reviews.llvm.org/D9190
      
      llvm-svn: 235574
      e8659b5d
    • Alexey Bataev's avatar
      [OPENMP] Codegen for 'atomic capture'. · 5e018f9e
      Alexey Bataev authored
      Adds codegen for 'atomic capture' constructs with the following forms of expressions/statements:
      
      v = x binop= expr;
      v = x++;
      v = ++x;
      v = x--;
      v = --x;
      v = x = x binop expr;
      v = x = expr binop x;
      {v = x; x = binop= expr;}
      {v = x; x++;}
      {v = x; ++x;}
      {v = x; x--;}
      {v = x; --x;}
      {x = x binop expr; v = x;}
      {x binop= expr; v = x;}
      {x++; v = x;}
      {++x; v = x;}
      {x--; v = x;}
      {--x; v = x;}
      {x = x binop expr; v = x;}
      {x = expr binop x; v = x;}
      {v = x; x = expr;}
      If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted.
      Otherwise compare-and-swap sequence is emitted.
      Update of 'v' is not required to be be atomic with respect to the read or write of the 'x'.
      
      bb:
      ...
      atomic load <x>
      cont:
      <expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ]
      <desired> = <expected> binop <expr>
      <res> = cmpxchg atomic &<x>, desired, expected
      <new_failed> = <res>.field1;
      br <res>field2, label %exit, label %cont
      exit:
      atomic store <old/new x>, <v>
      ...
      Differential Revision: http://reviews.llvm.org/D9049
      
      llvm-svn: 235573
      5e018f9e
    • David Majnemer's avatar
      [MS ABI] Treat ConstantArrayType like IncompleteArrayType in args · 96183f6b
      David Majnemer authored
      Type backreferences for arguments use the DecayedType's original type.
      Because of this, arguments with the same canonical type with the same
      mangling would not backreference each other if one was a
      ConstantArrayType while the other was an IncompleteArrayType.  Solve
      this by canonicalizing the ConstantArrayType to a suitable
      IncompleteArrayType.
      
      This fixes PR23325.
      
      llvm-svn: 235572
      96183f6b
    • Karthik Bhat's avatar
      Add support to interchange loops with reductions. · 8210fdf2
      Karthik Bhat authored
      This patch enables interchanging of tightly nested loops with reductions.
      Differential Revision: http://reviews.llvm.org/D8314
      
      llvm-svn: 235571
      8210fdf2
    • Richard Smith's avatar
      [modules] Actually allocate the extra space we use for the tail-allocated array · 447ed43c
      Richard Smith authored
      in this class.
      
      llvm-svn: 235570
      447ed43c
    • Alexey Samsonov's avatar
      8c80e742
    • Alexey Samsonov's avatar
      Unify the way we report overflow in increment/decrement operator. · f6246503
      Alexey Samsonov authored
      Summary:
      Make sure signed overflow in "x--" is checked with
      llvm.ssub.with.overflow intrinsic and is reported as:
        "-2147483648 - 1 cannot be represented in type 'int'"
      instead of:
        "-2147483648 + -1 cannot be represented in type 'int'"
      , like we do for unsigned overflow.
      
      Test Plan: clang + compiler-rt regression test suite
      
      Reviewers: rsmith
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D8236
      
      llvm-svn: 235568
      f6246503
    • Alexey Samsonov's avatar
      [UBSan] Make sure proper error summary is printed for -fsanitize=float-cast-overflow. · 434984ef
      Alexey Samsonov authored
      float-cast-overflow handler doesn't have source location provided by the
      compiler, but we still have *some* source location if we have a
      symbolizer.
      
      llvm-svn: 235567
      434984ef
    • Andrew Kaylor's avatar
      [WinEH] Removing seh-filter.ll until I can determine its validity · 86e67f7e
      Andrew Kaylor authored
      llvm-svn: 235566
      86e67f7e
    • Justin Bogner's avatar
      InstrProf: Fix a shadowing error that would break length of profile names · 60d852ba
      Justin Bogner authored
      We try to use the member variable "FuncName" here, but we've also used
      that name as a parameter. This ends with us getting the length of the
      function name wrong when we generate the coverage data.
      
      llvm-svn: 235565
      60d852ba
    • Jim Ingham's avatar
      Missed one piece when committing r235538. · 46e9f9df
      Jim Ingham authored
      llvm-svn: 235564
      46e9f9df
    • Andrew Kaylor's avatar
      43e1d762
    • Reid Kleckner's avatar
      [WinEH] Don't emit an exceptional cleanup for llvm.eh.endcatch · 7d4bc9c0
      Reid Kleckner authored
      These extra endcatch markers aren't helping identify regions to outline,
      so let's get rid of them.  LLVM outlines (more or less) from begincatch
      to endcatch.  Any unwind edge from an enclosed invoke is a transition to
      a new exception handler, which has it's own outlining markers.
      
      llvm-svn: 235562
      7d4bc9c0
    • Hans Wennborg's avatar
      Switch lowering: extract jump tables and bit tests before building binary tree (PR22262) · 15823d49
      Hans Wennborg authored
      This is a re-commit of r235101, which also fixes the problems with the previous patch:
      
      - Switches with only a default case and non-fallthrough were handled incorrectly
      
      - The previous patch tickled a bug in PowerPC Early-Return Creation which is fixed here.
      
      > This is a major rewrite of the SelectionDAG switch lowering. The previous code
      > would lower switches as a binary tre, discovering clusters of cases
      > suitable for lowering by jump tables or bit tests as it went along. To increase
      > the likelihood of finding jump tables, the binary tree pivot was selected to
      > maximize case density on both sides of the pivot.
      >
      > By not selecting the pivot in the middle, the binary trees would not always
      > be balanced, leading to performance problems in the generated code.
      >
      > This patch rewrites the lowering to search for clusters of cases
      > suitable for jump tables or bit tests first, and then builds the binary
      > tree around those clusters. This way, the binary tree will always be balanced.
      >
      > This has the added benefit of decoupling the different aspects of the lowering:
      > tree building and jump table or bit tests finding are now easier to tweak
      > separately.
      >
      > For example, this will enable us to balance the tree based on profile info
      > in the future.
      >
      > The algorithm for finding jump tables is quadratic, whereas the previous algorithm
      > was O(n log n) for common cases, and quadratic only in the worst-case. This
      > doesn't seem to be major problem in practice, e.g. compiling a file consisting
      > of a 10k-case switch was only 30% slower, and such large switches should be rare
      > in practice. Compiling e.g. gcc.c showed no compile-time difference.  If this
      > does turn out to be a problem, we could limit the search space of the algorithm.
      >
      > This commit also disables all optimizations during switch lowering in -O0.
      >
      > Differential Revision: http://reviews.llvm.org/D8649
      
      llvm-svn: 235560
      15823d49
    • Zachary Turner's avatar
      Use the debugginess of the python interpreter when symlinking _lldb.pyd. · 0405d68b
      Zachary Turner authored
      Previously we would pass an argument to finishSwigWrapperClasses.py which
      specified whether this was a debug or a release build.  But sometimes
      CMAKE_BUILD_TYPE would not be set to anything, causing this argument
      to be empty when passed in.  The only purpose of this argument was to
      determine whether or not to append _d to the extension module when
      creating the symlink.  This is only necessary when doing a debug
      build of LLDB on Windows, which implies a debug interpreter, so we
      replace this with a check to see if the running interpreter is a debug
      one, and append _d if so.
      
      llvm-svn: 235559
      0405d68b
    • David Majnemer's avatar
      [InstCombine] Use a more targeted fix instead of r235544 · 7d0e99c6
      David Majnemer authored
      Only clear out the NSW/NUW flags if we are optimizing 'add'/'sub' while
      taking advantage that the sign bit is not set.  We do this optimization
      to further shrink the mask but shrinking the mask isn't NSW/NUW
      preserving in this case.
      
      llvm-svn: 235558
      7d0e99c6
    • Reid Kleckner's avatar
      [SEH] Remove the old __C_specific_handler code now that WinEHPrepare works · 64a2a6a4
      Reid Kleckner authored
      This removes the -sehprepare flag and makes __C_specific_handler
      functions always to use WinEHPrepare.
      
      This was tested by building all of chromium_builder_tests and running a
      few tests that use SEH, but if something breaks, we can revert this.
      
      llvm-svn: 235557
      64a2a6a4
    • Krzysztof Parzyszek's avatar
      Unxfail passing test on Hexagon · 1f6220b0
      Krzysztof Parzyszek authored
      llvm-svn: 235556
      1f6220b0
    • Reid Kleckner's avatar
      Fix another test broken by r235537 · fca03389
      Reid Kleckner authored
      llvm-svn: 235555
      fca03389
    • Lang Hames's avatar
      [RuntimeDyld][COFF] Add external symbol resolution support to RuntimeDyldCOFF. · 34cfa49b
      Lang Hames authored
      Patch by Andy Ayers. Thanks Andy!
      
      llvm-svn: 235554
      34cfa49b
    • David Majnemer's avatar
      Revert "Revert r234581, it might have caused a few miscompiles in Chromium." · dc012fa2
      David Majnemer authored
      This reverts commit r234700.  It turns out that the lifetime markers
      were not the cause of Chromium failing but a bug which was uncovered by
      optimizations exposed by the markers.
      
      llvm-svn: 235553
      dc012fa2