From 1e6990e4dcc4ce10770774a182af1d4836637df6 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 18 Dec 2014 00:54:39 +0000 Subject: [PATCH] IR: Make DICompositeType mutators private Make `DICompositeType` mutators private to prevent misuse. All calls to `setArrays()` and `setContainingType()` should go through `DIBuilder::replaceArrays()` and `DIBuilder::replaceVTableHolder()`. This is a follow-up to r224482 (now that clang has been updated in r224483). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224486 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfo.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index a17ebbc0d3e..00652a72d83 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -500,6 +500,7 @@ public: // FIXME: Make this derive from DIType directly & just store the // base type in a single DIType field. class DICompositeType : public DIDerivedType { + friend class DIBuilder; friend class DIDescriptor; void printInternal(raw_ostream &OS) const; @@ -513,6 +514,8 @@ public: assert(!isSubroutineType() && "no elements for DISubroutineType"); return getFieldAs(4); } + +private: template void setArrays(DITypedArray Elements, DIArray TParams = DIArray()) { assert((!TParams || DbgNode->getNumOperands() == 8) && @@ -520,13 +523,18 @@ public: "for that!"); setArraysHelper(Elements, TParams); } + +public: unsigned getRunTimeLang() const { return getHeaderFieldAs(7); } DITypeRef getContainingType() const { return getFieldAs(5); } +private: /// \brief Set the containing type. void setContainingType(DICompositeType ContainingType); + +public: DIArray getTemplateParams() const { return getFieldAs(6); } MDString *getIdentifier() const;