Skip to content
  1. Dec 29, 2014
    • Chandler Carruth's avatar
      [multilib] Add support to the autoconf build to substitute · 9db2b524
      Chandler Carruth authored
      a CLANG_LIBDIR_SUFFIX variable. This is necessary before I can add
      support for using that variable to CMake and the C++ code in Clang, and
      the autoconf build system does all substitutions in the LLVM tree.
      
      As mentioned before, I'm not planning to add actual multilib support to
      the autoconf build, just enough stubs for it to keep playing nicely with
      the CMake build once that one has support.
      
      llvm-svn: 224922
      9db2b524
    • Chandler Carruth's avatar
      [cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX. · 7d58776f
      Chandler Carruth authored
      For this to work, we have to encode it in the build variables and use it
      from llvm-config.cpp. I've tried to do this reasonably cleanly, but the
      code for llvm-config.cpp is pretty strange. However, with this,
      llvm-config stops giving the wrong answer when using LLVM_LIBDIR_SUFFIX.
      
      Note that the configure+make build just sets this to an empty string as
      that build system has zero support for multilib of any form. I'm not
      planning to add support there either, but this should leave a path for
      anyone that wanted to.
      
      llvm-svn: 224921
      7d58776f
    • Chandler Carruth's avatar
      [cmake] Push LLVM_LIBDIR_SUFFIX through to the LLVMConfig.cmake file · ab8df0b6
      Chandler Carruth authored
      that is used by other projects to build against LLVM. This will allow
      subsequent patches to them to use LLVM_LIBDIR_SUFFIX, both when built as
      part of the larger LLVM build an as part of a standalone build against
      an installed set of LLVM libraries.
      
      llvm-svn: 224920
      ab8df0b6
    • Chandler Carruth's avatar
      [cmake] Start making LLVM_LIBDIR_SUFFIX effective by adding it to · a78e24e5
      Chandler Carruth authored
      *numerous* places where it was missing in the CMake build. The primary
      change here is that the suffix is now actually used for all of the lib
      directories in the LLVM project's CMake. The various subprojects still
      need similar treatment.
      
      This is the first of a series of commits to try to make LLVM's cmake
      effective in a multilib Linux installation. I don't think many people
      are seriously using this variable so I'm hoping the fallout will be
      minimal. A somewhat unfortunate consequence of the nature of these
      commits is that until I land all of them, they will in part make the
      brokenness of our multilib support more apparant. At the end, things
      should actually work.
      
      llvm-svn: 224919
      a78e24e5
    • David Majnemer's avatar
      Sema: Permit array l-values in asm output operands · 04b78412
      David Majnemer authored
      GCC permits array l-values in asm output operands even though they
      aren't modifiable l-values.  We used to permit it but this behavior
      regressed in r224916.
      
      llvm-svn: 224918
      04b78412
    • Elena Demikhovsky's avatar
      Fixed 2 minor typos in the documentation. · e86c8c80
      Elena Demikhovsky authored
      llvm-svn: 224917
      e86c8c80
    • David Majnemer's avatar
      Sema: Only permit permit modifiable l-values as asm output params · 0f4d6410
      David Majnemer authored
      Functions are l-values in C++ but shouldn't be available as output
      parameters in inline assembly.  Neither should overloaded function
      l-values.
      
      This fixes PR21949.
      
      llvm-svn: 224916
      0f4d6410
    • Nico Weber's avatar
      Don't crash on malformed attributes in an incorrect location. · 4b4be84a
      Nico Weber authored
      r168626 added nicer diagnostics for attributes in the wrong places, such as
      after the `final` on a class.  To do this, it added code that did high-level
      pattern matching for e.g. 'final' 'alignas' '(' and then skipped until the
      closing ')'.  If it saw that, it then went down the regular class parsing
      path and then called MaybeParseCXX11Attributes() to parse the attribute after
      the 'final' using real attribute parsing code.  On invalid attributes, the
      real attribute parsing code could eat more tokens than the pattern matching
      code and for example skip past the '{' starting the class, which would then
      lead to an assert.  To prevent this, check for a good state after calling
      MaybeParseCXX11Attributes() (which morphed into CheckMisplacedCXX11Attribute()
      in r175575) and bail out if things look bleak.
      
      Found by SLi's afl bot.
      
      llvm-svn: 224915
      4b4be84a
    • Craig Topper's avatar
    • Craig Topper's avatar
      [x86] Put 'C' after 'i' on all the AVX-512 intrisics that take const ints. 'C'... · 6c0d9edb
      Craig Topper authored
      [x86] Put 'C' after 'i' on all the AVX-512 intrisics that take const ints. 'C' is a suffix modifier not a prefix modififier. Also put 'C' on the pointers in all of the gather instrinsics. I think they previously had one due to the misordering. I'm still thinking the 'iC' actually need to be a 'Ii' since they really require an ICE.
      
      llvm-svn: 224913
      6c0d9edb
    • David Majnemer's avatar
      Sema: Don't crash when solitary :: token appears before { in struct def · be4c437f
      David Majnemer authored
      hasDeclaratorForAnonDecl, getDeclaratorForAnonDecl and
      getTypedefNameForAnonDecl are expected to handle the case where
      NamedDeclOrQualifier holds the wrong type or nothing at all.
      
      llvm-svn: 224912
      be4c437f
    • David Majnemer's avatar
      Sema: Forbid inconsistent constraint alternatives · c63fa612
      David Majnemer authored
      Verify that asm constraints have the same number of alternatives
      
      llvm-svn: 224911
      c63fa612
    • Kuba Brecka's avatar
      [sanitizer-common] Fixing the ASan test build failure on OS X · c52f3006
      Kuba Brecka authored
      The change in r224819 started using internal_unlink in a sanitizer_common unit test. For some reason, internal_unlink is not defined in sanitizer_mac.cc, fixing that.
      
      llvm-svn: 224910
      c52f3006
    • David Majnemer's avatar
      SemaCXX: Don't crash when annotation tokens show up before the tag name · 86330afd
      David Majnemer authored
      Clang has a hack to accept definitions of structs with tag names which
      have the same name as intrinsics.  However, this hack didn't guard
      against annotation tokens showing up in the token stream.
      
      llvm-svn: 224909
      86330afd
    • David Majnemer's avatar
      CodeGen: Optimize emssion of zeroinitialzied arrays · 90d85448
      David Majnemer authored
      Create an ConstantAggregateZero upfront if we see that it is viable.
      This saves us from having to manually push_back each and every
      initializer and then looping back over them to determine if they are
      'null'.
      
      llvm-svn: 224908
      90d85448
    • NAKAMURA Takumi's avatar
    • Nico Weber's avatar
      Don't crash on surprising tokens in default parameter template lists. · c29c4835
      Nico Weber authored
      Fixes this snippet from SLi's afl fuzzer output:
      
        class {
            i (x = <, enum
      
      This parsed i as a function, x as a paramter, and the stuff after < as a
      template list.  This then called TryConsumeDeclarationSpecifier() which
      called TryAnnotateCXXScopeToken() without checking the preconditions of
      this function.  Check them before calling, like all other callers of
      TryAnnotateCXXScopeToken() do.
      
      A more readable reproducer that causes the same crash is
      
        class {
            void i(int x = MyTemplateClass<int, union int>::foo());
        };
      
      The reduced version used an eof token as surprising token, but kw_int works
      just as well to repro and is easier to insert into a test file.
      
      llvm-svn: 224906
      c29c4835
  2. Dec 28, 2014
  3. Dec 27, 2014
    • Nico Weber's avatar
      Objective-C: Serialize "more than one decl" state of ObjCMethodList. · ff4b35e6
      Nico Weber authored
      This fixes PR21587, what r221933 fixed for regular programs is now also
      fixed for decls coming from PCH files.
      
      Use another bit from the count/bits uint16_t for storing the "more than one
      decl" bit.  This reduces the number of bits for the count from 14 to 13.
      The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits
      should still be plenty.  Since this changes the meaning of a serialized bit
      pattern, also increase clang::serialization::VERSION_MAJOR.
      
      Storing the "more than one decl" state of only the first overload isn't quite
      correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at
      the state of the first overload so it's good enough for now.
      
      llvm-svn: 224892
      ff4b35e6
    • Craig Topper's avatar
      [x86] Prevent instruction selection of AVX512 cmp.ps/pd/ss/sd intrinsics with... · 6e3a5828
      Craig Topper authored
      [x86] Prevent instruction selection of AVX512 cmp.ps/pd/ss/sd intrinsics with illegal immediates. Correctly this time. I did the wrong patterns the first time.
      
      llvm-svn: 224891
      6e3a5828
    • David Majnemer's avatar
      PowerPC: CTR shouldn't fire if a TLS call is in the loop · d0bcef20
      David Majnemer authored
      Determining the address of a TLS variable results in a function call in
      certain TLS models.  This means that a simple ICmpInst might actually
      result in invalidating the CTR register.
      
      In such cases, do not attempt to rely on the CTR register for loop
      optimization purposes.
      
      This fixes PR22034.
      
      Differential Revision: http://reviews.llvm.org/D6786
      
      llvm-svn: 224890
      d0bcef20
    • Aaron Ballman's avatar
    • Aaron Ballman's avatar
      Removing a variable that is set but never used, to silence a... · b66d54c5
      Aaron Ballman authored
      Removing a variable that is set but never used, to silence a -Wunused-but-set-variable warning; NFC.
      
      llvm-svn: 224888
      b66d54c5
    • Craig Topper's avatar
      [x86] Prevent instruction selection of AVX512 cmp.ps/pd/ss/sd intrinsics with... · 1113fb34
      Craig Topper authored
      [x86] Prevent instruction selection of AVX512 cmp.ps/pd/ss/sd intrinsics with illegal immediates. Forgot to do this when I did SSE/SSE2/AVX/AVX2.
      
      llvm-svn: 224887
      1113fb34
    • Craig Topper's avatar
      [x86] Assert on invalid immediates in the instruction printer for... · 53f75b9d
      Craig Topper authored
      [x86] Assert on invalid immediates in the instruction printer for cmp.ps/pd/ss/sd instead of truncating the immediate. The assembly parser and instruction selection shouldn't generate invalid immediates.
      
      llvm-svn: 224886
      53f75b9d
    • Craig Topper's avatar
      [x86] Prevent llvm.x86.cmp.ps/pd/ss/sd from being selected with bad... · acc73445
      Craig Topper authored
      [x86] Prevent llvm.x86.cmp.ps/pd/ss/sd from being selected with bad immediates. The frontend now checks this when the builtin is used. This will allow the instruction printer to not have to deal with invalid immediates on these instructions.
      
      llvm-svn: 224885
      acc73445
    • Keno Fischer's avatar
      [FastIsel][X86] Fix invalid register replacement for bool args · 8438b086
      Keno Fischer authored
      Summary:
      Consider the following IR:
      
        %3 = load i8* undef
        %4 = trunc i8 %3 to i1
        %5 = call %jl_value_t.0* @foo(..., i1 %4, ...)
        ret %jl_value_t.0* %5
      
      Bools (that are the result of direct truncs) are lowered as whatever
      the argument to the trunc was and a "and 1", causing the part of the
      MBB responsible for this argument to look something like this:
      
        %vreg8<def,tied1> = AND8ri %vreg7<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg8,%vreg7
      
      Later, when the load is lowered, it will insert
      
        %vreg15<def> = MOV8rm %vreg14, 1, %noreg, 0, %noreg; mem:LD1[undef] GR8:%vreg15 GR64:%vreg14
      
      but remember to (at the end of isel) replace vreg7 by vreg15. Now for
      the bug. In fast isel lowering, we mistakenly mark vreg8 as the result
      of the load instead of the trunc. This adds a fixup to have
      vreg8 replaced by whatever the result of the load is as well, so
      we end up with
      
        %vreg15<def,tied1> = AND8ri %vreg15<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg15
      
      which is an SSA violation and causes problems later down the road.
      
      This fixes PR21557.
      
      Test Plan: Test test case from PR21557 is added to the test suite.
      
      Reviewers: ributzka
      
      Reviewed By: ributzka
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D6245
      
      llvm-svn: 224884
      8438b086
    • Chandler Carruth's avatar
      [x86] Also add the missing type casts on the returns in the sha · 28daca21
      Chandler Carruth authored
      intrinsic header file. Along with r224822, this should restore the build
      bots to passing.
      
      llvm-svn: 224883
      28daca21
Loading