summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-01 22:25:09 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-01 22:25:09 +0000
commit0afa71ea9154331eac03b1418b3fbf6127be9e95 (patch)
tree7abd89ebd82f8169b97337c083a974b90151a8bf /lib/CodeGen
parent2e33edd399580121fc62d918a0a20ac05171f0c4 (diff)
downloadllvm-0afa71ea9154331eac03b1418b3fbf6127be9e95.tar.gz
llvm-0afa71ea9154331eac03b1418b3fbf6127be9e95.tar.bz2
llvm-0afa71ea9154331eac03b1418b3fbf6127be9e95.tar.xz
Fix accidental fallthrough in DebugLocEntry::hasSameValueOrLocation
No test case (this would invoke UB by examining uninitialized members, etc, at best - and this code is apparently untested anyway - I'm about to fix that) Code review feedback from Adrian Prantl on r205360. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DebugLocEntry.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/lib/CodeGen/AsmPrinter/DebugLocEntry.h
index 9f5be6164f..976edf0a2a 100644
--- a/lib/CodeGen/AsmPrinter/DebugLocEntry.h
+++ b/lib/CodeGen/AsmPrinter/DebugLocEntry.h
@@ -46,18 +46,23 @@ class DebugLocEntry {
if (EntryKind != Next.EntryKind)
return false;
+ bool EqualValues;
switch (EntryKind) {
case E_Location:
- if (Loc != Next.Loc) return false;
+ EqualValues = Loc == Next.Loc;
+ break;
case E_Integer:
- if (Constants.Int != Next.Constants.Int) return false;
+ EqualValues = Constants.Int == Next.Constants.Int;
+ break;
case E_ConstantFP:
- if (Constants.CFP != Next.Constants.CFP) return false;
+ EqualValues = Constants.CFP == Next.Constants.CFP;
+ break;
case E_ConstantInt:
- if (Constants.CIP != Next.Constants.CIP) return false;
+ EqualValues = Constants.CIP == Next.Constants.CIP;
+ break;
}
- return true;
+ return EqualValues;
}
public: