summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-04-21 08:06:12 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-04-21 08:44:07 (GMT)
commitb26577c92ae59fa23be49bcaa3404efe36646e1a (patch)
tree012e6dd431092905593339451118cf434aefa206 /Source/cmSystemTools.cxx
parent1b0c7bca5ede6eb3965cb23471c6530a08d0d2d5 (diff)
downloadCMake-b26577c92ae59fa23be49bcaa3404efe36646e1a.zip
CMake-b26577c92ae59fa23be49bcaa3404efe36646e1a.tar.gz
CMake-b26577c92ae59fa23be49bcaa3404efe36646e1a.tar.bz2
clang-tidy: remove else after break and continue
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx49
1 files changed, 25 insertions, 24 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7ace0a3..9d3d91f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1667,7 +1667,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
for (; outiter != out.end(); ++outiter) {
if ((*outiter == '\r') && ((outiter + 1) == out.end())) {
break;
- } else if (*outiter == '\n' || *outiter == '\0') {
+ }
+ if (*outiter == '\n' || *outiter == '\0') {
std::vector<char>::size_type length = outiter - out.begin();
if (length > 1 && *(outiter - 1) == '\r') {
--length;
@@ -1684,7 +1685,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
for (; erriter != err.end(); ++erriter) {
if ((*erriter == '\r') && ((erriter + 1) == err.end())) {
break;
- } else if (*erriter == '\n' || *erriter == '\0') {
+ }
+ if (*erriter == '\n' || *erriter == '\0') {
std::vector<char>::size_type length = erriter - err.begin();
if (length > 1 && *(erriter - 1) == '\r') {
--length;
@@ -2583,29 +2585,28 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
it = dentries.erase(it);
entriesErased++;
continue;
- } else {
- if (cmELF::TagMipsRldMapRel != 0 &&
- it->first == cmELF::TagMipsRldMapRel) {
- // Background: debuggers need to know the "linker map" which contains
- // the addresses each dynamic object is loaded at. Most arches use
- // the DT_DEBUG tag which the dynamic linker writes to (directly) and
- // contain the location of the linker map, however on MIPS the
- // .dynamic section is always read-only so this is not possible. MIPS
- // objects instead contain a DT_MIPS_RLD_MAP tag which contains the
- // address where the dyanmic linker will write to (an indirect
- // version of DT_DEBUG). Since this doesn't work when using PIE, a
- // relative equivalent was created - DT_MIPS_RLD_MAP_REL. Since this
- // version contains a relative offset, moving it changes the
- // calculated address. This may cause the dyanmic linker to write
- // into memory it should not be changing.
- //
- // To fix this, we adjust the value of DT_MIPS_RLD_MAP_REL here. If
- // we move it up by n bytes, we add n bytes to the value of this tag.
- it->second += entriesErased * sizeof_dentry;
- }
-
- it++;
}
+ if (cmELF::TagMipsRldMapRel != 0 &&
+ it->first == cmELF::TagMipsRldMapRel) {
+ // Background: debuggers need to know the "linker map" which contains
+ // the addresses each dynamic object is loaded at. Most arches use
+ // the DT_DEBUG tag which the dynamic linker writes to (directly) and
+ // contain the location of the linker map, however on MIPS the
+ // .dynamic section is always read-only so this is not possible. MIPS
+ // objects instead contain a DT_MIPS_RLD_MAP tag which contains the
+ // address where the dyanmic linker will write to (an indirect
+ // version of DT_DEBUG). Since this doesn't work when using PIE, a
+ // relative equivalent was created - DT_MIPS_RLD_MAP_REL. Since this
+ // version contains a relative offset, moving it changes the
+ // calculated address. This may cause the dyanmic linker to write
+ // into memory it should not be changing.
+ //
+ // To fix this, we adjust the value of DT_MIPS_RLD_MAP_REL here. If
+ // we move it up by n bytes, we add n bytes to the value of this tag.
+ it->second += entriesErased * sizeof_dentry;
+ }
+
+ it++;
}
// Encode new entries list