================
@@ -1774,6 +1774,18 @@ llvm::Constant 
*ConstantEmitter::emitForMemory(CodeGenModule &CGM,
     return Res;
   }
 
+  if (const auto *BIT = destType->getAs<BitIntType>()) {
+    if (BIT->getNumBits() > 128) {
+      // Long _BitInt has array of bytes as in-memory type.
+      ConstantAggregateBuilder Builder(CGM);
+      llvm::Type *DesiredTy = CGM.getTypes().ConvertTypeForMem(destType);
+      auto *CI = cast<llvm::ConstantInt>(C);
----------------
rjmccall wrote:

The test case here is just going to be something like `_SomeSplitBitIntType x = 
(unsigned long) &someVariable;`.  What code do we actually produce for this?  
Sometimes we'll be able to fall back on dynamic initialization, but that's not 
always an option.

Ideally, it's just invalid to do something like that.  It certainly needs to be 
diagnosed if the integer type is narrower than the pointer, and wider is also 
problematic, although less so and in a different way.

https://github.com/llvm/llvm-project/pull/91364
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to