summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/MemRegion.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-06-06 18:29:43 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-06-06 18:29:43 +0000
commit917a42d8b5d1be30e3602ff19bfc394327a6a756 (patch)
tree35896c3038bee9a62feee3bb5b4c2dffa38d21d9 /clang/lib/StaticAnalyzer/Core/MemRegion.cpp
parent217cf69b92c403a23e337bbd754de1e1c0244a3b (diff)
downloadbcm5719-llvm-917a42d8b5d1be30e3602ff19bfc394327a6a756.tar.gz
bcm5719-llvm-917a42d8b5d1be30e3602ff19bfc394327a6a756.zip
Revert "Reapply "[analyzer] Add checker for correct usage of MPI API in C and C++.""
This reverts commit r271914. It is still breaking bots. llvm-svn: 271920
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/MemRegion.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/MemRegion.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp
index b7b6f42b291..083f6c01bc2 100644
--- a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp
+++ b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -632,65 +632,6 @@ void CXXBaseObjectRegion::printPrettyAsExpr(raw_ostream &os) const {
superRegion->printPrettyAsExpr(os);
}
-std::string MemRegion::getDescriptiveName(bool UseQuotes) const {
- std::string VariableName;
- std::string ArrayIndices;
- const MemRegion *R = this;
- SmallString<50> buf;
- llvm::raw_svector_ostream os(buf);
-
- // Obtain array indices to add them to the variable name.
- const ElementRegion *ER = nullptr;
- while ((ER = R->getAs<ElementRegion>())) {
- // Index is a ConcreteInt.
- if (auto CI = ER->getIndex().getAs<nonloc::ConcreteInt>()) {
- llvm::SmallString<2> Idx;
- CI->getValue().toString(Idx);
- ArrayIndices = (llvm::Twine("[") + Idx.str() + "]" + ArrayIndices).str();
- }
- // If not a ConcreteInt, try to obtain the variable
- // name by calling 'getDescriptiveName' recursively.
- else {
- std::string Idx = ER->getDescriptiveName(false);
- if (!Idx.empty()) {
- ArrayIndices = (llvm::Twine("[") + Idx + "]" + ArrayIndices).str();
- }
- }
- R = ER->getSuperRegion();
- }
-
- // Get variable name.
- if (R && R->canPrintPrettyAsExpr()) {
- R->printPrettyAsExpr(os);
- if (UseQuotes) {
- return (llvm::Twine("'") + os.str() + ArrayIndices + "'").str();
- } else {
- return (llvm::Twine(os.str()) + ArrayIndices).str();
- }
- }
-
- return VariableName;
-}
-
-SourceRange MemRegion::sourceRange() const {
- const VarRegion *const VR = dyn_cast<VarRegion>(this->getBaseRegion());
- const FieldRegion *const FR = dyn_cast<FieldRegion>(this);
-
- // Check for more specific regions first.
- // FieldRegion
- if (FR) {
- return FR->getDecl()->getSourceRange();
- }
- // VarRegion
- else if (VR) {
- return VR->getDecl()->getSourceRange();
- }
- // Return invalid source range (can be checked by client).
- else {
- return SourceRange{};
- }
-}
-
//===----------------------------------------------------------------------===//
// MemRegionManager methods.
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud