Alexander_Droste added a comment.
================ Comment at: tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp:662 @@ +661,3 @@ + else if (auto SV = + ER->getIndex().getAs<clang::ento::nonloc::SymbolVal>()) { + llvm::SmallString<8> buf; ---------------- Alexander_Droste wrote: > xazax.hun wrote: > > These are the only cases that can occur? So it is not possible to have a > > loc index? Maybe we could get the value for loc and nonloc ConcreteInts and > > use getVariableName for everzthing else? Would that wok? > `getIndex()` returns a `nonloc` and `loc` is in no subclass relation to > `nonloc`. > Therefore, `getIndex()` cannot be a `loc` type. > > There are actually 5 `nonloc` subclasses but I assumed > that it only makes sense to check for `SymbolVal` and > `ConcreteInt`. > http://clang.llvm.org/doxygen/classclang_1_1ento_1_1NonLoc.html > > So would you suggest to only check for `ConcreteInt` > and call `getVariableName()` recursively if it isn't one? If we want to call `getVariableName` recursively, should we strip the single quotes then? Else we would get something like `'x['a']['b']'`. What do you think? http://reviews.llvm.org/D16044 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits