[llvm] r218828 - Revert "DIBuilder: Remove dead code"
Duncan P. N. Exon Smith
dexonsmith at apple.com
Wed Oct 1 14:32:12 PDT 2014
Author: dexonsmith
Date: Wed Oct 1 16:32:12 2014
New Revision: 218828
URL: http://llvm.org/viewvc/llvm-project?rev=218828&view=rev
Log:
Revert "DIBuilder: Remove dead code"
This reverts commit r218820. It turns out that Adrian has an
outstanding SROA patch that uses this.
I've updated it to forward to `createExpression()`.
Modified:
llvm/trunk/include/llvm/IR/DIBuilder.h
llvm/trunk/lib/IR/DIBuilder.cpp
Modified: llvm/trunk/include/llvm/IR/DIBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=218828&r1=218827&r2=218828&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DIBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/DIBuilder.h Wed Oct 1 16:32:12 2014
@@ -505,6 +505,14 @@ namespace llvm {
/// @param Addr An array of complex address operations.
DIExpression createExpression(ArrayRef<int64_t> Addr = None);
+ /// createPieceExpression - Create a descriptor to describe one part
+ /// of aggregate variable that is fragmented across multiple Values.
+ ///
+ /// @param OffsetInBytes Offset of the piece in bytes.
+ /// @param SizeInBytes Size of the piece in bytes.
+ DIExpression createPieceExpression(unsigned OffsetInBytes,
+ unsigned SizeInBytes);
+
/// createFunction - Create a new descriptor for the specified subprogram.
/// See comments in DISubprogram for descriptions of these fields.
/// @param Scope Function scope.
Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=218828&r1=218827&r2=218828&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Wed Oct 1 16:32:12 2014
@@ -1056,6 +1056,12 @@ DIExpression DIBuilder::createExpression
return DIExpression(MDNode::get(VMContext, Elts));
}
+DIExpression DIBuilder::createPieceExpression(unsigned OffsetInBytes,
+ unsigned SizeInBytes) {
+ int64_t Addr[] = {dwarf::DW_OP_piece, OffsetInBytes, SizeInBytes};
+ return createExpression(Addr);
+}
+
/// createFunction - Create a new descriptor for the specified function.
/// FIXME: this is added for dragonegg. Once we update dragonegg
/// to call resolve function, this will be removed.
More information about the llvm-commits
mailing list