[llvm] r228619 - IR: Take uint64_t in DIBuilder::createExpression()
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Feb 9 14:13:27 PST 2015
Author: dexonsmith
Date: Mon Feb 9 16:13:27 2015
New Revision: 228619
URL: http://llvm.org/viewvc/llvm-project?rev=228619&view=rev
Log:
IR: Take uint64_t in DIBuilder::createExpression()
`DIExpression` deals with `uint64_t`, so it doesn't make sense that
`createExpression()` is created from `int64_t`. Switch to `uint64_t` to
unify them.
I've temporarily left in the `int64_t` version, which forwards to the
`uint64_t` version. I'll delete it once I've updated the callers.
Modified:
llvm/trunk/include/llvm/IR/DIBuilder.h
llvm/trunk/lib/IR/DIBuilder.cpp
llvm/trunk/lib/Transforms/Utils/Local.cpp
Modified: llvm/trunk/include/llvm/IR/DIBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=228619&r1=228618&r2=228619&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DIBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/DIBuilder.h Mon Feb 9 16:13:27 2015
@@ -514,7 +514,8 @@ namespace llvm {
/// 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 createExpression(ArrayRef<int64_t> Addr = None);
+ DIExpression createExpression(ArrayRef<uint64_t> Addr = None);
+ DIExpression createExpression(ArrayRef<int64_t> Addr);
/// createPieceExpression - Create a descriptor to describe one part
/// of aggregate variable that is fragmented across multiple Values.
Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=228619&r1=228618&r2=228619&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Mon Feb 9 16:13:27 2015
@@ -947,17 +947,23 @@ DIVariable DIBuilder::createLocalVariabl
return RetVar;
}
-DIExpression DIBuilder::createExpression(ArrayRef<int64_t> Addr) {
+DIExpression DIBuilder::createExpression(ArrayRef<uint64_t> Addr) {
auto Header = HeaderBuilder::get(DW_TAG_expression);
- for (int64_t I : Addr)
+ for (uint64_t I : Addr)
Header.concat(I);
Metadata *Elts[] = {Header.get(VMContext)};
return DIExpression(MDNode::get(VMContext, Elts));
}
+DIExpression DIBuilder::createExpression(ArrayRef<int64_t> Signed) {
+ // TODO: Remove the callers of this signed version and delete.
+ SmallVector<uint64_t, 8> Addr(Signed.begin(), Signed.end());
+ return createExpression(Addr);
+}
+
DIExpression DIBuilder::createPieceExpression(unsigned OffsetInBytes,
unsigned SizeInBytes) {
- int64_t Addr[] = {dwarf::DW_OP_piece, OffsetInBytes, SizeInBytes};
+ uint64_t Addr[] = {dwarf::DW_OP_piece, OffsetInBytes, SizeInBytes};
return createExpression(Addr);
}
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=228619&r1=228618&r2=228619&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Mon Feb 9 16:13:27 2015
@@ -1123,7 +1123,7 @@ bool llvm::replaceDbgDeclareForAlloca(Al
// "deref" operation to a list of address elements, as new llvm.dbg.declare
// will take a value storing address of the memory for variable, not
// alloca itself.
- SmallVector<int64_t, 4> NewDIExpr;
+ SmallVector<uint64_t, 4> NewDIExpr;
NewDIExpr.push_back(dwarf::DW_OP_deref);
if (DIExpr)
for (unsigned i = 0, n = DIExpr.getNumElements(); i < n; ++i)
More information about the llvm-commits
mailing list