diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-06-04 15:13:30 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-06-04 15:13:30 +0000 |
commit | 880d21d3cbfd143f11c2bd2f5a5d6b46bfcb1a70 (patch) | |
tree | fe1fa795d9e105f13b72fd448185ddf72458bf90 /llvm/lib/Demangle/MicrosoftDemangleNodes.cpp | |
parent | c5fe030c166b0fee57b7a5dfea20f24f4571fe29 (diff) | |
download | bcm5719-llvm-880d21d3cbfd143f11c2bd2f5a5d6b46bfcb1a70.tar.gz bcm5719-llvm-880d21d3cbfd143f11c2bd2f5a5d6b46bfcb1a70.zip |
llvm-undname: Several behavior-preserving changes to increase coverage
- Replace `Error = true` in a few branches that are truly unreachable
with DEMANGLE_UNREACHABLE
- Remove early return early in startsWithLocalScopePattern() because
it's redundant with the next two early returns
- Remove unreachable `case '0'` (it's handled in the branch below)
- Remove an unused bool return
- Add test coverage for several early error returns, mostly in
array type parsing
llvm-svn: 362506
Diffstat (limited to 'llvm/lib/Demangle/MicrosoftDemangleNodes.cpp')
-rw-r--r-- | llvm/lib/Demangle/MicrosoftDemangleNodes.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp index c26151c5b19..c07fde897e0 100644 --- a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp @@ -34,21 +34,20 @@ static void outputSpaceIfNecessary(OutputStream &OS) { OS << " "; } -static bool outputSingleQualifier(OutputStream &OS, Qualifiers Q) { +static void outputSingleQualifier(OutputStream &OS, Qualifiers Q) { switch (Q) { case Q_Const: OS << "const"; - return true; + break; case Q_Volatile: OS << "volatile"; - return true; + break; case Q_Restrict: OS << "__restrict"; - return true; + break; default: break; } - return false; } static bool outputQualifierIfPresent(OutputStream &OS, Qualifiers Q, |