зеркало из https://github.com/microsoft/clang-1.git
Implemented "getType()" for symbolic values representing the "contents" of
another symbolic value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
145cd89f92
Коммит
a888c98b42
|
@ -38,7 +38,7 @@ SymbolID SymbolManager::getContentsOfSymbol(SymbolID sym) {
|
|||
return X;
|
||||
}
|
||||
|
||||
QualType SymbolData::getType() const {
|
||||
QualType SymbolData::getType(const SymbolManager& SymMgr) const {
|
||||
switch (getKind()) {
|
||||
default:
|
||||
assert (false && "getType() not implemented for this symbol.");
|
||||
|
@ -46,6 +46,11 @@ QualType SymbolData::getType() const {
|
|||
case ParmKind:
|
||||
return cast<SymbolDataParmVar>(this)->getDecl()->getType();
|
||||
|
||||
case ContentsOfKind: {
|
||||
SymbolID x = cast<SymbolDataContentsOf>(this)->getSymbol();
|
||||
QualType T = SymMgr.getSymbolData(x).getType(SymMgr);
|
||||
return T->getAsPointerType()->getPointeeType();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
namespace clang {
|
||||
|
||||
class SymbolManager;
|
||||
|
||||
class SymbolID {
|
||||
unsigned Data;
|
||||
public:
|
||||
|
@ -76,7 +78,7 @@ public:
|
|||
return K == R.K && Data == R.Data;
|
||||
}
|
||||
|
||||
QualType getType() const;
|
||||
QualType getType(const SymbolManager& SymMgr) const;
|
||||
|
||||
// Implement isa<T> support.
|
||||
static inline bool classof(const SymbolData*) { return true; }
|
||||
|
@ -164,7 +166,7 @@ public:
|
|||
}
|
||||
|
||||
inline QualType getType(SymbolID ID) const {
|
||||
return getSymbolData(ID).getType();
|
||||
return getSymbolData(ID).getType(*this);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче