Added assumption logic for symbolic non-lvalues when used in conditions such as
"if(x)". On the true branch we know the value is != 0, and on the false branch
we know it is 0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46814 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/RValues.cpp b/Analysis/RValues.cpp
index fba59b4..df6db08 100644
--- a/Analysis/RValues.cpp
+++ b/Analysis/RValues.cpp
@@ -34,6 +34,16 @@
return X;
}
+QualType SymbolData::getType() const {
+ switch (getKind()) {
+ default:
+ assert (false && "getType() not implemented for this symbol.");
+
+ case ParmKind:
+ return static_cast<ParmVarDecl*>(getPtr())->getType();
+ }
+}
+
SymbolManager::SymbolManager() {}
SymbolManager::~SymbolManager() {}