[PATCH] D16044: getDescriptiveName() for MemRegion

Alexander Droste via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 13 07:30:19 PDT 2016


Alexander_Droste added inline comments.

================
Comment at: test/Analysis/MemRegion.cpp:3
@@ +2,3 @@
+
+#include "MPIMock.h"
+
----------------
The problem about these tests is that they introduce a cyclic commit dependency. MPI-Checker depends on `getDescriptiveName`. `getDescriptiveName` depends on MPI-Checker because of the tests.

Further, MPI-Checker depends on this function:

```
SourceRange MemRegion::sourceRange() const {
  const VarRegion *const VR = dyn_cast<VarRegion>(this->getBaseRegion());
  const FieldRegion *const FR = dyn_cast<FieldRegion>(this);
  const CXXBaseObjectRegion*const COR = dyn_cast<CXXBaseObjectRegion>(this);

  // Check for more specific regions first.
  // FieldRegion
  if (FR) {
    return FR->getDecl()->getSourceRange();
  }
  // CXXBaseObjectRegion
  else if (COR) {
    return COR->getDecl()->getSourceRange();
  }
  // VarRegion
  else if (VR) {
    return VR->getDecl()->getSourceRange();
  }
  // Return invalid source range (can be checked by client).
  else {
    return SourceRange{};
  }
}
```
Initially, my idea was to submit the `sourceRange` patch after `getDescriptiveName`. Maybe it would be most convenient, to include the `sourceRange` function into this patch and finally commit all connected patches in one go.


http://reviews.llvm.org/D16044





More information about the cfe-commits mailing list