mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-02 05:17:15 +00:00
DIBuilder: Encapsulate DIExpression's element type
`DIExpression`'s elements are 64-bit integers that are stored as `ConstantInt`. The accessors already encapsulate the storage. This commit updates the `DIBuilder` API to also encapsulate that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218797 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1045,10 +1045,14 @@ DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
||||
/// createExpression - Create a new descriptor for the specified
|
||||
/// variable which has a complex address expression for its address.
|
||||
/// @param Addr An array of complex address operations.
|
||||
DIExpression DIBuilder::createExpression(ArrayRef<Value *> Addr) {
|
||||
DIExpression DIBuilder::createExpression(ArrayRef<int64_t> Addr) {
|
||||
SmallVector<llvm::Value *, 16> Elts;
|
||||
Elts.push_back(GetTagConstant(VMContext, DW_TAG_expression));
|
||||
Elts.insert(Elts.end(), Addr.begin(), Addr.end());
|
||||
|
||||
llvm::Type *Int64Ty = Type::getInt64Ty(VMContext);
|
||||
for (int64_t I : Addr)
|
||||
Elts.push_back(ConstantInt::get(Int64Ty, I));
|
||||
|
||||
return DIExpression(MDNode::get(VMContext, Elts));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user