[llvm] 9510d59 - [llvm] A macro of if should be wrapped in do ... while (false)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 00:27:13 PDT 2022
Author: owenca
Date: 2022-07-15T00:27:05-07:00
New Revision: 9510d5971eee79be481596a702bf2a3e232c30f3
URL: https://github.com/llvm/llvm-project/commit/9510d5971eee79be481596a702bf2a3e232c30f3
DIFF: https://github.com/llvm/llvm-project/commit/9510d5971eee79be481596a702bf2a3e232c30f3.diff
LOG: [llvm] A macro of if should be wrapped in do ... while (false)
Added:
Modified:
llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp b/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
index 27f63b9edcd03..7f4511258c643 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
@@ -36,8 +36,10 @@ using namespace llvm::codeview;
namespace {
#define error(X) \
- if (auto EC = X) \
- return EC;
+ do { \
+ if (auto EC = X) \
+ return EC; \
+ } while (false)
static const EnumEntry<TypeLeafKind> LeafTypeNames[] = {
#define CV_TYPE(enum, val) {#enum, enum},
More information about the llvm-commits
mailing list