-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up after merging latest sources (#603)
Cherry-picked from commit c9f834e This addresses issue #601. - Clean up PointerTypeLoc class. The merge introduced a new base class. We had redundant methods on the subclass and some methods on the subclass that needed to be moved to the base class. - Fix compiler warnings about fall-through. - Remove some commented out code that was left behind. - Update directions for merging latest sources.
- Loading branch information
Showing
5 changed files
with
86 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,69 +1,104 @@ | ||
# Instructions for updating to the latest LLVM/clang sources | ||
|
||
We are staying in sync with the LLVM/clang mainline sources. The baseline branch is a pristine copy of clang/LLVM sources. | ||
We periodically update the baseline branch and then push the changes to other branches | ||
We are staying in sync with the LLVM/clang mainline sources. The baseline branch is a pristine copy of | ||
LLVM/clang sources. We periodically update the baseline branch and then push the changes to other branches | ||
|
||
## Update your local baseline branches to the latest sources | ||
To update the baseline branch to the latest sourcess, make sure you have personal forks of the Checked C LLVM and clang repos. | ||
Clone these forks to your local machine. Then create remotes to the mirrored Github repos that contain the updates sources | ||
for LLVM and clang. Go to your LLVM repo and do: | ||
The first step is to create updated baseline branches: | ||
1. Create new branches of your local baseline branches (we suggest creating new | ||
branches so that you can run automated testing. You'll need new branches | ||
that you can push to GitHub). | ||
2. Update those branches to the latest sources. | ||
3. Run testing on those branches to make sure things are stable. | ||
|
||
git remote add mirror https://github.com/llvm-mirror/llvm | ||
The second step is to create updated master branches: | ||
1. Create branches of your updated baseline branches. | ||
2. Merge changes from the Checked C master branches into those branches. | ||
3. Fix merge conflicts and run testing. You will likely need to fix some issues | ||
and re-run testing until all issues are fixed. | ||
|
||
Set the upstream branch to the master llvm branch: | ||
The third step is to merge your changes back into your baseline and master branches. | ||
|
||
git branch --set-upstream baseline mirror/llvm | ||
## Create updated branches of your baseline branches | ||
|
||
You can then pull changes from the main repo into your local repo: | ||
First create remotes to the mirrored GitHub repos that contain the updated sources | ||
for LLVM and clang. Go to your LLVM repo and do: | ||
|
||
git pull mirror baseline | ||
git remote add mirror https://github.com/llvm-mirror/llvm | ||
|
||
Then branch your baseline branch and merge changes into it: | ||
|
||
git checkout baseline | ||
git checkout -b updated-baseline | ||
git pull mirror master | ||
|
||
Repeat the process for your clang repo: | ||
|
||
git remote add mirror https://github.com/llvm-mirror/clang | ||
git branch --set-upstream baseline mirror/clang | ||
git pull mirror baseline | ||
|
||
git checkout baseline | ||
git checkout -b updated-baseline | ||
git pull mirror master | ||
|
||
## Ensure the clang and LLVM sources are synchronized | ||
The sources are being pulled from multiple repos that are mirrors of SVN repositories. | ||
The sources need for LLVM and clang may be out of sync - for example, the mirrors may not be in sync or a change may | ||
be checked in after pulling from one of the repos. | ||
|
||
You need to make sure that source are in sync. The Git mirror commits have the SVN change number embedded in them and the | ||
SVN change number is consistent across SVN repos for clang and LLVM. You can examine that recent change log for clang and LLVM and find changes that are in | ||
sync according to the SVN number (there may be gaps in the numbering because a change may only affect on repo). For each Git repo, note the Git commit (the first 8 or so digits of the hash) | ||
LLVM has unified its projects into one repo. However, we have not migrated our | ||
repos into one repo yet. This means that our sources are being | ||
pulled from partial mirrors of a unifed repo. You need to make sure that the | ||
changes are in sync. The pace of commits is fast enough that a change that | ||
causes a build break could be introduced between syncing. | ||
|
||
For each Git repo, make *sure* that you change to the baseline branch: | ||
|
||
git checkout baseline | ||
|
||
Then do | ||
While the LLVM ecosystem is migrating, you can look at the SVN IDs in the | ||
upstream git repo commits to see if you've gotten out-of-sync. If the | ||
changes are not very close, for each of your branched baselines | ||
)updated-baseline in the above example), use | ||
|
||
git reset --hard commit-number, where commit-number is the Git commit. | ||
|
||
## Update the baseline branch on Github | ||
## Run testing on your branched baseline branches. | ||
|
||
You can run testing locally or push your branched baseline branches to GitHub | ||
and use automated testing. This will show you whether there are any unexpected | ||
failures in your baseline branch. | ||
|
||
If you use automated testing, make sure to clean the build directory first. | ||
Enough changes will likely have accumulated that things may go wrong without doing | ||
that first. | ||
|
||
## Branch your new baseline branches and merge master changes | ||
|
||
You can now branch your baseline branches to create a new master branch: | ||
|
||
git checkout -b updated-master | ||
git merge master | ||
|
||
You will very likely have merge conflicts and some test failures. The test | ||
failures usually stem from incorrect merges or Checked C-specific data not being | ||
initialized by new or changed constructor methods. | ||
|
||
You will then need to build and run tests to establish test baselines. Assuming that the tests results are good, | ||
you can push them to your personal Github forks: | ||
You may also need to pick up changes from LLVM/clang for fixes to any unexpected | ||
baseline failures. | ||
|
||
git push origin baseline | ||
You can push your updated master branches up to GitHub for automated | ||
testing. If you haven't cleaned the build directory as described earlier, | ||
make sure you do that. | ||
|
||
You can then issue pull requests to pull the changes into the Microsift Github repos. | ||
You'll want to run automated tests on Linux and Windows x86/x64, as well as | ||
Linux LNT tests. You may find in some cases that tests need to be updated | ||
based on new warnings or slightly different compiler behavior. | ||
|
||
## Update the master branch. | ||
## Merge your branched baseline and master branches | ||
|
||
After you have updated the baseline branch, you can update the master branch. Change to each repo and then do: | ||
Once all testing is passing, you can merge your branches back into | ||
your baseline and master branches. | ||
|
||
git checkout master | ||
git merge baseline | ||
|
||
Set up the build system and compile. Fix any issues that you encounter. | ||
git checkout baseline | ||
git merge updated-baseline | ||
git checkout master | ||
git merge updated-master | ||
|
||
Then run tests. We have added tests for Checked C to the clang master branch, so these additional tests need to be taken | ||
into account during testing. Make sure the code passes the following tests: | ||
## Push the updated branches to GitHub | ||
|
||
- The same tests as the baseline branch, _plus_ the Checked C specific tests for clang in the master branch. | ||
- The Checked C languages tests for the Checked C project. | ||
The changes will be extensive enough that you don't want to do a pull request | ||
on GitHub. Just push the branches up to GitHub. | ||
|
||
Once the tests are passing, push the changes up to a personal Github fork and issue a pull request. |
This file contains 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 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 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 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