[PATCH] D19410: [scan-build] fix warnings emitted on LLVM ARM code base

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 04:48:09 PDT 2016


rengolin added a subscriber: weimingz.

================
Comment at: lib/Target/ARM/ARMFrameLowering.cpp:1610
@@ -1609,4 +1609,3 @@
   //        worth the effort and added fragility?
-  bool BigStack = (RS && (MFI->estimateStackSize(MF) +
-                              ((hasFP(MF) && AFI->hasStackFrame()) ? 4 : 0) >=
-                          estimateRSStackSizeLimit(MF, this))) ||
+  bool BigStack = ((MFI->estimateStackSize(MF) +
+                    ((hasFP(MF) && AFI->hasStackFrame()) ? 4 : 0) >=
----------------
Better ask @weimingz about this one.

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:9965
@@ +9964,3 @@
+  const MCSection *Section = getStreamer().getCurrentSection().first;
+  assert(Section && "must have section to emit alignment");
+  if (Section->UseCodeAlign())
----------------
We don't want asserts in assembly parsers, people can write pretty much anything. Make this an error.

================
Comment at: lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp:409
@@ -408,2 +408,3 @@
   } else {
+    assert(A && "symbol is needed to resolve constant variables");
     // Resolve constant variables.
----------------
probably better if you do:

    if (A && A-getVariable()) {

================
Comment at: lib/Target/ARM/Thumb2SizeReduction.cpp:992
@@ -991,2 +991,3 @@
     if (!NextInSameBundle && MI->isInsideBundle()) {
+      assert(BundleMI && "MachineInstr is null, abort reducing width of instructions");
       // FIXME: Since post-ra scheduler operates on bundles, the CPSR kill
----------------
this assert is in the wrong place. It should be just after BundleMI is created.


http://reviews.llvm.org/D19410





More information about the llvm-commits mailing list