1. May 16, 2024
    • Aaron Ballman's avatar
      Correct mismatched allocation/deallocation calls · 3f954f57
      Aaron Ballman authored
      This amends dceaa0f4 because ASAN
      caught an issue where the allocation and deallocation were not properly
      paired: https://lab.llvm.org/buildbot/#/builders/239/builds/7001
      
      Use malloc and free throughout this file to ensure that all kinds of
      memory buffers use the proper pairing.
      3f954f57
    • Benjamin Kramer's avatar
      [mlir] Fix the build after 03c53c69 · 29c2475f
      Benjamin Kramer authored
      29c2475f
    • Craig Topper's avatar
      f0e79db2
    • Nuri Amari's avatar
      [lld] Fix -ObjC load behavior with LTO (#92162) · 141391ad
      Nuri Amari authored
      
      
      When -ObjC is passed, the linker must force load any object files that
      contain special sections that store Objective-C / Swift information that
      is used at runtime.
      
      This should work regadless if input files are bitcode or native, but it
      was not working with bitcode. This is because the sections that identify
      an object file that should be loaded were inconsistent when dealing with
      a native file vs bitcode file. In particular, bitcode files were not
      searched for `__TEXT,__swift` prefixed sections, while native files
      were.
      
      This means LLD wasn't loading certain bitcode files and forcing the user
      to introduce --force-load to their linker invocation for that archive.
      
      Co-authored-by: default avatarNuri Amari <nuriamari@fb.com>
      141391ad
    • Fangrui Song's avatar
      [MC] Remove UseAssemblerInfoForParsing · 03c53c69
      Fangrui Song authored
      Commit 6c0665e2
      (https://reviews.llvm.org/D45164) enabled certain constant expression
      evaluation for `MCObjectStreamer` at parse time (e.g. `.if` directives,
      see llvm/test/MC/AsmParser/assembler-expressions.s).
      
      `getUseAssemblerInfoForParsing` was added to make `clang -c` handling
      inline assembly similar to `MCAsmStreamer` (e.g. `llvm-mc -filetype=asm`),
      where such expression folding (related to
      `AttemptToFoldSymbolOffsetDifference`) is unavailable.
      
      I believe this is overly conservative. We can make some parse-time
      expression folding work for `clang -c` even if `clang -S` would still
      report an error, a MCAsmStreamer issue (we cannot print `.if`
      directives) that should not restrict the functionality of
      MCObjectStreamer.
      
      ```
      % cat b.cc
      asm(R"(
      .pushsection .text,"ax"
      .globl _start; _start: ret
      .if . -_start == 1
        ret
      .endif
      .popsection
      )");
      % gcc -S b.cc && gcc -c b.cc
      % clang -S -fno-integrated-as b.cc     # succeeded
      
      % clang -c b.c...
      03c53c69
    • Serge Pavlov's avatar
      [clang] Store FPOptions earlier when parsing function (#92146) · 9bbefb7f
      Serge Pavlov authored
      After https://github.com/llvm/llvm-project/pull/85605 ([clang] Set
      correct FPOptions if attribute 'optnone' presents) the current FP
      options in Sema are saved during parsing function because Sema can
      modify them if optnone is present. However they were saved too late, it
      caused fails in some cases when precompiled headers are used. This patch
      moves the storing earlier.
      9bbefb7f
  2. May 15, 2024