summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDavid Stenberg <david.stenberg@ericsson.com>2019-11-21 09:45:20 +0100
committerDavid Stenberg <david.stenberg@ericsson.com>2019-11-21 10:44:04 +0100
commit3889ff82bf4057ead22dad91a89384ac20ebd557 (patch)
tree82ba977ff050b88828f3722e85fa51a2bc553027 /llvm/lib/IR
parent2cada1e4da9d55b54a06b240cc061605729d50f4 (diff)
downloadbcm5719-llvm-3889ff82bf4057ead22dad91a89384ac20ebd557.tar.gz
bcm5719-llvm-3889ff82bf4057ead22dad91a89384ac20ebd557.zip
[DebugInfo] Refactor DIExpression [SZ]Ext creation into function [NFC]
Summary: Also, replace the SmallVector with a normal C array. Reviewers: vsk Reviewed By: vsk Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70498
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DebugInfoMetadata.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 8ccd8559823..e4036ee1eb0 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -1189,6 +1189,15 @@ bool DIExpression::isConstant() const {
return true;
}
+DIExpression *DIExpression::appendExt(const DIExpression *Expr,
+ unsigned FromSize, unsigned ToSize,
+ bool Signed) {
+ dwarf::TypeKind TK = Signed ? dwarf::DW_ATE_signed : dwarf::DW_ATE_unsigned;
+ uint64_t Ops[] = {dwarf::DW_OP_LLVM_convert, FromSize, TK,
+ dwarf::DW_OP_LLVM_convert, ToSize, TK};
+ return appendToStack(Expr, Ops);
+}
+
DIGlobalVariableExpression *
DIGlobalVariableExpression::getImpl(LLVMContext &Context, Metadata *Variable,
Metadata *Expression, StorageType Storage,
OpenPOWER on IntegriCloud