1. Nov 14, 2023
    • Jan Kokemüller's avatar
      [libc++] Fix UB in <expected> related to "has value" flag (#68552) (#68733) · 0a127422
      Jan Kokemüller authored
      The calls to std::construct_at might overwrite the previously set
      __has_value_ flag in the case where the flag is overlapping with
      the actual value or error being stored (since we use [[no_unique_address]]).
      To fix this issue, this patch ensures that we initialize the
      __has_value_ flag after we call std::construct_at.
      
      Fixes #68552
      
      (cherry picked from commit 134c9159)
      0a127422
    • antoine moynault's avatar
      [clang] fix test PR69717.cpp (#72134) · 42f8800b
      antoine moynault authored
      Test still fail on ARM machine (no float_control support)
      
      (cherry picked from commit 5fdb70be)
      42f8800b
    • Serge Pavlov's avatar
      [clang] Run test on x86 only · e666be92
      Serge Pavlov authored
      The test Sema/PR69717.cpp fails on platforms that do not support
      pragma float_control. So run this test on x86 only.
      
      (cherry picked from commit 93ae2633)
      e666be92
    • Serge Pavlov's avatar
      [clang] Do not clear FP pragma stack when instantiating functions (#70646) · aebee698
      Serge Pavlov authored
      When instantiation function, a call to Sema::resetFPOption was used to
      set the FP options associated with AST node. However this function also
      cleared FP pragma stack, and it is incorrect. Template instantiation
      takes place on AST representation and semantic information like the FP
      pragma stack should not affect it. This was a reason for miscompilation
      in some cases.
      
      To make the Sema interface more consistent, now `resetFPOptions` does
      not clear FP pragma stack anymore. It is cleared in
      `FpPragmaStackSaveRAII`, which is used in parsing only.
      
      This change must fix https://github.com/llvm/llvm-project/issues/69717
      (Problems with float_control pragma stack in Clang 17.x).
      
      (cherry picked from commit f6f625f4)
      aebee698
  2. Nov 13, 2023
    • Alexey Bataev's avatar
      [SLP]Fix PR70004: Do not change insert point for reduction gather nodes. · 529aa6ea
      Alexey Bataev authored
      No need to change the insert point for reduction gather node, we can use
      the ReductionRoot as insert point instead to avoid possible crashes.
      
      (cherry picked from commit d79051f8)
      529aa6ea
    • Simon Pilgrim's avatar
      [DAG] WidenVectorOperand - add basic handling for *_EXTEND_VECTOR_INREG nodes · 69b3baf9
      Simon Pilgrim authored
      Fixes Issue #70208
      
      (cherry picked from commit c9c9bf0f)
      69b3baf9
    • Craig Topper's avatar
      [Mips] In LowerShift*Parts, xor with bits-1 instead of -1. (#71149) · e7dc53b9
      Craig Topper authored
      If we start with an i128 shift, the initial shift amount would usually
      have zeros in bit 8 and above. xoring the shift amount with -1 will set
      those upper bits to 1. If DAGCombiner is able to prove those bits are
      now 1, then the shift that uses the xor will be replaced with undef.
      Which we don't want.
      
      Reduce the xor constant to VT.bits-1 where VT is half the size of the
      larger shift type. This avoids toggling the upper bits. The hardware
      shift instruction only uses the lower bits of the shift amount. I assume
      the code used NOT because the hardware doesn't use the upper bits, but
      that isn't compatible with the LLVM poison semantics.
      
      Fixes #71142.
      
      (cherry picked from commit 8d24d390)
      e7dc53b9
    • Owen Pan's avatar
      [clang-format] Correctly annotate keyword operator function name (#66904) · a6cbdae9
      Owen Pan authored
      Fixes #66890.
      
      (cherry picked from commit 67b99fa8)
      a6cbdae9
    • Tobias Hieta's avatar
      Bump version to 17.0.5 · 094cfd14
      Tobias Hieta authored
      094cfd14
    • Rainer Orth's avatar
      [Driver] Fix linking with -lm on Solaris (#65632) · 05422e1d
      Rainer Orth authored
      As noticed in D158846, the Solaris driver deviates from other targets in
      that it links every executable with `-lm`, but doesn't for shared
      objects. For C code, this is unnecessary, while for C++ `libm` is always
      needed, even for shared objects.
      
      This patch fixes this by following the `Gnu.cpp` precedent. It adjusts
      the `solaris-ld.c` test accordingly, adding some more tests.
      
      Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
      `x86_64-pc-linux-gnu`.
      
      (cherry picked from commit 1e6b0df3)
      05422e1d
    • Martin Storsjö's avatar
      [clang-repl] Fix BUILD_SHARED_LIBS symbols from libclangInterpreter on MinGW (#71393) · 910748f4
      Martin Storsjö authored
      A few symbols within libclangInterpreter have got explicit dllexport
      attributes, in order to make them exported (and thus visible at runtime)
      in any build, not only when they are part of e.g. a DLL libclang-cpp,
      but also when they are part of a plain .exe.
      
      Due to the explicit dllexports, these symbols would sidestep the regular
      MinGW logic of exporting all symbols if there are no dllexports.
      Therefore, for libclang-cpp, a separate fix was made in
      592e935e, to pass --export-all-symbols
      to the build of libclang-cpp.
      
      If building with BUILD_SHARED_LIBS enabled, then the same issue appears
      in libclangInterpreter; pass the same flag --export-all-symbols there as
      well, to make sure all symbols are visible, not only the ones that are
      explicitly marked as dllexport.
      
      (cherry picked from commit 0d3eeac8)
      910748f4
    • Nick Desaulniers's avatar
      [CGExprConstant] stop calling into ConstExprEmitter for Reference type destinations (#70366) · 582f0469
      Nick Desaulniers authored
      Fixes a bug introduced by
      commit b54294e2 ("[clang][ConstantEmitter] have
      tryEmitPrivate[ForVarInit] try ConstExprEmitter fast-path first")
      
      In the added test case, the QualType is a LValueReferenceType.
      
          LValueReferenceType 0x558412998d90 'const char (&)[41]'
          `-ParenType 0x558412998d30 'const char[41]' sugar
            `-ConstantArrayType 0x558412998cf0 'const char[41]' 41
              `-QualType 0x55841294c271 'const char' const
                `-BuiltinType 0x55841294c270 'char'
      
      Fixes: #69979
      (cherry picked from commit d9b15b06)
      582f0469
  3. Oct 31, 2023
  4. Oct 30, 2023
  5. Oct 27, 2023
  6. Oct 25, 2023
  7. Oct 24, 2023
  8. Oct 23, 2023