From: David Callahan Date: Mon, 14 Jan 2019 19:11:32 +0000 (+0000) Subject: expand DIContext interface a bit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=004aa6132b125f6ef5ef9826eefc34d27675b584;p=llvm expand DIContext interface a bit 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 --- diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index bbdd5e0d9c3..85e96402a24 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -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.