[TSan] Use switches when dealing with enums

Summary:
Small refactoring: replace some if-else cascades with switches so that the compiler warns us about missing cases.
Maybe found a small bug?

Reviewers: dcoughlin, kubamracek, dvyukov, delcypher, jfb

Reviewed By: dvyukov

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D56295

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351288 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed