1. Oct 13, 2023
    • Tom Yang's avatar
      Add `target modules dump separate-debug-info` (#66035) · 64d78d8b
      Tom Yang authored
      
      
      Add a new command
      ```
      target modules dump separate-debug-info [-j] [<filename> [<filename> [...]]]
      ```
      or
      ```
      image dump separate-debug-info [-j] [<filename> [<filename> [...]]]
      ```
      (since `image` is an alias for `target modules`).
      This lists the separate debug info files and their current status
      (loaded or not loaded) for the specified modules. This diff implements
      this command for mach-O files with OSO and ELF files with dwo.
      Example dwo:
      ```
      (lldb) image dump separate-debug-info
      Symbol file: /home/toyang/workspace/dwo-scratch/a.out
      Type: "dwo"
      Dwo ID             Err Dwo Path
      ------------------ --- -----------------------------------------
      0x9a429da5abb6faae     /home/toyang/workspace/scratch-dwo/a-main.dwo
      0xbcc129959e76ff33     /home/toyang/workspace/scratch-dwo/a-foo.dwo
      
      (lldb) image dump separate-debug-info -j
      [
        {
          "separate-debug-info-files": [
            {
              "comp_dir": "/home/toyang/workspace/dwo-scratch",
              "dwo_id": 11115620165179865774,
              "dwo_name": "a-main.dwo",
              "loaded": true,
              "resolved_dwo_path": "/home/toyang/workspace/dwo-scratch/a-main.dwo"
            },
            {
              "comp_dir": "/home/toyang/workspace/dwo-scratch",
              "dwo_id": 13601198072221073203,
              "dwo_name": "a-foo.dwo",
              "loaded": true,
              "resolved_dwo_path": "/home/toyang/workspace/dwo-scratch/a-foo.dwo"
            }
          ],
          "symfile": "/home/toyang/workspace/dwo-scratch/a.out",
          "type": "dwo"
        }
      ]
      ```
      Example dwo with missing dwo:
      ```
      (lldb) image dump separate-debug-info
      Symbol file: /home/toyang/workspace/dwo-scratch/a.out
      Type: "dwo"
      Dwo ID             Err Dwo Path
      ------------------ --- -----------------------------------------
      0x9a429da5abb6faae E   unable to locate .dwo debug file "/home/toyang/workspace/scratch-dwo/b.out-main.dwo" for skeleton DIE 0x0000000000000014
      0xbcc129959e76ff33 E   unable to locate .dwo debug file "/home/toyang/workspace/scratch-dwo/b.out-foo.dwo" for skeleton DIE 0x000000000000003c
      
      (lldb) image dump separate-debug-info -j
      [
        {
          "separate-debug-info-files": [
            {
              "comp_dir": "/home/toyang/workspace/dwo-scratch",
              "dwo_id": 11115620165179865774,
              "dwo_name": "a-main.dwo",
              "error": "unable to locate .dwo debug file \"/home/toyang/workspace/dwo-scratch/a-main.dwo\" for skeleton DIE 0x0000000000000014",
              "loaded": false
            },
            {
              "comp_dir": "/home/toyang/workspace/dwo-scratch",
              "dwo_id": 13601198072221073203,
              "dwo_name": "a-foo.dwo",
              "error": "unable to locate .dwo debug file \"/home/toyang/workspace/dwo-scratch/a-foo.dwo\" for skeleton DIE 0x000000000000003c",
              "loaded": false
            }
          ],
          "symfile": "/home/toyang/workspace/dwo-scratch/a.out",
          "type": "dwo"
        }
      ]
      ```
      Example output with dwp:
      ```
      (lldb) image dump separate-debug-info
      Symbol file: /home/toyang/workspace/dwo-scratch/a.out
      Type: "dwo"
      Dwo ID             Err Dwo Path
      ------------------ --- -----------------------------------------
      0x9a429da5abb6faae     /home/toyang/workspace/dwo-scratch/a.out.dwp(a-main.dwo)
      0xbcc129959e76ff33     /home/toyang/workspace/dwo-scratch/a.out.dwp(a-foo.dwo)
      (lldb) image dump separate-debug-info -j
      [
        {
          "separate-debug-info-files": [
            {
              "comp_dir": "/home/toyang/workspace/dwo-scratch",
              "dwo_id": 11115620165179865774,
              "dwo_name": "a-main.dwo",
              "loaded": true,
              "resolved_dwo_path": "/home/toyang/workspace/dwo-scratch/a.out.dwp"
            },
            {
              "comp_dir": "/home/toyang/workspace/dwo-scratch",
              "dwo_id": 13601198072221073203,
              "dwo_name": "a-foo.dwo",
              "loaded": true,
              "resolved_dwo_path": "/home/toyang/workspace/dwo-scratch/a.out.dwp"
            }
          ],
          "symfile": "/home/toyang/workspace/dwo-scratch/a.out",
          "type": "dwo"
        }
      ]
      ```
      Example oso on my Mac:
      ```
      (lldb) image dump separate-debug-info
      Symbol file: /Users/toyang/workspace/scratch/a.out
      Type: "oso"
      Mod Time           Err Oso Path
      ------------------ --- ---------------------
      0x0000000064e64868     /Users/toyang/workspace/scratch/foo.a(foo.o)
      0x0000000064e64868     /Users/toyang/workspace/scratch/foo.a(main.o)
      
      (lldb) image dump separate-debug-info -j
      [
        {
          "separate-debug-info-files": [
            {
              "loaded": true,
              "oso_mod_time": 1692813416,
              "oso_path": "/Users/toyang/workspace/scratch/foo.a(foo.o)",
              "so_file": "/Users/toyang/workspace/scratch/foo.cpp"
            },
            {
              "loaded": true,
              "oso_mod_time": 1692813416,
              "oso_path": "/Users/toyang/workspace/scratch/foo.a(main.o)",
              "so_file": "/Users/toyang/workspace/scratch/main.cpp"
            }
          ],
          "symfile": "/Users/toyang/workspace/scratch/a.out",
          "type": "oso"
        }
      ]
      ```
      
      Test Plan:
      Tested on Mac OS and Linux.
      ```
      lldb-dotest -p TestDumpDwo
      lldb-dotest -p TestDumpOso
      ```
      
      ---------
      
      Co-authored-by: default avatarTom Yang <toyang@fb.com>
      64d78d8b
    • vabridgers's avatar
      [Sema] Add check for bitfield assignments to larger integral types (#68276) · dd0f642e
      vabridgers authored
      We noticed that clang does not check for bitfield assignment widths,
      while gcc does check this.
      
      gcc produced a warning like so for it's -Wconversion flag:
      ```
      $ gcc -Wconversion -c test.c
      test.c: In function 'foo':
      test.c:10:15: warning: conversion from 'int' to 'signed char:7' may change value [-Wconversion]
         10 |      vxx.bf = x; // no warning
            |               ^
      ```
      
      This change simply adds this check for integral types under the
      -Wbitfield-conversion compiler option.
      dd0f642e
    • Vlad Serebrennikov's avatar
      [clang][NFC] Specify Type and ExtQuals as having 16-byte alignment (#68377) · 4c6cba31
      Vlad Serebrennikov authored
      While working on LLDB visualizer for `QualType`, I stumbled upon `Type` and `ExtQuals` defined with `alignas(8)`. Such alignment leaves only 3 lower bits available for pointer tagging, whereas `QualType` requires 4 (3 qualifiers + discriminator between `Type *` and `ExtQuals *`). Turns out `Type` and its derived classes are allocated with `TypeAlignment == 16` passed to `Allocate()`. So I'm removing misleading `alignas(8)` and fixing corresponding static asserts. Since they are already allocated with 16-byte alignment, this is a non-functional change.
      4c6cba31
    • Louis Dionne's avatar
      [libc++] Improve the output of the generated-output CI job (#68903) · b56488c8
      Louis Dionne authored
      The step that checked for ignore_format.txt being consistent with the
      tree wouldn't print any explicit diagnostic when failing, which led to
      confusion. After this patch, an explicit diagnostic will be printed by
      the job along with the required diff to ignore_format.txt.
      b56488c8
    • LLVM GN Syncbot's avatar
      [gn build] Port 31c2cf11 · 9b89b80d
      LLVM GN Syncbot authored
      9b89b80d
    • Nico Weber's avatar
      [gn] port 0ce6255a (HipStdPar) · 7dcb260b
      Nico Weber authored
      7dcb260b
    • Benjamin Maxwell's avatar
      [mlir][ArmSVE] Avoid UBSAN issue with VectorType::Builder (NFC) · b44b3494
      Benjamin Maxwell authored
      This patch just avoids the underlying bug in VectorType::Builder, which
      currently has incorrect copy/move constructors.
      
      See https://lab.llvm.org/buildbot/#/builders/5/builds/37355
      b44b3494
    • Peiming Liu's avatar
    • Nico Weber's avatar
      [gn] port f445be97 · cff50072
      Nico Weber authored
      cff50072
    • Michael Liao's avatar
      [clang][Tests] Fix shared build. NFC · 7b12d8bf
      Michael Liao authored
      7b12d8bf
    • Michael Liao's avatar
      [Remarks] Fix '-fpermissive'. NFC · c136e722
      Michael Liao authored
      c136e722
    • ostannard's avatar
      [ARM] Correctly handle .inst in IT and VPT blocks (#68902) · b98b567c
      ostannard authored
      Advance the IT and VPT block state when parsing the .inst directive, so
      that it is possible to use them to emit conditional instructions. If we
      don't do this, then a later instruction inside or just after the block
      will have a mis-matched condition, so be incorrectly reported as an
      error.
      b98b567c
  2. Oct 12, 2023