DebugInfo: Assume valid pointer in DISubprogram::replaceFunction()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 13 Apr 2015 19:41:30 +0000 (19:41 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 13 Apr 2015 19:41:30 +0000 (19:41 +0000)
Other accessors assume this already; not sure how `replaceFunction()`
got left behind.

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

include/llvm/IR/DebugInfo.h

index f4f6bd3ecde561a48135218c8ae4ade5fd9164ef..69eacc7b8b1a5cd6296265fcc6e3fbdfb76ba674 100644 (file)
@@ -524,10 +524,7 @@ public:
 
   Function *getFunction() const { return get()->getFunction(); }
 
-  void replaceFunction(Function *F) {
-    if (auto *N = get())
-      N->replaceFunction(F);
-  }
+  void replaceFunction(Function *F) { get()->replaceFunction(F); }
   DIArray getTemplateParams() const {
     return DIArray(get()->getTemplateParams());
   }