Debug info bug fix, function start wasn't getting generated correctly
for Obj-C methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57769 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 0c45c55..c0260ad 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -119,7 +119,7 @@
     Args.push_back(std::make_pair(IPD, IPD->getType()));
   }
 
-  StartFunction(OMD, OMD->getResultType(), Fn, Args);
+  StartFunction(OMD, OMD->getResultType(), Fn, Args, OMD->getLocEnd());
 }
 
 /// Generate an Objective-C method.  An Objective-C method is a C function with
@@ -127,13 +127,7 @@
 void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
   StartObjCMethod(OMD);
   EmitStmt(OMD->getBody());
-
-  const CompoundStmt *S = dyn_cast<CompoundStmt>(OMD->getBody());
-  if (S) {
-    FinishFunction(S->getRBracLoc());
-  } else {
-    FinishFunction();
-  }
+  FinishFunction(cast<CompoundStmt>(OMD->getBody())->getRBracLoc());
 }
 
 // FIXME: I wasn't sure about the synthesis approach. If we end up