aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfoMetadata.cpp
diff options
context:
space:
mode:
authorShubham Sandeep Rastogi <srastogi22@apple.com>2024-05-29 16:19:53 -0700
committerGitHub <noreply@github.com>2024-05-29 16:19:53 -0700
commit69969c725b0987a12a27a8ac787f06be672a4d09 (patch)
tree3e404dff17523239dade4f632f993e77de197b0e /llvm/lib/IR/DebugInfoMetadata.cpp
parentfb607c9019dcfb3bec4c4ab84b67112b52fbe083 (diff)
downloadllvm-69969c725b0987a12a27a8ac787f06be672a4d09.zip
llvm-69969c725b0987a12a27a8ac787f06be672a4d09.tar.gz
llvm-69969c725b0987a12a27a8ac787f06be672a4d09.tar.bz2
Use DIExpression::foldConstantMath() at the result of an append() (#71719)
This patch uses `DIExpression::foldConstantMath()` at the end of a `DIExpression::append()`. Which should help in reducing the size of DIExpressions that grow because of salvaging debug info This is part of a stack of patches and comes after: https://github.com/llvm/llvm-project/pull/69768 https://github.com/llvm/llvm-project/pull/71717 https://github.com/llvm/llvm-project/pull/71718
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r--llvm/lib/IR/DebugInfoMetadata.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 229ee2b..9bd1d78 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -1881,7 +1881,8 @@ DIExpression *DIExpression::append(const DIExpression *Expr,
Op.appendToVector(NewOps);
}
NewOps.append(Ops.begin(), Ops.end());
- auto *result = DIExpression::get(Expr->getContext(), NewOps);
+ auto *result =
+ DIExpression::get(Expr->getContext(), NewOps)->foldConstantMath();
assert(result->isValid() && "concatenated expression is not valid");
return result;
}