]> granicus.if.org Git - clang/commitdiff
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
authorGalina Kistanova <gkistanova@gmail.com>
Sat, 3 Jun 2017 06:31:42 +0000 (06:31 +0000)
committerGalina Kistanova <gkistanova@gmail.com>
Sat, 3 Jun 2017 06:31:42 +0000 (06:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304650 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
lib/AST/ASTDiagnostic.cpp
lib/AST/ASTStructuralEquivalence.cpp
lib/AST/Expr.cpp
lib/AST/ExprConstant.cpp
lib/AST/ItaniumMangle.cpp
lib/AST/NestedNameSpecifier.cpp

index 29d970e66d7122c7da1accbf87b897145ebeafc5..34c4d2617ec9d9cd16785ed1e931f028ecb74a84 100644 (file)
@@ -6240,6 +6240,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
       S += "{objc_class=}";
       return;
     }
+    // TODO: Double check to make sure this intentially falls through.
+    LLVM_FALLTHROUGH;
   }
   
   case Type::ObjCInterface: {
index 03e6115a0dba1391828f016fb8ebbee4dd0df7d2..b43c28deb36201fc11f50f780e024e1f8bd42b1f 100644 (file)
@@ -360,6 +360,7 @@ void clang::FormatASTNodeDiagnosticArgument(
       Modifier = StringRef();
       Argument = StringRef();
       // Fall through
+      LLVM_FALLTHROUGH;
     }
     case DiagnosticsEngine::ak_qualtype: {
       assert(Modifier.empty() && Argument.empty() &&
index 9376ee1d4ee49d9fd93bd9f0bbc36d81366adae4..eff1aa5e323da2ad9ff915b3a2dd7757f8f85675 100644 (file)
@@ -424,6 +424,7 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
       return false;
 
     // Fall through to check the bits common with FunctionNoProtoType.
+    LLVM_FALLTHROUGH;
   }
 
   case Type::FunctionNoProto: {
index d523a0f93cf6b7411b2f9d083b604d7ee3215e8f..c21cd3f65bd40dc1990ac86e60e29ea0a3574860 100644 (file)
@@ -1576,6 +1576,7 @@ bool CastExpr::CastConsistency() const {
            getSubExpr()->getType()->isBlockPointerType());
     assert(getType()->getPointeeType().getAddressSpace() !=
            getSubExpr()->getType()->getPointeeType().getAddressSpace());
+    LLVM_FALLTHROUGH;
   // These should not have an inheritance path.
   case CK_Dynamic:
   case CK_ToUnion:
@@ -2102,6 +2103,7 @@ bool Expr::isUnusedResultAWarning(const Expr *&WarnE, SourceLocation &Loc,
     }
 
     // Fallthrough for generic call handling.
+    LLVM_FALLTHROUGH;
   }
   case CallExprClass:
   case CXXMemberCallExprClass:
index c19812e341c03209eda05090661cc3f7d44c8fe4..17d0ce67dcf9a63b872c9d1fd88ae53b1f025721 100644 (file)
@@ -736,6 +736,7 @@ namespace {
             if (!HasFoldFailureDiagnostic)
               break;
             // We've already failed to fold something. Keep that diagnostic.
+            LLVM_FALLTHROUGH;
           case EM_ConstantExpression:
           case EM_PotentialConstantExpression:
           case EM_ConstantExpressionUnevaluated:
@@ -10374,6 +10375,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) {
     }
 
     // OffsetOf falls through here.
+    LLVM_FALLTHROUGH;
   }
   case Expr::OffsetOfExprClass: {
     // Note that per C99, offsetof must be an ICE. And AFAIK, using
@@ -10476,6 +10478,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) {
       return Worst(LHSResult, RHSResult);
     }
     }
+    LLVM_FALLTHROUGH;
   }
   case Expr::ImplicitCastExprClass:
   case Expr::CStyleCastExprClass:
index ff55608d3b0ed5d42ca5596caa06615e4cf1d8e3..c9bb45a37eb5afe7691c98a61ee2a63216ef248b 100644 (file)
@@ -3785,6 +3785,7 @@ recurse:
     Out << "v1U" << Kind.size() << Kind;
   }
   // Fall through to mangle the cast itself.
+  LLVM_FALLTHROUGH;
       
   case Expr::CStyleCastExprClass:
     mangleCastExpression(E, "cv");
index 514c7c9f5b338505643f1e85e6ab5a6e4fb39903..e2e0dbeec0dd364364c2d0bfd9098e242d85a25f 100644 (file)
@@ -290,6 +290,7 @@ NestedNameSpecifier::print(raw_ostream &OS,
   case TypeSpecWithTemplate:
     OS << "template ";
     // Fall through to print the type.
+    LLVM_FALLTHROUGH;
 
   case TypeSpec: {
     const Type *T = getAsType();