diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-04-01 22:25:09 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-04-01 22:25:09 +0000 |
commit | 91567b6700ff7975cae34b28ec28b5281b33ff19 (patch) | |
tree | 624226b3ea2db33d4a15dd20a878e4d0c626ae09 /llvm/lib | |
parent | 26eb6c5bc2f4042d7b049d7fde18969f6795c04f (diff) | |
download | bcm5719-llvm-91567b6700ff7975cae34b28ec28b5281b33ff19.tar.gz bcm5719-llvm-91567b6700ff7975cae34b28ec28b5281b33ff19.zip |
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.
llvm-svn: 205367
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h index 9f5be6164f5..976edf0a2ab 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/llvm/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: |