From 519fc96c475680de2cc49e7811dbbfadb912cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:09 +0000 Subject: Vendor import of stripped clang trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/cfe/trunk@375505 --- lib/Tooling/Refactoring/Extract/SourceExtraction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/Tooling/Refactoring/Extract/SourceExtraction.cpp') diff --git a/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp b/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp index 533c373e35c45..5d57ecf90a96d 100644 --- a/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp +++ b/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "SourceExtraction.h" +#include "clang/Tooling/Refactoring/Extract/SourceExtraction.h" #include "clang/AST/Stmt.h" #include "clang/AST/StmtCXX.h" #include "clang/AST/StmtObjC.h" @@ -40,8 +40,12 @@ bool isSemicolonRequiredAfter(const Stmt *S) { return isSemicolonRequiredAfter(CXXFor->getBody()); if (const auto *ObjCFor = dyn_cast(S)) return isSemicolonRequiredAfter(ObjCFor->getBody()); + if(const auto *Switch = dyn_cast(S)) + return isSemicolonRequiredAfter(Switch->getBody()); + if(const auto *Case = dyn_cast(S)) + return isSemicolonRequiredAfter(Case->getSubStmt()); switch (S->getStmtClass()) { - case Stmt::SwitchStmtClass: + case Stmt::DeclStmtClass: case Stmt::CXXTryStmtClass: case Stmt::ObjCAtSynchronizedStmtClass: case Stmt::ObjCAutoreleasePoolStmtClass: -- cgit v1.2.3