aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorTimm Bäder <tbaeder@redhat.com>2025-01-08 15:09:52 +0100
committerTimm Bäder <tbaeder@redhat.com>2025-01-08 15:09:52 +0100
commit59bdea24b09bca9332a7092b583ebf377efb0d50 (patch)
tree51536c49c6c6b105f74c37bc531c270139a53253 /clang/lib/CodeGen/CGClass.cpp
parent346fad5c2c28d0cd39475ae979ee468a420ebed7 (diff)
downloadllvm-59bdea24b09bca9332a7092b583ebf377efb0d50.zip
llvm-59bdea24b09bca9332a7092b583ebf377efb0d50.tar.gz
llvm-59bdea24b09bca9332a7092b583ebf377efb0d50.tar.bz2
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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 8c19073..c45688b 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 -