From 2d3adad723653e4acd3d1b3f7fcfd2691acccb73 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 24 Jul 2013 01:21:02 +0000 Subject: [PATCH] Remove unnecessary constructors as the default conversions will handle all enumerated cases. Reformat the rest of the existing constructors to match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187015 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo.h | 21 +++++---------------- lib/IR/DebugInfo.cpp | 18 ------------------ 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index de0eda000d3..689b3ddfd1f 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -89,14 +89,7 @@ namespace llvm { void replaceFunctionField(unsigned Elt, Function *F); public: - explicit DIDescriptor() : DbgNode(0) {} - explicit DIDescriptor(const MDNode *N) : DbgNode(N) {} - explicit DIDescriptor(const DIFile F); - explicit DIDescriptor(const DISubprogram F); - explicit DIDescriptor(const DILexicalBlockFile F); - explicit DIDescriptor(const DILexicalBlock F); - explicit DIDescriptor(const DIVariable F); - explicit DIDescriptor(const DIType F); + explicit DIDescriptor(const MDNode *N = 0) : DbgNode(N) {} bool Verify() const; @@ -165,8 +158,7 @@ namespace llvm { /// DIArray - This descriptor holds an array of descriptors. class DIArray : public DIDescriptor { public: - explicit DIArray(const MDNode *N = 0) - : DIDescriptor(N) {} + explicit DIArray(const MDNode *N = 0) : DIDescriptor(N) {} unsigned getNumElements() const; DIDescriptor getElement(unsigned Idx) const { @@ -289,8 +281,7 @@ namespace llvm { void printInternal(raw_ostream &OS) const; public: - explicit DIDerivedType(const MDNode *N = 0) - : DIType(N) {} + explicit DIDerivedType(const MDNode *N = 0) : DIType(N) {} DIType getTypeDerivedFrom() const { return getFieldAs(9); } @@ -326,8 +317,7 @@ namespace llvm { friend class DIDescriptor; void printInternal(raw_ostream &OS) const; public: - explicit DICompositeType(const MDNode *N = 0) - : DIDerivedType(N) {} + explicit DICompositeType(const MDNode *N = 0) : DIDerivedType(N) {} DIArray getTypeArray() const { return getFieldAs(10); } void setTypeArray(DIArray Elements, DIArray TParams = DIArray()); @@ -570,8 +560,7 @@ namespace llvm { friend class DIDescriptor; void printInternal(raw_ostream &OS) const; public: - explicit DIVariable(const MDNode *N = 0) - : DIDescriptor(N) {} + explicit DIVariable(const MDNode *N = 0) : DIDescriptor(N) {} DIScope getContext() const { return getFieldAs(1); } StringRef getName() const { return getStringField(2); } diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index b99f6d551a0..4b72bf39c03 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -34,24 +34,6 @@ using namespace llvm::dwarf; // DIDescriptor //===----------------------------------------------------------------------===// -DIDescriptor::DIDescriptor(const DIFile F) : DbgNode(F.DbgNode) { -} - -DIDescriptor::DIDescriptor(const DISubprogram F) : DbgNode(F.DbgNode) { -} - -DIDescriptor::DIDescriptor(const DILexicalBlockFile F) : DbgNode(F.DbgNode) { -} - -DIDescriptor::DIDescriptor(const DILexicalBlock F) : DbgNode(F.DbgNode) { -} - -DIDescriptor::DIDescriptor(const DIVariable F) : DbgNode(F.DbgNode) { -} - -DIDescriptor::DIDescriptor(const DIType F) : DbgNode(F.DbgNode) { -} - bool DIDescriptor::Verify() const { return DbgNode && (DIDerivedType(DbgNode).Verify() ||