[Lldb-commits] [PATCH] D97586: [mlir][lldb] Fix several gcc warnings in mlir and lldb

Stella Stamenova via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 26 14:58:17 PST 2021


stella.stamenova created this revision.
Herald added subscribers: cota, teijeong, rdzhabarov, tatianashp, ThomasRaoux, AlexeySotkin, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a reviewer: aartbik.
stella.stamenova requested review of this revision.
Herald added subscribers: lldb-commits, stephenneuendorffer, nicolasvasilache.
Herald added projects: LLDB, MLIR.

These warnings are raised when compiling with gcc due to either having too few or too many commas, or in the case of lldb, the possibility of a nullptr.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97586

Files:
  lldb/source/Commands/CommandObjectTrace.cpp
  mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
  mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp


Index: mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
===================================================================
--- mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
+++ mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
@@ -119,12 +119,12 @@
 // Mapping traits.
 //===----------------------------------------------------------------------===//
 
-LLVM_YAML_IS_SEQUENCE_VECTOR(LinalgTensorDef);
-LLVM_YAML_IS_SEQUENCE_VECTOR(SerializedAffineMap);
-LLVM_YAML_IS_SEQUENCE_VECTOR(LinalgIteratorTypeDef);
-LLVM_YAML_IS_SEQUENCE_VECTOR(ScalarAssign);
-LLVM_YAML_IS_SEQUENCE_VECTOR(ScalarExpression);
-LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(LinalgOpConfig);
+LLVM_YAML_IS_SEQUENCE_VECTOR(LinalgTensorDef)
+LLVM_YAML_IS_SEQUENCE_VECTOR(SerializedAffineMap)
+LLVM_YAML_IS_SEQUENCE_VECTOR(LinalgIteratorTypeDef)
+LLVM_YAML_IS_SEQUENCE_VECTOR(ScalarAssign)
+LLVM_YAML_IS_SEQUENCE_VECTOR(ScalarExpression)
+LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(LinalgOpConfig)
 
 namespace llvm {
 namespace yaml {
Index: mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
===================================================================
--- mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
+++ mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
@@ -27,7 +27,7 @@
 /// attribute.
 static uint64_t getFirstIntValue(ArrayAttr attr) {
   return (*attr.getAsValueRange<IntegerAttr>().begin()).getZExtValue();
-};
+}
 
 namespace {
 
Index: lldb/source/Commands/CommandObjectTrace.cpp
===================================================================
--- lldb/source/Commands/CommandObjectTrace.cpp
+++ lldb/source/Commands/CommandObjectTrace.cpp
@@ -116,7 +116,7 @@
             Trace::FindPlugin(GetDebugger(), *session_file,
                               json_file.GetDirectory().AsCString())) {
       lldb::TraceSP trace_sp = traceOrErr.get();
-      if (m_options.m_verbose)
+      if (m_options.m_verbose && trace_sp)
         result.AppendMessageWithFormat("loading trace with plugin %s\n",
                                        trace_sp->GetPluginName().AsCString());
     } else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97586.326811.patch
Type: text/x-patch
Size: 2103 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210226/9629ed6f/attachment-0001.bin>


More information about the lldb-commits mailing list