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

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 7 07:43:34 PDT 2017


yaxunl marked 4 inline comments as done.
yaxunl added inline comments.


================
Comment at: lib/CodeGen/CGBlocks.cpp:1144
+                 ? CGM.getNSConcreteGlobalBlock()
+                 : CGM.getNullPointer(CGM.VoidPtrPtrTy,
+                                      QualType(CGM.getContext().VoidPtrTy)));
----------------
rjmccall wrote:
> 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.
You are right, actually they should both be VoidPtrPtrTy to match the type of getNSConcreteGlobalBlock() and getNSConcreteStackBlock().

Fixed.


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


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


https://reviews.llvm.org/D33842





More information about the cfe-commits mailing list