Removed duplicate logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171218 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h
index cf960bf..d302db4 100644
--- a/include/clang/AST/DeclarationName.h
+++ b/include/clang/AST/DeclarationName.h
@@ -521,9 +521,7 @@
   SourceLocation getEndLoc() const;
   /// getSourceRange - The range of the declaration name.
   SourceRange getSourceRange() const LLVM_READONLY {
-    SourceLocation BeginLoc = getBeginLoc();
-    SourceLocation EndLoc = getEndLoc();
-    return SourceRange(BeginLoc, EndLoc.isValid() ? EndLoc : BeginLoc);
+    return SourceRange(getLocStart(), getLocEnd());
   }
   SourceLocation getLocStart() const LLVM_READONLY {
     return getBeginLoc();