[PATCH] Fix addrspace when emitting constructors of static local variables

Eli Bendersky eliben at google.com
Tue Mar 24 06:51:33 PDT 2015


In general this looks good; there are quite a few layers of calls to emit the global var initialization, and I'm not familiar enough to say if this is inserted at the right layer. Hopefully one of the other reviewers will be able to clarify this.


================
Comment at: lib/CodeGen/CGDeclCXX.cpp:143
@@ +142,3 @@
+  // The address space of D may be more generic than the address space of
+  // DeclPtr. In that case, we perform an addrspacecast.
+  unsigned DeclaredAddrSpace = getContext().getTargetAddressSpace(T);
----------------
IMHO this could use a bit more clarification - when can this happen and what does "more generic" mean. Perhaps a small input code example in the comment + showing what VarDecl and DeclPtr end up being in that case?

http://reviews.llvm.org/D8575

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list