This revision was automatically updated to reflect the committed changes.
Closed by commit rL289252: Add support for non-zero null pointer for C and
OpenCL (authored by yaxunl).
Changed prior to commit:
https://reviews.llvm.org/D26196?vs=80902&id=80919#toc
Repository:
rL LLVM
https://review
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
Okay. With that resolved, this LGTM.
https://reviews.llvm.org/D26196
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.ll
yaxunl updated this revision to Diff 80902.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised by John's comments.
Dropped constant folding of ptrtoint of non-zero null pointer.
https://reviews.llvm.org/D26196
Files:
include/clang/AST/APValue.h
include/clang/AST/ASTCo
yaxunl marked an inline comment as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:1532
+ return llvm::ConstantInt::get(ConvertType(DestTy),
+ CGF.getContext().getTargetNullPtrValue(E->getType()));
assert(!DestTy->isBooleanType() &&
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:1532
+ return llvm::ConstantInt::get(ConvertType(DestTy),
+ CGF.getContext().getTargetNullPtrValue(E->getType()));
assert(!DestTy->isBooleanType() && "bool should use PointerToBool");
yaxunl updated the summary for this revision.
yaxunl updated this revision to Diff 80804.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised by John's comments.
Added source QualType parameter to performAddrSpaceCast.
Changed linkage of tentative definition of global var wit
yaxunl marked 3 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:1532
+ return llvm::ConstantInt::get(ConvertType(DestTy),
+ CGF.getContext().getTargetNullPtrValue(E->getType()));
assert(!DestTy->isBooleanType() &&
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:1532
+ return llvm::ConstantInt::get(ConvertType(DestTy),
+ CGF.getContext().getTargetNullPtrValue(E->getType()));
assert(!DestTy->isBooleanType() && "bool should use PointerToBool");
yaxunl updated the summary for this revision.
yaxunl updated this revision to Diff 80600.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised by John's comments.
Fixed typos.
Changed parameter of performAddrSpaceCast.
Fixed constant folding of ptrtoint with side effect and ad
yaxunl marked 4 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:1532
+ return llvm::ConstantInt::get(ConvertType(DestTy),
+ CGF.getContext().getTargetNullPtrValue(E->getType()));
assert(!DestTy->isBooleanType() &&
rjmccall added inline comments.
Comment at: include/clang/AST/APValue.h:379
void setLValue(LValueBase B, const CharUnits &O, NoLValuePath,
- unsigned CallIndex);
+ unsigned CallIndex, bool IsNuppPtr);
void setLValue(LValueBase B, const CharUn
yaxunl updated this revision to Diff 80488.
yaxunl added a comment.
Fix some missed function name and remove accidentally added #if 0.
https://reviews.llvm.org/D26196
Files:
include/clang/AST/APValue.h
include/clang/AST/ASTContext.h
include/clang/Basic/TargetInfo.h
lib/AST/APValue.cpp
yaxunl updated this revision to Diff 80485.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised by John's comments.
Changed Ptr in function names to Pointer.
Added TargetCodeGenInfo::performAddrSpaceCast.
Fixed folding addrspacecast of null pointer with side effect and added
yaxunl marked 7 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:1532
+ return llvm::ConstantInt::get(ConvertType(DestTy),
+ CGF.getContext().getTargetNullPtrValue(E->getType()));
assert(!DestTy->isBooleanType() &&
rjmccall added inline comments.
Comment at: include/clang/Basic/TargetInfo.h:306
+ /// \param AddrSpace address space of pointee in source language.
+ virtual uint64_t getNullPtrValue(unsigned AddrSpace) const {
+return 0;
We normally spell out "Pointer", I
yaxunl added a comment.
ping
https://reviews.llvm.org/D26196
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yaxunl updated the summary for this revision.
yaxunl updated this revision to Diff 79406.
yaxunl added a comment.
Revised by John's comments.
Emit null pointer in target-specific representation in folded constant
expressions.
Fix casting null pointer to integer in constant expressions.
https:/
rjmccall added a comment.
In https://reviews.llvm.org/D26196#602660, @yaxunl wrote:
> > But if you do need to support these conversions for some reason, the
> > correct behavior is to ensure that null is mapped to null.
>
> I only need to do this for constant folding, right? I found that the cur
yaxunl marked 3 inline comments as done.
yaxunl added a comment.
> But if you do need to support these conversions for some reason, the correct
> behavior is to ensure that null is mapped to null.
I only need to do this for constant folding, right? I found that the current
implementation is alr
rjmccall added a comment.
In https://reviews.llvm.org/D26196#593741, @yaxunl wrote:
> >> It seems the casting from a pointer to different address space is not
> >> affected by this change. When a null pointer is casted to different
> >> address space, it is casted the same way as an ordinary po
yaxunl added a comment.
>> It seems the casting from a pointer to different address space is not
>> affected by this change. When a null pointer is casted to different address
>> space, it is casted the same way as an ordinary pointer, e.g. by
>> addrspacecast.
>
> You mean, the code-generatio
yaxunl added a comment.
>> It seems the casting from a pointer to different address space is not
>> affected by this change. When a null pointer is casted to different address
>> space, it is casted the same way as an ordinary pointer, e.g. by
>> addrspacecast.
>
> You mean, the code-generatio
rjmccall added a comment.
In https://reviews.llvm.org/D26196#592823, @yaxunl wrote:
> Hi John,
>
> It seems the casting from a pointer to different address space is not
> affected by this change. When a null pointer is casted to different address
> space, it is casted the same way as an ordinar
yaxunl added a comment.
Hi John,
It seems the casting from a pointer to different address space is not affected
by this change. When a null pointer is casted to different address space, it is
casted the same way as an ordinary pointer, e.g. by addrspacecast.
I think this patch covers most of t
24 matches
Mail list logo