diff options
author | owenca <owenpiano@gmail.com> | 2022-07-16 20:57:44 -0700 |
---|---|---|
committer | owenca <owenpiano@gmail.com> | 2022-07-16 20:58:20 -0700 |
commit | cd434a202c227c485fb83e84d44bfba09b0febb3 (patch) | |
tree | 45dfd48391d4e5cbd03f035280cb59b448e73f21 /llvm/tools/llvm-reduce/DeltaManager.cpp | |
parent | 3a6b766b1b8211790529aab6358f1224f0b864c1 (diff) | |
download | llvm-cd434a202c227c485fb83e84d44bfba09b0febb3.zip llvm-cd434a202c227c485fb83e84d44bfba09b0febb3.tar.gz llvm-cd434a202c227c485fb83e84d44bfba09b0febb3.tar.bz2 |
[llvm] Wrap multi-statement macro definitions with do ... while (0)
Diffstat (limited to 'llvm/tools/llvm-reduce/DeltaManager.cpp')
-rw-r--r-- | llvm/tools/llvm-reduce/DeltaManager.cpp | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/llvm/tools/llvm-reduce/DeltaManager.cpp b/llvm/tools/llvm-reduce/DeltaManager.cpp index 49dd8f1..98fd818 100644 --- a/llvm/tools/llvm-reduce/DeltaManager.cpp +++ b/llvm/tools/llvm-reduce/DeltaManager.cpp @@ -51,44 +51,48 @@ static cl::opt<std::string> cl::cat(LLVMReduceOptions)); #define DELTA_PASSES \ - DELTA_PASS("special-globals", reduceSpecialGlobalsDeltaPass) \ - DELTA_PASS("aliases", reduceAliasesDeltaPass) \ - DELTA_PASS("function-bodies", reduceFunctionBodiesDeltaPass) \ - DELTA_PASS("functions", reduceFunctionsDeltaPass) \ - DELTA_PASS("basic-blocks", reduceBasicBlocksDeltaPass) \ - DELTA_PASS("global-values", reduceGlobalValuesDeltaPass) \ - DELTA_PASS("global-objects", reduceGlobalObjectsDeltaPass) \ - DELTA_PASS("global-initializers", reduceGlobalsInitializersDeltaPass) \ - DELTA_PASS("global-variables", reduceGlobalsDeltaPass) \ - DELTA_PASS("metadata", reduceMetadataDeltaPass) \ - DELTA_PASS("arguments", reduceArgumentsDeltaPass) \ - DELTA_PASS("instructions", reduceInstructionsDeltaPass) \ - DELTA_PASS("simplify-instructions", simplifyInstructionsDeltaPass) \ - DELTA_PASS("operands-zero", reduceOperandsZeroDeltaPass) \ - DELTA_PASS("operands-one", reduceOperandsOneDeltaPass) \ - DELTA_PASS("operands-nan", reduceOperandsNaNDeltaPass) \ - DELTA_PASS("operands-to-args", reduceOperandsToArgsDeltaPass) \ - DELTA_PASS("operands-skip", reduceOperandsSkipDeltaPass) \ - DELTA_PASS("operand-bundles", reduceOperandBundesDeltaPass) \ - DELTA_PASS("attributes", reduceAttributesDeltaPass) \ - DELTA_PASS("module-data", reduceModuleDataDeltaPass) + do { \ + DELTA_PASS("special-globals", reduceSpecialGlobalsDeltaPass) \ + DELTA_PASS("aliases", reduceAliasesDeltaPass) \ + DELTA_PASS("function-bodies", reduceFunctionBodiesDeltaPass) \ + DELTA_PASS("functions", reduceFunctionsDeltaPass) \ + DELTA_PASS("basic-blocks", reduceBasicBlocksDeltaPass) \ + DELTA_PASS("global-values", reduceGlobalValuesDeltaPass) \ + DELTA_PASS("global-objects", reduceGlobalObjectsDeltaPass) \ + DELTA_PASS("global-initializers", reduceGlobalsInitializersDeltaPass) \ + DELTA_PASS("global-variables", reduceGlobalsDeltaPass) \ + DELTA_PASS("metadata", reduceMetadataDeltaPass) \ + DELTA_PASS("arguments", reduceArgumentsDeltaPass) \ + DELTA_PASS("instructions", reduceInstructionsDeltaPass) \ + DELTA_PASS("simplify-instructions", simplifyInstructionsDeltaPass) \ + DELTA_PASS("operands-zero", reduceOperandsZeroDeltaPass) \ + DELTA_PASS("operands-one", reduceOperandsOneDeltaPass) \ + DELTA_PASS("operands-nan", reduceOperandsNaNDeltaPass) \ + DELTA_PASS("operands-to-args", reduceOperandsToArgsDeltaPass) \ + DELTA_PASS("operands-skip", reduceOperandsSkipDeltaPass) \ + DELTA_PASS("operand-bundles", reduceOperandBundesDeltaPass) \ + DELTA_PASS("attributes", reduceAttributesDeltaPass) \ + DELTA_PASS("module-data", reduceModuleDataDeltaPass) \ + } while (false) #define DELTA_PASSES_MIR \ - DELTA_PASS("instructions", reduceInstructionsMIRDeltaPass) \ - DELTA_PASS("ir-instruction-references", \ - reduceIRInstructionReferencesDeltaPass) \ - DELTA_PASS("ir-block-references", reduceIRBlockReferencesDeltaPass) \ - DELTA_PASS("ir-function-references", reduceIRFunctionReferencesDeltaPass) \ - DELTA_PASS("instruction-flags", reduceInstructionFlagsMIRDeltaPass) \ - DELTA_PASS("register-uses", reduceRegisterUsesMIRDeltaPass) \ - DELTA_PASS("register-hints", reduceVirtualRegisterHintsDeltaPass) + do { \ + DELTA_PASS("instructions", reduceInstructionsMIRDeltaPass) \ + DELTA_PASS("ir-instruction-references", \ + reduceIRInstructionReferencesDeltaPass) \ + DELTA_PASS("ir-block-references", reduceIRBlockReferencesDeltaPass) \ + DELTA_PASS("ir-function-references", reduceIRFunctionReferencesDeltaPass) \ + DELTA_PASS("instruction-flags", reduceInstructionFlagsMIRDeltaPass) \ + DELTA_PASS("register-uses", reduceRegisterUsesMIRDeltaPass) \ + DELTA_PASS("register-hints", reduceVirtualRegisterHintsDeltaPass) \ + } while (false) static void runAllDeltaPasses(TestRunner &Tester) { #define DELTA_PASS(NAME, FUNC) FUNC(Tester); if (Tester.getProgram().isMIR()) { - DELTA_PASSES_MIR + DELTA_PASSES_MIR; } else { - DELTA_PASSES + DELTA_PASSES; } #undef DELTA_PASS } @@ -100,9 +104,9 @@ static void runDeltaPassName(TestRunner &Tester, StringRef PassName) { return; \ } if (Tester.getProgram().isMIR()) { - DELTA_PASSES_MIR + DELTA_PASSES_MIR; } else { - DELTA_PASSES + DELTA_PASSES; } #undef DELTA_PASS errs() << "unknown pass \"" << PassName << "\"\n"; @@ -113,9 +117,9 @@ void llvm::printDeltaPasses(raw_ostream &OS) { OS << "Delta passes (pass to `--delta-passes=` as a comma separated list):\n"; #define DELTA_PASS(NAME, FUNC) OS << " " << NAME << "\n"; OS << " IR:\n"; - DELTA_PASSES + DELTA_PASSES; OS << " MIR:\n"; - DELTA_PASSES_MIR + DELTA_PASSES_MIR; #undef DELTA_PASS } |