[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

Jeremy Morse via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 29 10:04:05 PST 2024


================
@@ -1664,6 +1710,17 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
                                          emission.getOriginalAllocatedAddress(),
                                          emission.getSizeForLifetimeMarkers());
 
+  // Analogous to lifetime markers, we use a 'cleanup' to emit fake.use
+  // calls for local variables. We are exempting volatile variables and
+  // non-scalars larger than 4 times the size of an unsigned int (32 bytes).
----------------
jmorse wrote:

16 bytes presumably, or 32 bits for unsigned int? Best to avoid being too specific IMO as it's machine dependent. (Perhaps all the world's a VAX, but we can avoid saying it in comments).

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


More information about the cfe-commits mailing list