summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-06-04 15:13:30 +0000
committerNico Weber <nicolasweber@gmx.de>2019-06-04 15:13:30 +0000
commit880d21d3cbfd143f11c2bd2f5a5d6b46bfcb1a70 (patch)
treefe1fa795d9e105f13b72fd448185ddf72458bf90 /llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
parentc5fe030c166b0fee57b7a5dfea20f24f4571fe29 (diff)
downloadbcm5719-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.cpp9
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,
OpenPOWER on IntegriCloud