[PATCH] D105320: [CodeView] Saturate values bigger than supported by APInt.

Matheus Izvekov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 13:03:01 PDT 2021


mizvekov added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3167
+
+  // TODO: Need to support bigger ints like __int128.
+  OS.AddComment("Value");
----------------
rnk wrote:
> I don't think we need a TODO here. If Microsoft ever adds an encoding for large integers, the code change will be elsewhere, and in the process of testing, this size 10 array is bounds checked during the writing process, so we don't need this comment to remind us to change this code.
I agree the comment does not belong here, but I think we have encodings already, both for the value and the type.

`CodeViewTypes.def`:
```
CV_TYPE(LF_OCTWORD, 0x8017)
CV_TYPE(LF_UOCTWORD, 0x8018)
```

`CodeViewDebug.cpp`:
```
  case dwarf::DW_ATE_signed:
    switch (ByteSize) {
    case 1:  STK = SimpleTypeKind::SignedCharacter; break;
    case 2:  STK = SimpleTypeKind::Int16Short;      break;
    case 4:  STK = SimpleTypeKind::Int32;           break;
    case 8:  STK = SimpleTypeKind::Int64Quad;       break;
    case 16: STK = SimpleTypeKind::Int128Oct;       break; // <-------
    }
```

Unless it would be risky to try to use them, if for example the Microsoft tooling would have trouble digesting it?

FWIW I would have considered adding this support, but then I found all those other problems, and time is a bit short until release branching.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105320/new/

https://reviews.llvm.org/D105320



More information about the llvm-commits mailing list