================ @@ -1341,20 +1344,26 @@ void InstrProfiling::createDataVariable(InstrProfCntrInstBase *Inc, } auto *Data = new GlobalVariable(*M, DataTy, false, Linkage, nullptr, DataVarName); - // Reference the counter variable with a label difference (link-time - // constant). - auto *RelativeCounterPtr = - ConstantExpr::getSub(ConstantExpr::getPtrToInt(CounterPtr, IntPtrTy), - ConstantExpr::getPtrToInt(Data, IntPtrTy)); - - // Bitmaps are relative to the same data variable as profile counters. + Constant *RelativeCounterPtr; GlobalVariable *BitmapPtr = PD.RegionBitmaps; Constant *RelativeBitmapPtr = ConstantInt::get(IntPtrTy, 0); - - if (BitmapPtr != nullptr) { - RelativeBitmapPtr = - ConstantExpr::getSub(ConstantExpr::getPtrToInt(BitmapPtr, IntPtrTy), + // By default counter ptr and bitmap ptr are address relative to data section. ---------------- ZequanWu wrote:
Done. https://github.com/llvm/llvm-project/pull/69493 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits