Merge pull request #1343 from rdmarsh2/rdmarsh/cpp/getUnspecifiedType

C++: add getUnspecifiedType() for exprs and decls
This commit is contained in:
Jonas Jensen
2019-05-28 20:10:28 +01:00
committed by GitHub
67 changed files with 218 additions and 189 deletions

View File

@@ -1,4 +1,4 @@
import cpp
from Variable v
select v, v.getType().getUnspecifiedType()
select v, v.getUnspecifiedType()

View File

@@ -7,5 +7,5 @@ import cpp
from ArrayAggregateLiteral aal, int childIndex, int elementIndex
where aal.getElementExpr(elementIndex) = aal.getChild(childIndex)
select aal, aal.getType().getUnspecifiedType(), childIndex,
select aal, aal.getUnspecifiedType(), childIndex,
aal.getChild(childIndex), elementIndex

View File

@@ -7,4 +7,4 @@ import cpp
from ClassAggregateLiteral cal, int i, Field f
where cal.getFieldExpr(f) = cal.getChild(i)
select cal, cal.getType().getUnspecifiedType(), i, cal.getChild(i), f
select cal, cal.getUnspecifiedType(), i, cal.getChild(i), f

View File

@@ -6,7 +6,7 @@ import cpp
from AnalysedString s, string str
where
if s.(StringLiteral).getType().getUnspecifiedType().(DerivedType).getBaseType() instanceof Wchar_t then (
if s.(StringLiteral).getUnspecifiedType().(DerivedType).getBaseType() instanceof Wchar_t then (
str = "[?]"
) else (
str = s.toString()

View File

@@ -3,5 +3,5 @@ import cpp
from Variable v
select v,
v.getType().explain(),
v.getType().getUnspecifiedType().explain()
v.getUnspecifiedType().explain()

View File

@@ -7,8 +7,8 @@ import cpp
from ArrayExpr arrayExpr
select
arrayExpr,
arrayExpr.getArrayBase().getType().getUnspecifiedType().toString() +
arrayExpr.getArrayBase().getUnspecifiedType().toString() +
", " +
arrayExpr.getArrayBase().getFullyConverted().getType().getUnspecifiedType().toString() +
arrayExpr.getArrayBase().getFullyConverted().getUnspecifiedType().toString() +
", " +
arrayExpr.getType().getUnspecifiedType().toString()
arrayExpr.getUnspecifiedType().toString()