Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cvise for openSUSE:Factory checked in at 2022-12-17 20:36:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cvise (Old) and /work/SRC/openSUSE:Factory/.cvise.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cvise" Sat Dec 17 20:36:38 2022 rev:65 rq:1043436 version:2.6.0+git.20221217.f1b5a08 Changes: -------- --- /work/SRC/openSUSE:Factory/cvise/cvise.changes 2022-12-16 17:51:44.292046225 +0100 +++ /work/SRC/openSUSE:Factory/.cvise.new.1835/cvise.changes 2022-12-17 20:36:56.172733863 +0100 @@ -1,0 +2,8 @@ +Sat Dec 17 08:53:45 UTC 2022 - mli...@suse.cz + +- Update to version 2.6.0+git.20221217.f1b5a08: + * Fixed infinite loop problem with move-definition-to-declaration transformation + * move-definition-to-declaration transformation learned to move struct, class, union and variable definitions + * Renamed transformation move-function-body to move-definition-to-declaration + +------------------------------------------------------------------- Old: ---- cvise-2.6.0+git.20221216.1423ed5.tar.xz New: ---- cvise-2.6.0+git.20221217.f1b5a08.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cvise.spec ++++++ --- /var/tmp/diff_new_pack.66g5KL/_old 2022-12-17 20:36:57.420740719 +0100 +++ /var/tmp/diff_new_pack.66g5KL/_new 2022-12-17 20:36:57.424740741 +0100 @@ -17,7 +17,7 @@ Name: cvise -Version: 2.6.0+git.20221216.1423ed5 +Version: 2.6.0+git.20221217.f1b5a08 Release: 0 Summary: Super-parallel Python port of the C-Reduce License: BSD-3-Clause ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.66g5KL/_old 2022-12-17 20:36:57.480741049 +0100 +++ /var/tmp/diff_new_pack.66g5KL/_new 2022-12-17 20:36:57.484741071 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/marxin/cvise</param> - <param name="changesrevision">1423ed528af9bcef03169c09c3a5077cf65867b4</param></service></servicedata> + <param name="changesrevision">f1b5a08dbdbf04b8cb78a5cdaa23d847886ede09</param></service></servicedata> (No newline at EOF) ++++++ cvise-2.6.0+git.20221216.1423ed5.tar.xz -> cvise-2.6.0+git.20221217.f1b5a08.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/CMakeLists.txt new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/CMakeLists.txt --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/CMakeLists.txt 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/CMakeLists.txt 2022-12-17 09:53:20.000000000 +0100 @@ -132,16 +132,23 @@ "/tests/remove-base-class/test3.output" "/tests/remove-base-class/test4.cc" "/tests/remove-base-class/test4.output" - "/tests/move-function-body/test1.cc" - "/tests/move-function-body/test1.output" - "/tests/move-function-body/test2.cc" - "/tests/move-function-body/test2.output" - "/tests/move-function-body/test3.cc" - "/tests/move-function-body/test3.output" - "/tests/move-function-body/test4.cc" - "/tests/move-function-body/test4.output" - "/tests/move-function-body/test5.cc" - "/tests/move-function-body/test5.output" + "/tests/move-definition-to-declaration/func1.cc" + "/tests/move-definition-to-declaration/func1.output" + "/tests/move-definition-to-declaration/func2.cc" + "/tests/move-definition-to-declaration/func2.output" + "/tests/move-definition-to-declaration/func3.cc" + "/tests/move-definition-to-declaration/func3.output" + "/tests/move-definition-to-declaration/func4.cc" + "/tests/move-definition-to-declaration/func4.output" + "/tests/move-definition-to-declaration/func5.cc" + "/tests/move-definition-to-declaration/func5.output" + "/tests/move-definition-to-declaration/func6.cc" + "/tests/move-definition-to-declaration/struct1.cc" + "/tests/move-definition-to-declaration/struct1.output" + "/tests/move-definition-to-declaration/struct2.cc" + "/tests/move-definition-to-declaration/struct2.output" + "/tests/move-definition-to-declaration/var1.cc" + "/tests/move-definition-to-declaration/var1.output" "/tests/remove-namespace/macro.cpp" "/tests/remove-namespace/macro.output" "/tests/remove-namespace/macro.output2" @@ -517,8 +524,8 @@ LiftAssignmentExpr.h LocalToGlobal.cpp LocalToGlobal.h - MoveFunctionBody.cpp - MoveFunctionBody.h + MoveDefinitionToDeclaration.cpp + MoveDefinitionToDeclaration.h MoveGlobalVar.cpp MoveGlobalVar.h ParamToGlobal.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveDefinitionToDeclaration.cpp new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveDefinitionToDeclaration.cpp --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveDefinitionToDeclaration.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveDefinitionToDeclaration.cpp 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,180 @@ +//===----------------------------------------------------------------------===// +// +// Copyright (c) 2012, 2015 The University of Utah +// All rights reserved. +// +// This file is distributed under the University of Illinois Open Source +// License. See the file COPYING for details. +// +//===----------------------------------------------------------------------===// + +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#include "MoveDefinitionToDeclaration.h" + +#include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/ASTContext.h" +#include "clang/Basic/SourceManager.h" + +#include "TransformationManager.h" + +using namespace clang; + +static const char *DescriptionMsg = +"Move definitions towards its declaration. \ +Supporting functions, methods, variables, structs, unions and classes. \ +Note that this pass could generate uncompilable code. \n"; + +static RegisterTransformation<MoveDefinitionToDeclaration> + Trans("move-definition-to-declaration", DescriptionMsg); + +class MoveDefinitionToDeclaration::CollectionVisitor : public RecursiveASTVisitor<CollectionVisitor> { + MoveDefinitionToDeclaration* ConsumerInstance; + +public: + explicit CollectionVisitor(MoveDefinitionToDeclaration* Instance) : ConsumerInstance(Instance) + { } + + void CheckAndAddCondidate(Decl* Def) { + auto* Decl = Def->getPreviousDecl(); + if (Decl == nullptr || Def == Decl) + return; + + auto DefRange = ConsumerInstance->RewriteHelper->getDeclFullSourceRange(Def); + auto DeclRange = ConsumerInstance->RewriteHelper->getDeclFullSourceRange(Decl); + if (DefRange.isInvalid() || DeclRange.isInvalid() || ConsumerInstance->isInIncludedFile(DefRange) || ConsumerInstance->isInIncludedFile(DeclRange)) + return; + + auto Text = ConsumerInstance->TheRewriter.getRewrittenText({ DeclRange.getEnd(), DefRange.getBegin().getLocWithOffset(-1) }); + if (std::all_of(Text.begin(), Text.end(), isspace)) + return; + + ConsumerInstance->DefCandidates.push_back(Def); + } + + bool VisitFunctionDecl(FunctionDecl* FD) { + if (FD->isThisDeclarationADefinition()) + CheckAndAddCondidate(FD); + + return true; + } + + bool VisitVarDecl(VarDecl* VD) { + if (VD->isThisDeclarationADefinition()) + CheckAndAddCondidate(VD); + + return true; + } + + bool VisitTagDecl(TagDecl* VD) { + if (VD->isThisDeclarationADefinition()) + CheckAndAddCondidate(VD); + + return true; + } + +private: +}; + +void MoveDefinitionToDeclaration::HandleTranslationUnit(ASTContext &Ctx) +{ + CollectionVisitor(this).TraverseDecl(Ctx.getTranslationUnitDecl()); + + ValidInstanceNum = DefCandidates.size(); + + if (QueryInstanceOnly) + return; + + if (TransformationCounter > ValidInstanceNum) { + TransError = TransMaxInstanceError; + return; + } + + TheDef = DefCandidates[TransformationCounter-1]; + TheDecl = TheDef->getPreviousDecl(); + + Ctx.getDiagnostics().setSuppressAllDiagnostics(false); + + TransAssert(TheDecl && "NULL TheDecl!"); + TransAssert(TheDef && "NULL TheDef!"); + + doRewriting(); + + if (Ctx.getDiagnostics().hasErrorOccurred() || + Ctx.getDiagnostics().hasFatalErrorOccurred()) + TransError = TransInternalError; +} + +// Decl::getDescribedTemplateParams was introduced in LLVM 11. +// Copied here for backwards compatibility. +static const TemplateParameterList* getDescribedTemplateParams(Decl* D) { + if (auto* TD = D->getDescribedTemplate()) + return TD->getTemplateParameters(); + if (auto* CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(D)) + return CTPSD->getTemplateParameters(); + if (auto* VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl>(D)) + return VTPSD->getTemplateParameters(); + return nullptr; +} + +void MoveDefinitionToDeclaration::doRewriting(void) +{ + SourceRange DefRange = RewriteHelper->getDeclFullSourceRange(TheDef); + + // Remove namespace and class qualifiers + if (auto* DD = dyn_cast<DeclaratorDecl>(TheDef)) { + if (auto QL = DD->getQualifierLoc()) { + TheRewriter.RemoveText(QL.getSourceRange()); + } + } + + if (auto* MethDecl = dyn_cast<CXXMethodDecl>(TheDecl)) { + auto* MethDef = cast<CXXMethodDecl>(TheDef); + + // Update the template parameters name of the class if they are empty + // This is very likely since unused parameter names gets removed during reduction + if (MethDef->getNumTemplateParameterLists() == 1) { + TemplateParameterList* TPL = MethDef->getTemplateParameterList(0); + + if (const TemplateParameterList* ClassTPL = getDescribedTemplateParams(MethDecl->getParent())) { + assert(TPL->size() == ClassTPL->size()); + for (unsigned i2 = 0; i2 < ClassTPL->size(); ++i2) { + auto* Param = TPL->getParam(i2); + auto* ClassParam = ClassTPL->getParam(i2); + + if (ClassParam->getName().empty()) { + std::string ParamStr = TheRewriter.getRewrittenText(Param->getSourceRange()); + TheRewriter.ReplaceText(ClassParam->getSourceRange().getEnd(), ParamStr); + } + } + } + + TheRewriter.RemoveText(TPL->getSourceRange()); + } + + // Removing template lists for classes + for (unsigned i = 0; i < MethDef->getNumTemplateParameterLists(); ++i) { + TemplateParameterList* TPL = MethDef->getTemplateParameterList(i); + TheRewriter.RemoveText(TPL->getSourceRange()); + } + } + + std::string FuncDefStr = TheRewriter.getRewrittenText(DefRange); + + TheRewriter.RemoveText(DefRange); + + // Inside a class we need to remove the declaration + if (isa<CXXMethodDecl>(TheDecl)) { + auto DeclRange = RewriteHelper->getDeclFullSourceRange(TheDecl); + TheRewriter.ReplaceText(DeclRange, FuncDefStr); + } else { + RewriteHelper->addStringAfterDecl(TheDecl, FuncDefStr); + } +} + +MoveDefinitionToDeclaration::~MoveDefinitionToDeclaration(void) +{ + // Nothing to do +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveDefinitionToDeclaration.h new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveDefinitionToDeclaration.h --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveDefinitionToDeclaration.h 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveDefinitionToDeclaration.h 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// Copyright (c) 2012 The University of Utah +// All rights reserved. +// +// This file is distributed under the University of Illinois Open Source +// License. See the file COPYING for details. +// +//===----------------------------------------------------------------------===// + +#ifndef MOVE_DEFINITION_TO_DECLARATION_H +#define MOVE_DEFINITION_TO_DECLARATION_H + +#include <string> +#include "llvm/ADT/DenseMap.h" +#include "Transformation.h" + +class MoveDefinitionToDeclaration : public Transformation { + class CollectionVisitor; + + +public: + + MoveDefinitionToDeclaration(const char *TransName, const char *Desc) + : Transformation(TransName, Desc) + { } + + ~MoveDefinitionToDeclaration(void); + +private: + + virtual void HandleTranslationUnit(clang::ASTContext &Ctx); + + void doRewriting(void); + + std::vector<clang::Decl*> DefCandidates; + + clang::Decl* TheDecl = nullptr; + + clang::Decl* TheDef = nullptr; +}; +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveFunctionBody.cpp new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveFunctionBody.cpp --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveFunctionBody.cpp 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveFunctionBody.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,156 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Copyright (c) 2012, 2015 The University of Utah -// All rights reserved. -// -// This file is distributed under the University of Illinois Open Source -// License. See the file COPYING for details. -// -//===----------------------------------------------------------------------===// - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "MoveFunctionBody.h" - -#include "clang/AST/RecursiveASTVisitor.h" -#include "clang/AST/ASTContext.h" -#include "clang/Basic/SourceManager.h" - -#include "TransformationManager.h" - -using namespace clang; - -static const char *DescriptionMsg = -"Move function body towards its declaration. \ -Note that this pass would generate uncompilable code. \n"; - -static RegisterTransformation<MoveFunctionBody> - Trans("move-function-body", DescriptionMsg); - -class MoveFunctionBody::CollectionVisitor : public RecursiveASTVisitor<CollectionVisitor> { - MoveFunctionBody* ConsumerInstance; - -public: - explicit CollectionVisitor(MoveFunctionBody* Instance) : ConsumerInstance(Instance) - { } - - bool VisitFunctionDecl(FunctionDecl* FuncDef) { - if (!FuncDef->isThisDeclarationADefinition()) - return true; - - auto* FuncDecl = FuncDef->getFirstDecl(); - if (FuncDef == FuncDecl) - return true; - if (ConsumerInstance->isInIncludedFile(FuncDef) || ConsumerInstance->isInIncludedFile(FuncDecl)) - return true; - - ConsumerInstance->FunctionCandidates.push_back(FuncDef); - - return true; - } - -private: -}; - -void MoveFunctionBody::HandleTranslationUnit(ASTContext &Ctx) -{ - CollectionVisitor(this).TraverseDecl(Ctx.getTranslationUnitDecl()); - - ValidInstanceNum = FunctionCandidates.size(); - - if (QueryInstanceOnly) - return; - - if (TransformationCounter > ValidInstanceNum) { - TransError = TransMaxInstanceError; - return; - } - - TheFunctionDef = FunctionCandidates[TransformationCounter-1]; - TheFunctionDecl = TheFunctionDef->getFirstDecl(); - - Ctx.getDiagnostics().setSuppressAllDiagnostics(false); - - TransAssert(TheFunctionDecl && "NULL TheFunctionDecl!"); - TransAssert(!TheFunctionDecl->isThisDeclarationADefinition() && - "Invalid Function Declaration!"); - TransAssert(TheFunctionDef && "NULL TheFunctionDef!"); - TransAssert(TheFunctionDef->isThisDeclarationADefinition() && - "Invalid Function Definition!"); - - doRewriting(); - - if (Ctx.getDiagnostics().hasErrorOccurred() || - Ctx.getDiagnostics().hasFatalErrorOccurred()) - TransError = TransInternalError; -} - -// Decl::getDescribedTemplateParams was introduced in LLVM 11. -// Copied here for backwards compatibility. -static const TemplateParameterList* getDescribedTemplateParams(Decl* D) { - if (auto* TD = D->getDescribedTemplate()) - return TD->getTemplateParameters(); - if (auto* CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(D)) - return CTPSD->getTemplateParameters(); - if (auto* VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl>(D)) - return VTPSD->getTemplateParameters(); - return nullptr; -} - -void MoveFunctionBody::doRewriting(void) -{ - SourceRange DefRange = RewriteHelper->getDeclFullSourceRange(TheFunctionDef); - - // Remove namespace and class qualifiers - if (auto QL = TheFunctionDef->getQualifierLoc()) { - TheRewriter.RemoveText(QL.getSourceRange()); - } - - if (auto* MD = dyn_cast<CXXMethodDecl>(TheFunctionDecl)) { - // Update the template parameters name of the class if they are empty - // This is very likely since unused parameter names gets removed during reduction - if (TheFunctionDef->getNumTemplateParameterLists() == 1) { - TemplateParameterList* TPL = TheFunctionDef->getTemplateParameterList(0); - - if (const TemplateParameterList* ClassTPL = getDescribedTemplateParams(MD->getParent())) { - assert(TPL->size() == ClassTPL->size()); - for (unsigned i2 = 0; i2 < ClassTPL->size(); ++i2) { - auto* Param = TPL->getParam(i2); - auto* ClassParam = ClassTPL->getParam(i2); - - if (ClassParam->getName().empty()) { - std::string ParamStr = TheRewriter.getRewrittenText(Param->getSourceRange()); - TheRewriter.ReplaceText(ClassParam->getSourceRange().getEnd(), ParamStr); - } - } - } - - TheRewriter.RemoveText(TPL->getSourceRange()); - } - - // Removing template lists for classes - for (unsigned i = 0; i < TheFunctionDef->getNumTemplateParameterLists(); ++i) { - TemplateParameterList* TPL = TheFunctionDef->getTemplateParameterList(i); - TheRewriter.RemoveText(TPL->getSourceRange()); - } - } - - std::string FuncDefStr = TheRewriter.getRewrittenText(DefRange); - - TheRewriter.RemoveText(DefRange); - - // Inside a class we need to remove the declaration - if (isa<CXXMethodDecl>(TheFunctionDecl)) { - auto DeclRange = RewriteHelper->getDeclFullSourceRange(TheFunctionDecl); - TheRewriter.ReplaceText(DeclRange, FuncDefStr); - } else { - RewriteHelper->addStringAfterFuncDecl(TheFunctionDecl, FuncDefStr); - } -} - -MoveFunctionBody::~MoveFunctionBody(void) -{ - // Nothing to do -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveFunctionBody.h new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveFunctionBody.h --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/MoveFunctionBody.h 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/MoveFunctionBody.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Copyright (c) 2012 The University of Utah -// All rights reserved. -// -// This file is distributed under the University of Illinois Open Source -// License. See the file COPYING for details. -// -//===----------------------------------------------------------------------===// - -#ifndef MOVE_FUNCTION_BODY_H -#define MOVE_FUNCTION_BODY_H - -#include <string> -#include "llvm/ADT/DenseMap.h" -#include "Transformation.h" - -namespace clang { - class DeclGroupRef; - class ASTContext; - class FunctionDecl; -} - -class MoveFunctionBody : public Transformation { - class CollectionVisitor; - - -public: - - MoveFunctionBody(const char *TransName, const char *Desc) - : Transformation(TransName, Desc) - { } - - ~MoveFunctionBody(void); - -private: - - typedef llvm::DenseMap<clang::FunctionDecl *, clang::FunctionDecl *> - FuncDeclToFuncDeclMap; - - virtual void HandleTranslationUnit(clang::ASTContext &Ctx); - - void doRewriting(void); - - std::vector<clang::FunctionDecl*> FunctionCandidates; - - clang::FunctionDecl *TheFunctionDecl = nullptr; - - clang::FunctionDecl *TheFunctionDef = nullptr; -}; -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/RewriteUtils.cpp new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/RewriteUtils.cpp --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/RewriteUtils.cpp 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/RewriteUtils.cpp 2022-12-17 09:53:20.000000000 +0100 @@ -966,13 +966,11 @@ return !(TheRewriter->InsertText(LocEnd, "\n" + Str)); } -bool RewriteUtils::addStringAfterFuncDecl(const FunctionDecl *FD, - const std::string &Str) +bool RewriteUtils::addStringAfterDecl(const Decl *D, const std::string &Str) { - SourceRange FDRange = FD->getSourceRange(); - SourceLocation LocEnd = getEndLocationAfter(FDRange, ';'); + SourceRange Range = getDeclFullSourceRange(D); - return !(TheRewriter->InsertText(LocEnd, "\n" + Str)); + return !(TheRewriter->InsertText(Range.getEnd(), "\n" + Str)); } // This function is an experimental one. It doesn't work diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/RewriteUtils.h new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/RewriteUtils.h --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/RewriteUtils.h 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/RewriteUtils.h 2022-12-17 09:53:20.000000000 +0100 @@ -116,8 +116,8 @@ bool addStringAfterVarDecl(const clang::VarDecl *VD, const std::string &Str); - bool addStringAfterFuncDecl(const clang::FunctionDecl *FD, - const std::string &Str); + bool addStringAfterDecl(const clang::Decl *D, + const std::string &Str); bool replaceVarDeclName(clang::VarDecl *VD, const std::string &NameStr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/Transformation.h new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/Transformation.h --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/Transformation.h 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/Transformation.h 2022-12-17 09:53:20.000000000 +0100 @@ -315,6 +315,10 @@ bool isInIncludedFile(clang::SourceLocation Loc) const; + bool isInIncludedFile(const clang::SourceRange& Range) const { + return isInIncludedFile(Range.getBegin()) ||isInIncludedFile(Range.getEnd()); + } + bool isInIncludedFile(const clang::Decl *D) const; bool isInIncludedFile(const clang::Stmt *S) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func1.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func1.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func1.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func1.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,8 @@ + +int test(int hello); + +// ... + +int test(int x) { + return 42; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func1.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func1.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func1.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func1.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,9 @@ + +int test(int hello); +int test(int x) { + return 42; +} + +// ... + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func2.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func2.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func2.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func2.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,10 @@ + +template <class T> +T test(T); + +// ... + +template <class T> +T test(T x) { + return x; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func2.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func2.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func2.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func2.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,11 @@ + +template <class T> +T test(T); +template <class T> +T test(T x) { + return x; +} + +// ... + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func3.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func3.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func3.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func3.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,12 @@ + +namespace ns { + struct C { + int test(int hello); + }; +} + +// ... + +int ns::C::test(int x) { + return 42; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func3.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func3.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func3.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func3.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,12 @@ + +namespace ns { + struct C { + int test(int x) { + return 42; +} + }; +} + +// ... + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func4.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func4.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func4.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func4.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,14 @@ + +namespace ns { + struct C { + template <class T> + T test(T hello); + }; +} + +// ... + +template <class T> +T ns::C::test(T x) { + return 42; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func4.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func4.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func4.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func4.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,13 @@ + +namespace ns { + struct C { + template <class T> +T test(T x) { + return 42; +} + }; +} + +// ... + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func5.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func5.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func5.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func5.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,14 @@ + +template <class> +struct C { + template <class T> + T test(T hello); +}; + +// ... + +template <class T1> +template <class T2> +T2 C<T1>::test(T2 x) { + return T1(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func5.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func5.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func5.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func5.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,13 @@ + +template <class T1> +struct C { + +template <class T2> +T2 test(T2 x) { + return T1(); +} +}; + +// ... + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func6.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func6.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/func6.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/func6.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,6 @@ + +int test(int hello); + +int test(int x) { + return 42; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct1.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct1.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct1.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct1.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,11 @@ + +struct S; + + +// ... + + +struct S { + int x; + int y; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct1.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct1.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct1.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct1.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,12 @@ + +struct S; +struct S { + int x; + int y; +}; + + +// ... + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct2.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct2.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct2.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct2.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,12 @@ + +template <class X> +struct S; + + +// ... + +template <class X> +struct S { + X x; + int y; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct2.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct2.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/struct2.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/struct2.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,13 @@ + +template <class X> +struct S; +template <class X> +struct S { + X x; + int y; +}; + + +// ... + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/var1.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/var1.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/var1.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/var1.cc 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,8 @@ + +extern int x; + + +// ... + + +int x = 10; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/var1.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/var1.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-definition-to-declaration/var1.output 1970-01-01 01:00:00.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-definition-to-declaration/var1.output 2022-12-17 09:53:20.000000000 +0100 @@ -0,0 +1,9 @@ + +extern int x; +int x = 10; + + +// ... + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test1.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test1.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test1.cc 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test1.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ - -int test(int hello); - -// ... - -int test(int x) { - return 42; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test1.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test1.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test1.output 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test1.output 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ - -int test(int hello); -int test(int x) { - return 42; -} - -// ... - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test2.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test2.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test2.cc 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test2.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ - -template <class T> -T test(T); - -// ... - -template <class T> -T test(T x) { - return x; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test2.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test2.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test2.output 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test2.output 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ - -template <class T> -T test(T); -template <class T> -T test(T x) { - return x; -} - -// ... - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test3.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test3.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test3.cc 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test3.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ - -namespace ns { - struct C { - int test(int hello); - }; -} - -// ... - -int ns::C::test(int x) { - return 42; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test3.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test3.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test3.output 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test3.output 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ - -namespace ns { - struct C { - int test(int x) { - return 42; -} - }; -} - -// ... - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test4.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test4.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test4.cc 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test4.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +0,0 @@ - -namespace ns { - struct C { - template <class T> - T test(T hello); - }; -} - -// ... - -template <class T> -T ns::C::test(T x) { - return 42; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test4.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test4.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test4.output 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test4.output 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ - -namespace ns { - struct C { - template <class T> -T test(T x) { - return 42; -} - }; -} - -// ... - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test5.cc new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test5.cc --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test5.cc 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test5.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +0,0 @@ - -template <class> -struct C { - template <class T> - T test(T hello); -}; - -// ... - -template <class T1> -template <class T2> -T2 C<T1>::test(T2 x) { - return T1(); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test5.output new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test5.output --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/move-function-body/test5.output 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/move-function-body/test5.output 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ - -template <class T1> -struct C { - -template <class T2> -T2 test(T2 x) { - return T1(); -} -}; - -// ... - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/test_clang_delta.py new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/test_clang_delta.py --- old/cvise-2.6.0+git.20221216.1423ed5/clang_delta/tests/test_clang_delta.py 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/clang_delta/tests/test_clang_delta.py 2022-12-17 09:53:20.000000000 +0100 @@ -654,17 +654,30 @@ def test_remove_base_class_test4(self): self.check_clang_delta('remove-base-class/test4.cc', '--transformation=remove-base-class --counter=1') - def test_move_function_body_test1(self): - self.check_clang_delta('move-function-body/test1.cc', '--transformation=move-function-body --counter=1') + def test_move_definition_to_declaration_func1(self): + self.check_clang_delta('move-definition-to-declaration/func1.cc', '--transformation=move-definition-to-declaration --counter=1') - def test_move_function_body_test2(self): - self.check_clang_delta('move-function-body/test2.cc', '--transformation=move-function-body --counter=1') + def test_move_definition_to_declaration_func2(self): + self.check_clang_delta('move-definition-to-declaration/func2.cc', '--transformation=move-definition-to-declaration --counter=1') - def test_move_function_body_test3(self): - self.check_clang_delta('move-function-body/test3.cc', '--transformation=move-function-body --counter=1') + def test_move_definition_to_declaration_func3(self): + self.check_clang_delta('move-definition-to-declaration/func3.cc', '--transformation=move-definition-to-declaration --counter=1') - def test_move_function_body_test4(self): - self.check_clang_delta('move-function-body/test4.cc', '--transformation=move-function-body --counter=1') + def test_move_definition_to_declaration_func4(self): + self.check_clang_delta('move-definition-to-declaration/func4.cc', '--transformation=move-definition-to-declaration --counter=1') - def test_move_function_body_test5(self): - self.check_clang_delta('move-function-body/test5.cc', '--transformation=move-function-body --counter=1') + def test_move_definition_to_declaration_func5(self): + self.check_clang_delta('move-definition-to-declaration/func5.cc', '--transformation=move-definition-to-declaration --counter=1') + + def test_move_definition_to_declaration_func6(self): + self.check_query_instances('move-definition-to-declaration/func6.cc', '--query-instances=move-definition-to-declaration', + 'Available transformation instances: 0') + + def test_move_definition_to_declaration_struct1(self): + self.check_clang_delta('move-definition-to-declaration/struct1.cc', '--transformation=move-definition-to-declaration --counter=1') + + def test_move_definition_to_declaration_struct2(self): + self.check_clang_delta('move-definition-to-declaration/struct2.cc', '--transformation=move-definition-to-declaration --counter=1') + + def test_move_definition_to_declaration_var1(self): + self.check_clang_delta('move-definition-to-declaration/var1.cc', '--transformation=move-definition-to-declaration --counter=1') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/cvise/pass_groups/all.json new/cvise-2.6.0+git.20221217.f1b5a08/cvise/pass_groups/all.json --- old/cvise-2.6.0+git.20221216.1423ed5/cvise/pass_groups/all.json 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/cvise/pass_groups/all.json 2022-12-17 09:53:20.000000000 +0100 @@ -71,7 +71,7 @@ {"pass": "clang", "arg": "simplify-if", "c": true }, {"pass": "clang", "arg": "reduce-array-dim", "c": true }, {"pass": "clang", "arg": "reduce-array-size", "c": true }, - {"pass": "clang", "arg": "move-function-body", "c": true }, + {"pass": "clang", "arg": "move-definition-to-declaration", "c": true }, {"pass": "clang", "arg": "simplify-comma-expr", "c": true }, {"pass": "clang", "arg": "simplify-dependent-typedef", "c": true }, {"pass": "clang", "arg": "replace-simple-typedef", "c": true }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-2.6.0+git.20221216.1423ed5/cvise/pass_groups/opencl-120.json new/cvise-2.6.0+git.20221217.f1b5a08/cvise/pass_groups/opencl-120.json --- old/cvise-2.6.0+git.20221216.1423ed5/cvise/pass_groups/opencl-120.json 2022-12-16 15:46:11.000000000 +0100 +++ new/cvise-2.6.0+git.20221217.f1b5a08/cvise/pass_groups/opencl-120.json 2022-12-17 09:53:20.000000000 +0100 @@ -67,7 +67,7 @@ {"pass": "clang", "arg": "simplify-if", "c": true }, {"pass": "clang", "arg": "reduce-array-dim", "c": true }, {"pass": "clang", "arg": "reduce-array-size", "c": true }, - {"pass": "clang", "arg": "move-function-body", "c": true }, + {"pass": "clang", "arg": "move-definition-to-declaration", "c": true }, {"pass": "clang", "arg": "simplify-comma-expr", "c": true }, {"pass": "clang", "arg": "simplify-dependent-typedef", "c": true }, {"pass": "clang", "arg": "replace-simple-typedef", "c": true },