[PATCH] D33842: CodeGen: Fix address space of global variable

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 17:14:43 PDT 2017


rjmccall added a comment.

Looks great, thanks!  Just a few minor changes.



================
Comment at: lib/CodeGen/CGBlocks.cpp:1144
+                 ? CGM.getNSConcreteGlobalBlock()
+                 : CGM.getNullPointer(CGM.VoidPtrPtrTy,
+                                      QualType(CGM.getContext().VoidPtrTy)));
----------------
yaxunl wrote:
> rjmccall wrote:
> > You used VoidPtrTy above.
> They are different fields with different types.
They're both the isa field of a block object.  The difference is just between allocating the block globally and allocating it on the stack.


================
Comment at: lib/CodeGen/TargetInfo.h:237
+  virtual unsigned getGlobalVarAddressSpace(const VarDecl *D,
+                                            CodeGenModule &CGM) const;
+
----------------
The CGM is conventionally the first argument.


================
Comment at: lib/CodeGen/TargetInfo.h:262
+                                               unsigned DestAddr,
+                                               llvm::Type *DestTy) const;
 };
----------------
This should probably take the CGM for completeness.


https://reviews.llvm.org/D33842





More information about the cfe-commits mailing list