================ @@ -5935,3 +5918,29 @@ llvm::DINode::DIFlags CGDebugInfo::getCallSiteRelatedAttrs() const { return llvm::DINode::FlagAllCallsDescribed; } + +llvm::DIExpression * +CGDebugInfo::createConstantValueExpression(const clang::ValueDecl *VD, + const APValue &Val) { + // FIXME: Add a representation for integer constants wider than 64 bits. + if (CGM.getContext().getTypeSize(VD->getType()) > 64) + return nullptr; + + if (Val.isInt()) { + const llvm::APSInt &ValInt = Val.getInt(); + std::optional<uint64_t> ValIntOpt; + if (ValInt.isUnsigned()) + ValIntOpt = ValInt.tryZExtValue(); + else if (auto tmp = ValInt.trySExtValue(); tmp.has_value()) ---------------- dwblaikie wrote:
This is a bit redundant/equivalent to: ``` else if (auto tmp = ValInt.trySExtValue()) ``` https://github.com/llvm/llvm-project/pull/70674 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits