diff options
| author | Timm Bäder <tbaeder@redhat.com> | 2025-01-08 15:09:52 +0100 |
|---|---|---|
| committer | Timm Bäder <tbaeder@redhat.com> | 2025-01-08 15:09:52 +0100 |
| commit | 59bdea24b09bca9332a7092b583ebf377efb0d50 (patch) | |
| tree | 51536c49c6c6b105f74c37bc531c270139a53253 /clang/lib/CodeGen/CGClass.cpp | |
| parent | 346fad5c2c28d0cd39475ae979ee468a420ebed7 (diff) | |
Revert "[clang] Avoid re-evaluating field bitwidth (#117732)"
This reverts commit 81fc3add1e627c23b7270fe2739cdacc09063e54.
This breaks some LLDB tests, e.g.
SymbolFile/DWARF/x86/no_unique_address-with-bitfields.cpp:
lldb: ../llvm-project/clang/lib/AST/Decl.cpp:4604: unsigned int clang::FieldDecl::getBitWidthValue() const: Assertion `isa<ConstantExpr>(getBitWidth())' failed.
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 8c190732c8cd..c45688bd1ed3 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -945,7 +945,7 @@ namespace { ASTContext &Ctx = CGF.getContext(); unsigned LastFieldSize = LastField->isBitField() - ? LastField->getBitWidthValue() + ? LastField->getBitWidthValue(Ctx) : Ctx.toBits( Ctx.getTypeInfoDataSizeInChars(LastField->getType()).Width); uint64_t MemcpySizeBits = LastFieldOffset + LastFieldSize - |
