[clang] 5c943e3 - [libclang] Remove redundant return statements in CXType.cpp

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 22:29:56 PST 2023


Author: Emilio Cobos Alvarez
Date: 2023-03-01T07:29:11+01:00
New Revision: 5c943e36881815807e0f52743eabe785bf24e2db

URL: https://github.com/llvm/llvm-project/commit/5c943e36881815807e0f52743eabe785bf24e2db
DIFF: https://github.com/llvm/llvm-project/commit/5c943e36881815807e0f52743eabe785bf24e2db.diff

LOG: [libclang] Remove redundant return statements in CXType.cpp

Let the branch fall through the error path like other functions here do.

Differential Revision: https://reviews.llvm.org/D140074

Added: 
    

Modified: 
    clang/tools/libclang/CXType.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/libclang/CXType.cpp b/clang/tools/libclang/CXType.cpp
index a833da374be02..a1d157c63995b 100644
--- a/clang/tools/libclang/CXType.cpp
+++ b/clang/tools/libclang/CXType.cpp
@@ -322,8 +322,6 @@ CXType clang_getTypedefDeclUnderlyingType(CXCursor C) {
       QualType T = TD->getUnderlyingType();
       return MakeCXType(T, TU);
     }
-
-    return MakeCXType(QualType(), TU);
   }
 
   return MakeCXType(QualType(), TU);
@@ -340,8 +338,6 @@ CXType clang_getEnumDeclIntegerType(CXCursor C) {
       QualType T = TD->getIntegerType();
       return MakeCXType(T, TU);
     }
-
-    return MakeCXType(QualType(), TU);
   }
 
   return MakeCXType(QualType(), TU);
@@ -356,8 +352,6 @@ long long clang_getEnumConstantDeclValue(CXCursor C) {
     if (const EnumConstantDecl *TD = dyn_cast_or_null<EnumConstantDecl>(D)) {
       return TD->getInitVal().getSExtValue();
     }
-
-    return LLONG_MIN;
   }
 
   return LLONG_MIN;
@@ -372,8 +366,6 @@ unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C) {
     if (const EnumConstantDecl *TD = dyn_cast_or_null<EnumConstantDecl>(D)) {
       return TD->getInitVal().getZExtValue();
     }
-
-    return ULLONG_MAX;
   }
 
   return ULLONG_MAX;


        


More information about the cfe-commits mailing list