[Lldb-commits] [lldb] 801067f - [mlir][lldb] Fix several gcc warnings in mlir and lldb

Stella Stamenova via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 1 13:49:34 PST 2021


Author: Stella Stamenova
Date: 2021-03-01T13:48:22-08:00
New Revision: 801067f4c09bb8c3b625991c5adcb69b58eabaa1

URL: https://github.com/llvm/llvm-project/commit/801067f4c09bb8c3b625991c5adcb69b58eabaa1
DIFF: https://github.com/llvm/llvm-project/commit/801067f4c09bb8c3b625991c5adcb69b58eabaa1.diff

LOG: [mlir][lldb] Fix several gcc warnings in mlir and lldb

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.

Reviewed By: mehdi_amini

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Commands/CommandObjectTrace.cpp b/lldb/source/Commands/CommandObjectTrace.cpp
index 170630b85b2e..9d87e8cc4017 100644
--- a/lldb/source/Commands/CommandObjectTrace.cpp
+++ b/lldb/source/Commands/CommandObjectTrace.cpp
@@ -116,7 +116,7 @@ class CommandObjectTraceLoad : public CommandObjectParsed {
             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

diff  --git a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
index 93221b06db37..8d4fcbacca4a 100644
--- a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
+++ b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
@@ -27,7 +27,7 @@ using namespace mlir;
 /// attribute.
 static uint64_t getFirstIntValue(ArrayAttr attr) {
   return (*attr.getAsValueRange<IntegerAttr>().begin()).getZExtValue();
-};
+}
 
 namespace {
 

diff  --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
index d59be1624851..5578ff52d477 100644
--- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
+++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
@@ -129,12 +129,12 @@ struct LinalgOpConfig {
 // 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 {


        


More information about the lldb-commits mailing list