]> granicus.if.org Git - llvm/commitdiff
expand DIContext interface a bit
authorDavid Callahan <dcallahan@fb.com>
Mon, 14 Jan 2019 19:11:32 +0000 (19:11 +0000)
committerDavid Callahan <dcallahan@fb.com>
Mon, 14 Jan 2019 19:11:32 +0000 (19:11 +0000)
Summary:
This allows a bit more control for scenarios where client might
modifiy a DIContext

Reviewers: twoh, Kader, modocache

Reviewed By: Kader

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D56505

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

include/llvm/DebugInfo/DIContext.h

index bbdd5e0d9c3fb7bef06108acfc611a06217c8799..85e96402a246c89306fd0334a5dea9134250e9f0 100644 (file)
@@ -81,7 +81,7 @@ class DIInliningInfo {
 public:
   DIInliningInfo() = default;
 
-  DILineInfo getFrame(unsigned Index) const {
+  const DILineInfo & getFrame(unsigned Index) const {
     assert(Index < Frames.size());
     return Frames[Index];
   }
@@ -98,6 +98,11 @@ public:
   void addFrame(const DILineInfo &Frame) {
     Frames.push_back(Frame);
   }
+  
+  void resize(unsigned i) {
+    Frames.resize(i);
+  }
+  
 };
 
 /// Container for description of a global variable.