[mlir][flang] Fix -Wunused-result after D146785 (NFC)
authorJie Fu <jiefu@tencent.com>
Sun, 2 Apr 2023 08:30:33 +0000 (16:30 +0800)
committerJie Fu <jiefu@tencent.com>
Sun, 2 Apr 2023 08:30:33 +0000 (16:30 +0800)
/data/llvm-project/mlir/examples/toy/Ch4/toyc.cpp:119:5: error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
    applyPassManagerCLOptions(pm);
    ^~~~~~~~~~~~~~~~~~~~~~~~~ ~~
1 error generated.

/data/llvm-project/flang/lib/Frontend/FrontendActions.cpp:669:3: error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
  mlir::applyPassManagerCLOptions(pm);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
1 error generated.

flang/lib/Frontend/FrontendActions.cpp
flang/tools/bbc/bbc.cpp
flang/tools/tco/tco.cpp
mlir/examples/toy/Ch3/toyc.cpp
mlir/examples/toy/Ch4/toyc.cpp
mlir/examples/toy/Ch5/toyc.cpp
mlir/examples/toy/Ch6/toyc.cpp
mlir/examples/toy/Ch7/toyc.cpp

index e09968c..b2f25d1 100644 (file)
@@ -666,7 +666,7 @@ void CodeGenAction::generateLLVMIR() {
   // Create the pass pipeline
   fir::createMLIRToLLVMPassPipeline(pm, level, opts.StackArrays,
                                     opts.Underscoring, opts.getDebugInfo());
-  mlir::applyPassManagerCLOptions(pm);
+  (void)mlir::applyPassManagerCLOptions(pm);
 
   // run the pass manager
   if (!mlir::succeeded(pm.run(*mlirModule))) {
index a37bf61..d021a96 100644 (file)
@@ -260,7 +260,7 @@ static mlir::LogicalResult convertFortranSourceToMLIR(
   mlir::PassManager pm(mlirModule->getName(),
                        mlir::OpPassManager::Nesting::Implicit);
   pm.enableVerifier(/*verifyPasses=*/true);
-  mlir::applyPassManagerCLOptions(pm);
+  (void)mlir::applyPassManagerCLOptions(pm);
   if (passPipeline.hasAnyOccurrences()) {
     // run the command-line specified pipeline
     (void)passPipeline.addToPipeline(pm, [&](const llvm::Twine &msg) {
index e7dca6b..9552d5c 100644 (file)
@@ -106,7 +106,7 @@ compileFIR(const mlir::PassPipelineCLParser &passPipeline) {
   mlir::PassManager pm((*owningRef)->getName(),
                        mlir::OpPassManager::Nesting::Implicit);
   pm.enableVerifier(/*verifyPasses=*/true);
-  mlir::applyPassManagerCLOptions(pm);
+  (void)mlir::applyPassManagerCLOptions(pm);
   if (emitFir) {
     // parse the input and pretty-print it back out
     // -emit-fir intentionally disables all the passes
index ef362e4..8597913 100644 (file)
@@ -115,7 +115,7 @@ int dumpMLIR() {
   if (enableOpt) {
     mlir::PassManager pm(module.get()->getName());
     // Apply any generic pass manager command line options and run the pipeline.
-    applyPassManagerCLOptions(pm);
+    (void)applyPassManagerCLOptions(pm);
 
     // Add a run of the canonicalizer to optimize the mlir module.
     pm.addNestedPass<mlir::toy::FuncOp>(mlir::createCanonicalizerPass());
index bf8e694..b866ffa 100644 (file)
@@ -116,7 +116,7 @@ int dumpMLIR() {
   if (enableOpt) {
     mlir::PassManager pm(module.get()->getName());
     // Apply any generic pass manager command line options and run the pipeline.
-    applyPassManagerCLOptions(pm);
+    (void)applyPassManagerCLOptions(pm);
 
     // Inline all functions into main and then delete them.
     pm.addPass(mlir::createInlinerPass());
index 5a23c49..3cc2683 100644 (file)
@@ -119,7 +119,7 @@ int dumpMLIR() {
 
   mlir::PassManager pm(module.get()->getName());
   // Apply any generic pass manager command line options and run the pipeline.
-  applyPassManagerCLOptions(pm);
+  (void)applyPassManagerCLOptions(pm);
 
   // Check to see what granularity of MLIR we are compiling to.
   bool isLoweringToAffine = emitAction >= Action::DumpMLIRAffine;
index 60b7da0..e637cf9 100644 (file)
@@ -136,7 +136,7 @@ int loadAndProcessMLIR(mlir::MLIRContext &context,
 
   mlir::PassManager pm(module.get()->getName());
   // Apply any generic pass manager command line options and run the pipeline.
-  applyPassManagerCLOptions(pm);
+  (void)applyPassManagerCLOptions(pm);
 
   // Check to see what granularity of MLIR we are compiling to.
   bool isLoweringToAffine = emitAction >= Action::DumpMLIRAffine;
index f074bf6..c2effc7 100644 (file)
@@ -136,7 +136,7 @@ int loadAndProcessMLIR(mlir::MLIRContext &context,
 
   mlir::PassManager pm(module.get()->getName());
   // Apply any generic pass manager command line options and run the pipeline.
-  applyPassManagerCLOptions(pm);
+  (void)applyPassManagerCLOptions(pm);
 
   // Check to see what granularity of MLIR we are compiling to.
   bool isLoweringToAffine = emitAction >= Action::DumpMLIRAffine;