1. Dec 02, 2014
    • Asiri Rathnayake's avatar
      Remove unused function. · cdfa931d
      Asiri Rathnayake authored
      Removing an unused function which is causing one of the build bots to fail.
      This was introduced in the commit r223113. A proper cleanup of the so_imm
      tblgen defintion (made redundant by the mod_imm definition) needs to happen
      soon.
      
      llvm-svn: 223115
      cdfa931d
    • Serge Pavlov's avatar
      Emit warning if define or undef reserved identifier or keyword. · 1ecb41c0
      Serge Pavlov authored
      Summary:
      This change implements warnings if macro name is identical to a keyword or
      reserved identifier. The warnings are different depending on the "danger"
      of the operation. Defining macro that replaces a keyword is on by default.
      Other cases produce warning that is off by default but can be turned on
      using option -Wreserved-id-macro.
      
      This change fixes PR11488.
      
      Reviewers: rnk
      
      Reviewed By: rnk
      
      Subscribers: rnk, cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D6194
      
      llvm-svn: 223114
      1ecb41c0
    • Asiri Rathnayake's avatar
      Add support for ARM modified-immediate assembly syntax. · a0199b9a
      Asiri Rathnayake authored
      Certain ARM instructions accept 32-bit immediate operands encoded as a 8-bit
      integer value (0-255) and a 4-bit rotation (0-30, even). Current ARM assembly
      syntax support in LLVM allows the decoded (32-bit) immediate to be specified
      as a single immediate operand for such instructions:
      
      mov r0, #4278190080
      
      The ARMARM defines an extended assembly syntax allowing the encoding to be made
      more explicit, as in:
      
      mov r0, #255, #8 ; (same 32-bit value as above)
      
      The behaviour of the two instructions can be different w.r.t flags, which is
      documented under "Modified immediate constants" in ARMARM. This patch enables
      support for this extended syntax at the MC layer.
      
      llvm-svn: 223113
      a0199b9a
    • Will Newton's avatar
      Add ARM relocations to ELFYAML · 9efe6259
      Will Newton authored
      Tested with check-all with no regressions.
      
      llvm-svn: 223112
      9efe6259
    • Daniel Jasper's avatar
      clang-format: precedence-based indentation when breaking before operators. · 8c6e9ef6
      Daniel Jasper authored
      Before:
        bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                     + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                     + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                     == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                        * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                        + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                     && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                        * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                        > ccccccccccccccccccccccccccccccccccccccccc;
      
      After:
        bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                             + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                             + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                         == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                                    * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                                + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                     && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                                * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                            > ccccccccccccccccccccccccccccccccccccccccc;
      
      Not particularly pretty, but can probably help to uncover bugs. And if this
      bugs somebody, parentheses can help.
      
      llvm-svn: 223111
      8c6e9ef6
    • Charlie Turner's avatar
      Emit Tag_ABI_FP_denormal correctly in fast-math mode. · 15f91c52
      Charlie Turner authored
      The default ARM floating-point mode does not support IEEE 754 mode exactly. Of
      relevance to this patch is that input denormals are flushed to zero. The way in
      which they're flushed to zero depends on the architecture,
      
        * For VFPv2, it is implementation defined as to whether the sign of zero is
          preserved.
        * For VFPv3 and above, the sign of zero is always preserved when a denormal
          is flushed to zero.
      
      When FP support has been disabled, the strategy taken by this patch is to
      assume the software support will mirror the behaviour of the hardware support
      for the target *if it existed*. That is, for architectures which can only have
      VFPv2, it is assumed the software will flush to positive zero. For later
      architectures it is assumed the software will flush to zero preserving sign.
      
      Change-Id: Icc5928633ba222a4ba3ca8c0df44a440445865fd
      llvm-svn: 223110
      15f91c52
    • Sonam Kumari's avatar
      [signext.ll] Removal Of Duplicate Test Cases · f2eacabd
      Sonam Kumari authored
      Removed the duplicate test case existing in signext.ll file.
      
      llvm-svn: 223109
      f2eacabd
    • Bob Wilson's avatar
      Re-apply "Revert r166370 and r166540 now that Xcode 4.6 has been available for a while." · ec2580de
      Bob Wilson authored
      This reverts commit r176892.
      
      I had reverted this a while back to give Chromium more time to update, and
      Nico says it should be OK now.
      
      llvm-svn: 223108
      ec2580de
    • NAKAMURA Takumi's avatar
      clang/test/Modules/malformed.cpp REQUIRES shell due to "cd". · 8ca1b5a2
      NAKAMURA Takumi authored
      llvm-svn: 223107
      8ca1b5a2
    • Hans Wennborg's avatar
      CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268) · 76abe8ef
      Hans Wennborg authored
      If the output of 'ld -v' didn't match the regexes, CMake would previously error
      with a message like:
      
        CMake Error at tools/clang/CMakeLists.txt:269 (string):
          string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
          an empty string.
      
      llvm-svn: 223106
      76abe8ef
    • Hans Wennborg's avatar
      Try to fix the MSVC build. · 0101b540
      Hans Wennborg authored
      llvm-svn: 223105
      0101b540
    • Nick Kledzik's avatar
      [mach-o] Fix TrieEdge leak · 07ba5121
      Nick Kledzik authored
      In PR21682 Jean-Daliel Dupas found a leak in the trie builder and suggested
      a fix was to use a list instead of SmallVector so that the list elements
      could be allocated in the BumpPtrAllocator.
      
      llvm-svn: 223104
      07ba5121
    • Nick Kledzik's avatar
      [mach-o] add support for arm64 compact unwind info · a441b7b0
      Nick Kledzik authored
      Tim previously added generic compact unwind processing and x86_64 support.
      This patch adds arm64 support.
      
      llvm-svn: 223103
      a441b7b0
    • Chandler Carruth's avatar
      Rely on fewer features of the 'env' command. Darwin only supports '-i'. · bdf7e1dd
      Chandler Carruth authored
      I'm explicitly setting LC_ALL=C somewhat for documentation, but
      hopefully this also removes some host variation from the test results.
      
      llvm-svn: 223102
      bdf7e1dd
    • Nick Lewycky's avatar
      Fix variable used only in assertion. · ceb44dfd
      Nick Lewycky authored
      llvm-svn: 223101
      ceb44dfd
    • Chandler Carruth's avatar
      Add a test that ensures the Clang driver behaves itself when the PATH · c2f9ea78
      Chandler Carruth authored
      environment variable is changed to strange things out from under it.
      Prior to r223099 in LLVM, these test cases would crash in various ways
      (assert fails, stack exhaustion, etc.).
      
      llvm-svn: 223100
      c2f9ea78
    • Chandler Carruth's avatar
      Fix several bugs in r221220's new program finding code. · ec8406d8
      Chandler Carruth authored
      In both the Unix and Windows variants, std::getenv was called and the
      result passed directly to a function accepting a StringRef. This isn't
      OK because it might return a null pointer and that causes the StringRef
      constructor to assert (and generally produces crash-prone code if
      asserts are disabled). Fix this by independently testing the result as
      non-null prior to splitting things.
      
      This in turn uncovered another bug in the Unix variant where it would
      infinitely recurse if PATH="", or after this fix if PATH isn't set.
      There is no need to recurse at all. Slightly re-arrange the code to make
      it clear that we can just fixup the Paths argument based on the
      environment if we find anything.
      
      I don't know of a particularly useful way to test these routines in
      LLVM. I'll commit a test to Clang that ensures that its driver correctly
      handles various settings of PATH. However, I have no idea how to
      correctly write a Windows test for the PATHEXT change. Any Windows
      developers who could provide such a test, please have at. =D
      
      Many thanks to Nick Lewycky and others for helping debug this. =/ It was
      quite nasty for us to track down.
      
      llvm-svn: 223099
      ec8406d8
    • Richard Smith's avatar
      Update and simplify to match Clang r223095. · 47423534
      Richard Smith authored
      llvm-svn: 223098
      47423534
    • Bob Wilson's avatar
      Remove special case for aarch64 static vs. PIC code in iOS kernel code. · 5f4346d5
      Bob Wilson authored
      I added this check a while back but then made a note to myself that it
      should be completely unnecessary since iOS always uses PIC code-gen for
      aarch64. Since I could never come up with any reason why it would be
      necessary, I'm just going to remove it and we'll see if anything breaks.
      rdar://problem/13627985
      
      llvm-svn: 223097
      5f4346d5
    • Jason Molenda's avatar
      Fix the behavior of ${current-pc-arrow} in the default disassembly · 98b3fde8
      Jason Molenda authored
      format for the not-current-stack-frame.  This was causing
      test/functionalities/inferior-assert to fail.
      
      Also document the new additions to the format specifications used
      in the disassembly-format changes to formats.html.
      
      <rdar://problem/19102757> 
      
      llvm-svn: 223096
      98b3fde8
    • Richard Smith's avatar
      [modules] Track how 'header' directives were written in module map files, · 3c1a41ad
      Richard Smith authored
      rather than trying to extract this information from the FileEntry after the
      fact.
      
      This has a number of beneficial effects. For instance, diagnostic messages for
      failed module builds give a path relative to the "module root" rather than an
      absolute file path, and the contents of the module includes file is no longer
      dependent on what files the including TU happened to inspect prior to
      triggering the module build.
      
      llvm-svn: 223095
      3c1a41ad
    • Alexey Samsonov's avatar
      Add override specifiers to Symbolizer methods. NFC. · 4cdf4eba
      Alexey Samsonov authored
      llvm-svn: 223094
      4cdf4eba
    • Hal Finkel's avatar
      Simplify pointer comparisons involving memory allocation functions · afcd8dbb
      Hal Finkel authored
      System memory allocation functions, which are identified at the IR level by the
      noalias attribute on the return value, must return a pointer into a memory region
      disjoint from any other memory accessible to the caller. We can use this
      property to simplify pointer comparisons between allocated memory and local
      stack addresses and the addresses of global variables. Neither the stack nor
      global variables can overlap with the region used by the memory allocator.
      
      Fixes PR21556.
      
      llvm-svn: 223093
      afcd8dbb
    • Philip Reames's avatar
      Try to fix a bot failure due to a variable used only in an assert. · 8e302cdb
      Philip Reames authored
      Specifically, bot lld-x86_64-darwin13.  Resulting from change 223085.
      
      llvm-svn: 223092
      8e302cdb
    • Oleksiy Vyalov's avatar
      Fix several test failures on Linux/FreeBSD caused by compiler configuration... · a3ff6af4
      Oleksiy Vyalov authored
      Fix several test failures on Linux/FreeBSD caused by compiler configuration and invalid environment - make lldbtest.registerSharedLibrariesWithTarget to support multiple platforms.
      http://reviews.llvm.org/D6392
      
      llvm-svn: 223091
      a3ff6af4
    • Nikola Smiljanic's avatar
      fce370eb
    • Zachary Turner's avatar
      Enable enabling and disabling breakpoints on Windows. · e0d93f52
      Zachary Turner authored
      llvm-svn: 223089
      e0d93f52
    • Zachary Turner's avatar
      Link test executables with LLD on Windows. · e068d918
      Zachary Turner authored
      Clang generates DWARF debug info with section names longer
      than 8 characters.  This is only supported by an extension
      to PE/COFF which the MSVC linker doesn't implement.  So
      trying to link DWARF-enabled object files with MSVC will
      lead to corrupt debug information in the executable.
      
      llvm-svn: 223088
      e068d918
    • Zachary Turner's avatar
      Only normalize FileSpec paths *after* resolving them. · c7a17ed4
      Zachary Turner authored
      Normalizing paths before resolving them can cause the path to
      become denormalized after resolution.
      
      llvm-svn: 223087
      c7a17ed4
    • Zachary Turner's avatar
      Make -fuse-ld=lld work properly on Windows. · 719f58c2
      Zachary Turner authored
      Using lld on Windows requires calling link-lld.exe instead of
      lld.exe.  This patch puts this knowledge into clang so that when
      using the GCC style clang driver, it can properly delegate to
      lld.
      
      Differential Revision: http://reviews.llvm.org/D6428
      Reviewed by: Reid Kleckner, Rui Ueyama
      
      llvm-svn: 223086
      719f58c2
    • Philip Reames's avatar
      [Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend · 0365f1a3
      Philip Reames authored
      This is the second patch in a small series.  This patch contains the MachineInstruction and x86-64 backend pieces required to lower Statepoints.  It does not include the code to actually generate the STATEPOINT machine instruction and as a result, the entire patch is currently dead code.  I will be submitting the SelectionDAG parts within the next 24-48 hours.  Since those pieces are by far the most complicated, I wanted to minimize the size of that patch.  That patch will include the tests which exercise the functionality in this patch.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.
      
      The STATEPOINT psuedo node is generated after all gc values are explicitly spilled to stack slots.  The purpose of this node is to wrap an actual call instruction while recording the spill locations of the meta arguments used for garbage collection and other purposes.  The STATEPOINT is modeled as modifing all of those locations to prevent backend optimizations from forwarding the value from before the STATEPOINT to after the STATEPOINT.  (Doing so would break relocation semantics for collectors which wish to relocate roots.)
      
      The implementation of STATEPOINT is closely modeled on PATCHPOINT.  Eventually, much of the code in this patch will be removed.  The long term plan is to merge the functionality provided by statepoints and patchpoints.  Merging their implementations in the backend is likely to be a good starting point.
      
      Reviewed by: atrick, ributzka
      
      llvm-svn: 223085
      0365f1a3
    • Enrico Granata's avatar
      The register keyword is deprecated in C++11, so clang complains strongly about... · e2068207
      Enrico Granata authored
      The register keyword is deprecated in C++11, so clang complains strongly about swig generating register declarations. Abuse the preprocessor to define the keyword away
      
      llvm-svn: 223084
      e2068207
    • Greg Clayton's avatar
      lldb can deadlock when launched with an non-existing executable: · afa91e33
      Greg Clayton authored
      % lldb /bin/nonono
      (lldb) target create "/bin/nonono"
      error: unable to find executable for '/usr/bin/nonono'
      <deadlock>
      
      The problem was the initial commands 'target create "/bin/nonono"' were put into a pipe and the command interpreter was being run with:
      
      void
      CommandInterpreter::RunCommandInterpreter(bool auto_handle_events,
                                                bool spawn_thread,
                                                CommandInterpreterRunOptions &options)
      {
          // Always re-create the command intepreter when we run it in case
          // any file handles have changed.
          bool force_create = true;
          m_debugger.PushIOHandler(GetIOHandler(force_create, &options));
          m_stopped_for_crash = false;
          
          if (auto_handle_events)
              m_debugger.StartEventHandlerThread();
          
          if (spawn_thread)
          {
              m_debugger.StartIOHandlerThread();
          }
          else
          {
              m_debugger.ExecuteIOHanders();
              
              if (auto_handle_events)
                  m_debugger.StopEventHandlerThread();
          }
          
      }
      
      If "auto_handle_events" was set to true and "spawn_thread" was false, we would execute:
      
      m_debugger.StartEventHandlerThread();
      m_debugger.ExecuteIOHanders();
      m_debugger.StopEventHandlerThread();
      
      
      The problem was there was no synchonization in Debugger::StartEventHandlerThread() to ensure the event handler was listening to events and the the call to "m_debugger.StopEventHandlerThread()" would do:
      
      void
      Debugger::StopEventHandlerThread()
      {
          if (m_event_handler_thread.IsJoinable())
          {
              GetCommandInterpreter().BroadcastEvent(CommandInterpreter::eBroadcastBitQuitCommandReceived);
              m_event_handler_thread.Join(nullptr);
          }
      }
      
      The problem was that the event thread might not be listening for the CommandInterpreter::eBroadcastBitQuitCommandReceived event yet.
      
      The solution is to make sure the Debugger::DefaultEventHandler() is listening to events before we return from Debugger::StartEventHandlerThread(). Once we have this synchonization we remove the race condition.
      
      This fixes radar:
      
      <rdar://problem/19041192>
      
      llvm-svn: 223083
      afa91e33
    • Greg Clayton's avatar
      Added a new regular expression to the "_regexp-break" command ("b" by default): · d90ac932
      Greg Clayton authored
      (lldb) b /break here/
      
      This will set a source level regular expression breakpoint on any text between the first '/' and the last '/'. The equivalent command will be:
      
      (lldb) breakpoint set --source-pattern-regexp 'break here'
      
      llvm-svn: 223082
      d90ac932
    • Vince Harron's avatar
      Added StringExtractor::DecodeHexU8 && GetHexBytesAvail · 6eddf8df
      Vince Harron authored
      DecodeHexU8 returns a decoded hex character pair, returns -1 if a
      valid hex pair is not available.
      
      GetHexBytesAvail decodes all available hex pairs.
      
      llvm-svn: 223081
      6eddf8df
    • Vince Harron's avatar
      StringExtractor unit tests · e5a9eaaa
      Vince Harron authored
      Unit tests to cover StringExtractor in advance of minor new
      functionality & minor refactor
      
      llvm-svn: 223080
      e5a9eaaa
    • Reid Kleckner's avatar
      Use nullptr to silence -Wsentinel when self-hosting on Windows · ee7cf84c
      Reid Kleckner authored
      Richard rejected my Sema change to interpret an integer literal zero in
      a varargs context as a null pointer, so -Wsentinel sees an integer
      literal zero and fires off a warning. Only CodeGen currently knows that
      it promotes integer literal zeroes in this context to pointer size on
      Windows.  I didn't want to teach -Wsentinel about that compatibility
      hack. Therefore, I'm migrating to C++11 nullptr.
      
      llvm-svn: 223079
      ee7cf84c
    • Philip Reames's avatar
      [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics · 337c4bd4
      Philip Reames authored
      The statepoint intrinsics are intended to enable precise root tracking through the compiler as to support garbage collectors of all types. The addition of the statepoint intrinsics to LLVM should have no impact on the compilation of any program which does not contain them. There are no side tables created, no extra metadata, and no inhibited optimizations.
      
      A statepoint works by transforming a call site (or safepoint poll site) into an explicit relocation operation. It is the frontend's responsibility (or eventually the safepoint insertion pass we've developed, but that's not part of this patch series) to ensure that any live pointer to a GC object is correctly added to the statepoint and explicitly relocated. The relocated value is just a normal SSA value (as seen by the optimizer), so merges of relocated and unrelocated values are just normal phis. The explicit relocation operation, the fact the statepoint is assumed to clobber all memory, and the optimizers standard semantics ensure that the relocations flow through IR optimizations correctly.
      
      This is the first patch in a small series.  This patch contains only the IR parts; the documentation and backend support will be following separately.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.
      
      Reviewed by: atrick, ributzka
      
      llvm-svn: 223078
      337c4bd4
    • Jingyue Wu's avatar
      [NVPTX] Do not emit .weak symbols for NVPTX · 5b62eb9b
      Jingyue Wu authored
      Summary:
      ".weak" symbols cannot be consumed by ptxas (PR21685). This patch makes the
      weak directive in MCAsmPrinter customizable, and disables emitting ".weak"
      symbols for NVPTX.
      
      Test Plan: weak-linkage.ll
      
      Reviewers: jholewinski
      
      Reviewed By: jholewinski
      
      Subscribers: majnemer, jholewinski, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D6455
      
      llvm-svn: 223077
      5b62eb9b
    • Reid Kleckner's avatar
      Parse 'ghccc' in .ll files as the GHC convention (cc 10) · 35fc363c
      Reid Kleckner authored
      Previously we just used "cc 10" in the .ll files, but that isn't very
      human readable.
      
      llvm-svn: 223076
      35fc363c