[PATCH] D17377: [ADT]Fix AddPointer() in FoldingSet

Eugene via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 07:54:22 PST 2016


kevgs added a comment.

&Ptr is an address of a local variable which depends on a previous call stack and doesn't depends on a pointer value, isn't it? I just do not understand why do we need a this. If it has some purpose why passing a value and ignore it? We could just write
void FoldingSetNodeID::AddPointer() {

  const void *Ptr;
  Bits.append(reinterpret_cast<unsigned *>(&Ptr),
              reinterpret_cast<unsigned *>(&Ptr+1));

}


Repository:
  rL LLVM

http://reviews.llvm.org/D17377





More information about the llvm-commits mailing list