[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 28 14:04:10 PDT 2025


================
@@ -405,6 +406,16 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
 
     return createGlobal(module, loc, uniqueName, type, linkage);
   }
+
+  mlir::Value createGetBitfield(mlir::Location loc, mlir::Type resultType,
+                                mlir::Value addr, mlir::Type storageType,
+                                const CIRGenBitFieldInfo &info,
+                                bool isLvalueVolatile, bool useVolatile) {
+    unsigned int offset = useVolatile ? info.volatileOffset : info.offset;
----------------
Andres-Salamanca wrote:

Yes, I agree that’s why I was always calling this function with `useVolatile = false`. I'm going to remove this for now and always use info.offset

https://github.com/llvm/llvm-project/pull/145971


More information about the cfe-commits mailing list