Skip to content
  1. Feb 26, 2014
    • Chandler Carruth's avatar
      [SROA] Use the correct index integer size in GEPs through non-default · dfb2efd0
      Chandler Carruth authored
      address spaces.
      
      This isn't really a correctness issue (the values are truncated) but its
      much cleaner.
      
      Patch by Matt Arsenault!
      
      llvm-svn: 202252
      dfb2efd0
    • Chandler Carruth's avatar
      Add two helpers to IRBuilder to flesh the interface out to N-width · ca4caa87
      Chandler Carruth authored
      integers. Complements the interfaces it is wrapping.
      
      llvm-svn: 202251
      ca4caa87
    • Evgeniy Stepanov's avatar
      [asan] Fix printing of long reports to logcat on Android. · f4dcf776
      Evgeniy Stepanov authored
      __android_log_write has an implicit message length limit.
      Print one line at a time.
      
      llvm-svn: 202250
      f4dcf776
    • Evgeniy Stepanov's avatar
      [sanitizer] Add a flag to enable/disable report colorization. · e23add20
      Evgeniy Stepanov authored
      llvm-svn: 202249
      e23add20
    • Rui Ueyama's avatar
      [PECOFF] Emit Load Configuration and SEH Table for x86. · 2e09d93f
      Rui Ueyama authored
      If all input files are compatible with Structured Exception Handling, linker
      is supposed to create an exectuable with a table for SEH handlers. The table
      consists of exception handlers entry point addresses.
      
      The basic idea of SEH in x86 Microsoft ABI is to list all valid entry points
      of exception handlers in an read-only memory, so that an attacker cannot
      override the addresses in it. In x86 ABI, data for exception handling is mostly
      on stack, so it's volnerable to stack overflow attack. In order to protect
      against it, Windows runtime uses the table to check a return address, to
      ensure that the address is really an valid entry point for an exception handler.
      
      Compiler emits a list of exception handler functions to .sxdata section. It
      also emits a marker symbol "@feat.00" to indicate that the object is compatible
      with SEH. SEH is a relatively new feature for COFF, and mixing SEH-compatible
      and SEH-incompatible objects will result in an invalid executable, so is the
      marker.
      
      If all input files are compatible with SEH, LLD emits a SEH table. SEH table
      needs to be pointed by Load Configuration strucutre, so when emitting a SEH
      table LLD emits it too. The address of a Load Configuration will be stored to
      the file header.
      
      llvm-svn: 202248
      2e09d93f
    • Chandler Carruth's avatar
      [SROA] Teach SROA how to handle pointers from address spaces other than · 286d87ed
      Chandler Carruth authored
      the default.
      
      Based on the patch by Matt Arsenault, D1764!
      
      I switched one place to use the more direct pointer type to compute the
      desired address space, and I reworked the memcpy rewriting section to
      reflect significant refactorings that this patch helped inspire.
      
      Thanks to several of the folks who helped review and improve the patch
      as well.
      
      llvm-svn: 202247
      286d87ed
    • Evgeniy Stepanov's avatar
      [asan] asan_device_setup: fix a typo in usage text · 3ff723f3
      Evgeniy Stepanov authored
      llvm-svn: 202246
      3ff723f3
    • Evgeniy Stepanov's avatar
      [asan] Remove .sh extension from asan_device_setup. · 84610ed7
      Evgeniy Stepanov authored
      llvm-svn: 202245
      84610ed7
    • Alexey Samsonov's avatar
      Revert r201783 until all FreeBSD fixes are submitted. · 10d0003a
      Alexey Samsonov authored
      llvm-svn: 202244
      10d0003a
    • Todd Fiala's avatar
      Suppress python readline module under Linux to fix a seg fault. · 9bb71b73
      Todd Fiala authored
      Bug fix for pr18841:
      http://llvm.org/bugs/show_bug.cgi?id=18841
      
      This change creates a stub Python readline.so module that does almost
      nothing. Its whole purpose is to prevent Python from loading the real
      module, something it does during the embedded Python interpreter's
      initialization sequence (and way before lldb ever requests it within
      embedded_interpreter.py).
      
      On Ubuntu 12.04 and 13.10 x86_64, and in the Python 2.7.6 tree, the
      stock Python readline module links against the GNU readline library.
      This appears to be the case on all Pythons except where __APPLE__ is
      defined. LLDB now requires linking against the libedit library.
      Something about having both libedit.so and libreadline.so linked into
      the same process space is causing the Python readline.so to trigger a
      NULL memory access. I have put in a separate patch to python.org.
      
      This suppression of embedded interpreter readline support can be
      removed if at least any one of the following happens:
      
      1. The stock python distribution accepts a patch similar to what I
      submitted to Python 2.7.6's Modules/readline.c file.
      
      2. The stock python distribution implements Modules/readline.c in
      terms of libedit's readline compatibility mode (i.e. essentially
      compiles it the way __APPLE__ compiles that module) under Linux.
      
      3. a clean-room implementation of the python readline module is
      implemented against libedit (either readline compatibility mode or
      native libedit). This could be implemented within the readline.cpp
      file that this change introduces. It cannot be a fork of python's
      readline.c module due to llvm licensing.
      
      The net effect of this change on Linux is that the embedded python's
      readline support will not exist.
      
      llvm-svn: 202243
      9bb71b73
    • Chandler Carruth's avatar
      [SROA] Split the alignment computation complete for the memcpy rewriting · aa72b93a
      Chandler Carruth authored
      to work independently for the slice side and the other side.
      
      This allows us to only compute the minimum of the two when we actually
      rewrite to a memcpy that needs to take the minimum, and preserve higher
      alignment for one side or the other when rewriting to loads and stores.
      
      This fix was inspired by seeing the result of some refactoring that
      makes addrspace handling better.
      
      llvm-svn: 202242
      aa72b93a
    • NAKAMURA Takumi's avatar
      [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to... · 955d27a4
      NAKAMURA Takumi authored
      [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase opportunity for parallel build.
      
      target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library,
      although final targets have dependencies to whole dependent libraries.
      It makes most libraries can be built in parallel.
      
      target_link_libraries(PRIVATE) is used to shaared library.
      Each dependent library is linked to the target.so, and its user will not see its grandchildren.
      For example,
      
        - libclang.so has sufficient libclang*.a(s).
        - c-index-test requires just only libclang.so.
      
      FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing.
      llvm-svn: 202241
      955d27a4
    • Craig Topper's avatar
      [x86] Add same itinerary to SYSEXIT64 as SYSEXIT for consistency. · 9df497e5
      Craig Topper authored
      llvm-svn: 202240
      9df497e5
    • NAKAMURA Takumi's avatar
      [CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE). · 9cd9ad6b
      NAKAMURA Takumi authored
      For now, use both keywords, INTERFACE and PRIVATE via the variable,
        - ${cmake_2_8_12_INTERFACE}
        - ${cmake_2_8_12_PRIVATE}
      
      They could be cleaned up when we introduce 2.8.12.
      
      llvm-svn: 202239
      9cd9ad6b
    • NAKAMURA Takumi's avatar
      [CMake] Use LINK_LIBS instead of target_link_libraries(). · 96986865
      NAKAMURA Takumi authored
      llvm-svn: 202238
      96986865
    • NAKAMURA Takumi's avatar
      [CMake] Apply DEPENDS intrinsics_gen in clangCodeGen. · 55a02eaa
      NAKAMURA Takumi authored
      llvm-svn: 202237
      55a02eaa
    • NAKAMURA Takumi's avatar
      lldReaderWriter: move LLVM_LINK_COMPONENTS. It seems Subdirectories don't depend on LLVMObject. · 9f4ee24a
      NAKAMURA Takumi authored
      Please give LLVMObject explicitly in each subdirectory if any of subdirectories required it.
      
      llvm-svn: 202236
      9f4ee24a
    • NAKAMURA Takumi's avatar
      [CMake] Declare cmake_minimum_required() unconditionally. · 23850261
      NAKAMURA Takumi authored
      llvm-svn: 202235
      23850261
    • Craig Topper's avatar
      [x86] Remove some unused instruction format classes. · c30b81ea
      Craig Topper authored
      llvm-svn: 202234
      c30b81ea
    • Craig Topper's avatar
      [x86] Simplify disassembler code slightly. · e413b628
      Craig Topper authored
      llvm-svn: 202233
      e413b628
    • Chandler Carruth's avatar
      [SROA] The original refactoring inspired by the addrspace patch in · 181ed05b
      Chandler Carruth authored
      D1764, which in turn set off the other refactorings to make
      'getSliceAlign()' a sensible thing.
      
      There are two possible inputs to the required alignment of a memory
      transfer intrinsic: the alignment constraints of the source and the
      destination. If we are *only* introducing a (potentially new) offset
      onto one side of the transfer, we don't need to consider the alignment
      constraints of the other side. Use this to simplify the logic feeding
      into alignment computation for unsplit transfers.
      
      Also, hoist the clamp of the magical zero alignment for these intrinsics
      to the more customary one alignment early. This lets several other
      conditions melt away.
      
      No functionality changed. There is a further improvement this exposes
      which *will* change functionality, but that's arriving in a separate
      patch.
      
      llvm-svn: 202232
      181ed05b
    • Chandler Carruth's avatar
      [SROA] Yet another slight refactoring that simplifies an API in the · 47954c80
      Chandler Carruth authored
      rewriting logic: don't pass custom offsets for the adjusted pointer to
      the new alloca.
      
      We always passed NewBeginOffset here. Sometimes we spelled it
      BeginOffset, but only when they were in fact equal. Whats worse, the API
      is set up so that you can't reasonably call it with anything else -- it
      assumes that you're passing it an offset relative to the *original*
      alloca that happens to fall within the new one. That's the whole point
      of NewBeginOffset, it's the clamped beginning offset.
      
      No functionality changed.
      
      llvm-svn: 202231
      47954c80
    • Chandler Carruth's avatar
      [SROA] Simplify the computing of alignment: we only ever need the · 2659e503
      Chandler Carruth authored
      alignment of the slice being rewritten, not any arbitrary offset.
      
      Every caller is really just trying to compute the alignment for the
      whole slice, never for some arbitrary alignment. They are also just
      passing a type when they have one to see if we can skip an explicit
      alignment in the IR by using the type's alignment. This makes for a much
      simpler interface.
      
      Another refactoring inspired by the addrspace patch for SROA, although
      only loosely related.
      
      llvm-svn: 202230
      2659e503
    • Chandler Carruth's avatar
      [SROA] Use NewOffsetBegin in the unsplit case for memset merely for · 735d5bee
      Chandler Carruth authored
      consistency with memcpy rewriting, and fix a latent bug in the alignment
      management for memset.
      
      The alignment issue is that getAdjustedAllocaPtr is computing the
      *relative* offset into the new alloca, but the alignment isn't being set
      to the relative offset, it was using the the absolute offset which is
      into the old alloca.
      
      I don't think its possible to write a test case that actually reaches
      this code where the resulting alignment would be observably different,
      but the intent was clearly to use the relative offset within the new
      alloca.
      
      llvm-svn: 202229
      735d5bee
    • Chandler Carruth's avatar
      [SROA] Use the members for New{Begin,End}Offset in the rewrite helpers · ea27cf08
      Chandler Carruth authored
      rather than passing them as arguments.
      
      While I generally prefer actual arguments, in this case the readability
      loss is substantial. By using members we avoid repeatedly calculating
      the offsets, and once we're using members it is useful to ensure that
      those names *always* refer to the original-alloca-relative new offset
      for a rewritten slice.
      
      No functionality changed. Follow-up refactoring, all toward getting the
      address space patch merged.
      
      llvm-svn: 202228
      ea27cf08
    • Chandler Carruth's avatar
      [SROA] Compute the New{Begin,End}Offset values once for each alloca · c46b6eb3
      Chandler Carruth authored
      slice being rewritten.
      
      We had the same code scattered across most of the visits. Instead,
      compute the new offsets and the slice size once when we start to visit
      a particular slice, and use the member variables from then on. This
      reduces quite a bit of code duplication.
      
      No functionality changed. Refactoring inspired to make it easier to
      apply the address space patch to SROA.
      
      llvm-svn: 202227
      c46b6eb3
    • NAKAMURA Takumi's avatar
    • Ben Langmuir's avatar
      Use StringRef in raw_fd_ostream constructor · 6a2a14da
      Ben Langmuir authored
      llvm-svn: 202225
      6a2a14da
    • Chandler Carruth's avatar
      [SROA] Fix PR18615 with some long overdue simplifications to the bounds · 6aedc106
      Chandler Carruth authored
      checking in SROA.
      
      The primary change is to just rely on uge for checking that the offset
      is within the allocation size. This removes the explicit checks against
      isNegative which were terribly error prone (including the reversed logic
      that led to PR18615) and prevented us from supporting stack allocations
      larger than half the address space.... Ok, so maybe the latter isn't
      *common* but it's a silly restriction to have.
      
      Also, we used to try to support a PHI node which loaded from before the
      start of the allocation if any of the loaded bytes were within the
      allocation. This doesn't make any sense, we have never really supported
      loading or storing *before* the allocation starts. The simplified logic
      just doesn't care.
      
      We continue to allow loading past the end of the allocation in part to
      support cases where there is a PHI and some loads are larger than others
      and the larger ones reach past the end of the allocation. We could solve
      this a different and more conservative way, but I'm still somewhat
      paranoid about this.
      
      llvm-svn: 202224
      6aedc106
    • Richard Trieu's avatar
      Remove 'tctx->name' from a logical statement since it is a pointer and always · a170f081
      Richard Trieu authored
      is converted to a true value.  Detected by Clang's improved -Wbool-conversion
      
      llvm-svn: 202223
      a170f081
    • Nick Lewycky's avatar
      ea08c709
    • Eric Christopher's avatar
      80-col. · f9761a29
      Eric Christopher authored
      llvm-svn: 202221
      f9761a29
    • Eric Christopher's avatar
      Formatting fixups. · 73ffdb8b
      Eric Christopher authored
      llvm-svn: 202220
      73ffdb8b
    • Eric Christopher's avatar
      80-col and bad line ending fixups. · 0a1301fe
      Eric Christopher authored
      llvm-svn: 202219
      0a1301fe
    • Nick Lewycky's avatar
      Delete two declared overloads of CallInst::CallInst that are never defined or... · d883a1c1
      Nick Lewycky authored
      Delete two declared overloads of CallInst::CallInst that are never defined or used. No functionality change.
      
      llvm-svn: 202218
      d883a1c1
    • Rui Ueyama's avatar
      [PECOFF] Add a utility function to add DIR32 relocation. · aaf2816d
      Rui Ueyama authored
      llvm-svn: 202217
      aaf2816d
    • Richard Trieu's avatar
      PR16074, implement warnings to catch pointer to boolean true and pointer to · 3bb8b56a
      Richard Trieu authored
      null comparison when the pointer is known to be non-null.
      
      This catches the array to pointer decay, function to pointer decay and
      address of variables.  This does not catch address of function since this
      has been previously used to silence a warning.
      
      Pointer to bool conversion is under -Wbool-conversion.
      Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group
      of -Wtautological-compare.
      
      void foo() {
        int arr[5];
        int x;
        // warn on these conditionals
        if (foo);
        if (arr);
        if (&x);
        if (foo == null);
        if (arr == null);
        if (&x == null);
      
        if (&foo);  // no warning
      }
      
      llvm-svn: 202216
      3bb8b56a
    • Rui Ueyama's avatar
      [PECOFF] Fix DLLCharacteristics field. · f9be75f5
      Rui Ueyama authored
      IMAGE_DLL_CHARACTERISTICS_NO_SEH flag should be set only when SEH is disabled.
      
      llvm-svn: 202215
      f9be75f5
    • Marshall Clow's avatar
      Implement LWG issue 2306: match_results::reference should be value_type&, not... · 16da3240
      Marshall Clow authored
      Implement LWG issue 2306: match_results::reference should be value_type&, not const value_type&. This is a general move by the LWG to have the reference type of read-only containers be a non-const reference; however, there are no methods that return a non-const reference to a match_result entry, so there's no worries about getting a non-const reference to a constant object.
      
      llvm-svn: 202214
      16da3240
    • Paul Robinson's avatar
      Constify the Optnone checks in IR passes. · 0c12b1d2
      Paul Robinson authored
      llvm-svn: 202213
      0c12b1d2
Loading