-
Notifications
You must be signed in to change notification settings - Fork 17
Split declaration statements #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Valeriya-avt
wants to merge
14
commits into
dvm-system:master
Choose a base branch
from
Valeriya-avt:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6a2e7ef
resolved the conflict in CMakeLists.txt
Valeriya-avt 1d22e84
Split declaration statements
Valeriya-avt b26cabd
Split declaration statements with ExternalRewriter (version 1)
Valeriya-avt 91a3080
SplitDecls with TraverseTypeLoc (version 1)
Valeriya-avt 55c9817
SplitDecls with ElaboratedTypeLoc
Valeriya-avt d6f15cb
Code refactoring
Valeriya-avt f39f72b
Segmentation fault fix
Valeriya-avt 79820d8
SplitDecls with initialization
Valeriya-avt 4cbbb7e
without processing ParmVarDecl
Valeriya-avt ef16fb4
split of global declarations
Valeriya-avt 7ddd390
Add pragma handling, remove unused variables, update work with Transf…
Valeriya-avt faa94bb
Fix issue with splitting global declarations. Add the ability to spli…
Valeriya-avt 60c2a0b
Fixed an issue with splitting global pointer declarations
Valeriya-avt ac3ce33
Update handling of global variable declarations, refactor code, add d…
Valeriya-avt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| //===- MyFirstPass.h - Source-level Renaming of Local Objects -- *- C++ -*-===// | ||
| // | ||
| // Traits Static Analyzer (SAPFOR) | ||
| // | ||
| // Copyright 2018 DVM System Group | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // This file declares a pass to perform renaming of objects into a specified | ||
| // scope. The goal of this transformation is to ensure that there is no | ||
| // different objects with the same name at a specified scope. The transformation | ||
| // also guaranties that names of objects declared in a specified scope do not | ||
| // match any name from other scopes. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #ifndef TSAR_CLANG_SPLIT_DECLS_H | ||
| #define TSAR_CLANG_SPLIT_DECLS_H | ||
|
|
||
| #include "tsar/Transform/Clang/Passes.h" | ||
| #include <bcl/utility.h> | ||
| #include <llvm/Pass.h> | ||
|
|
||
| #include "tsar/Analysis/Clang/GlobalInfoExtractor.h" | ||
| #include <clang/AST/RecursiveASTVisitor.h> | ||
| #include <clang/AST/TypeLoc.h> | ||
| #include <llvm/ADT/BitmaskEnum.h> | ||
| #include <llvm/ADT/DenseMapInfo.h> | ||
| #include <llvm/ADT/StringMap.h> | ||
| #include <llvm/ADT/StringSet.h> | ||
| #include <map> | ||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| namespace llvm { | ||
| /// This pass separates variable declaration statements that contain multiple | ||
| /// variable declarations at once into single declarations. | ||
| class ClangSplitDeclsPass : public ModulePass, private bcl::Uncopyable { | ||
| public: | ||
| static char ID; | ||
|
|
||
| ClangSplitDeclsPass() : ModulePass(ID) { | ||
| initializeClangSplitDeclsPassPass(*PassRegistry::getPassRegistry()); | ||
| } | ||
|
|
||
| bool runOnModule(Module &M) override; | ||
| void getAnalysisUsage(AnalysisUsage &AU) const override; | ||
| }; | ||
| } | ||
| #endif//TSAR_CLANG_SPLIT_DECLS_H | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно перенести объявление прохода в
.cppфайл, а.hфайл вообще удалить. Т.к. проход преобразования, не может быть запрошен из другого прохода, то и интерфейс его стоит скрыть внутри.cppфайлы, оставив видимыми наружу только функцииinitialize...иcreate...объявленные вPasses.h.