Revert "DIBuilder: Remove dead code"
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 1 Oct 2014 21:32:12 +0000 (21:32 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 1 Oct 2014 21:32:12 +0000 (21:32 +0000)
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()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218828 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DIBuilder.h
lib/IR/DIBuilder.cpp

index 3e9f43ad8a275df4a64417f498cb1fdc26736b6c..d12a0c609db40b64056225385a89efe9f46f7cb6 100644 (file)
@@ -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.
index 743886946fc5fe1b01dc8f2ad79ce94dca79bb45..950c5d237e465ad1e79fa50968b6c43165e8b09e 100644 (file)
@@ -1056,6 +1056,12 @@ DIExpression DIBuilder::createExpression(ArrayRef<int64_t> Addr) {
   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.