forked from OSchip/llvm-project
parent
b0f2ea9e9e
commit
a43942a48e
|
@ -787,7 +787,7 @@ public:
|
|||
|
||||
/// \brief Determine whether this is or was instantiated from an out-of-line
|
||||
/// definition of a static data member.
|
||||
virtual bool isOutOfLine() const;
|
||||
bool isOutOfLine() const;
|
||||
|
||||
/// \brief If this is a static data member, find its out-of-line definition.
|
||||
VarDecl *getOutOfLineDefinition();
|
||||
|
@ -1690,7 +1690,7 @@ public:
|
|||
|
||||
/// \brief Determine whether this is or was instantiated from an out-of-line
|
||||
/// definition of a member function.
|
||||
virtual bool isOutOfLine() const;
|
||||
bool isOutOfLine() const;
|
||||
|
||||
// Implement isa/cast/dyncast/etc.
|
||||
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
|
||||
|
|
|
@ -459,9 +459,10 @@ public:
|
|||
return const_cast<Decl*>(this)->getLexicalDeclContext();
|
||||
}
|
||||
|
||||
virtual bool isOutOfLine() const {
|
||||
return getLexicalDeclContext() != getDeclContext();
|
||||
}
|
||||
/// \brief Determine whether this declaration was written out-of-line, which
|
||||
/// typically indicates that it was written with a qualified name in a scope
|
||||
/// outside of its semantic scope.
|
||||
bool isOutOfLine() const;
|
||||
|
||||
/// setDeclContext - Set both the semantic and lexical DeclContext
|
||||
/// to DC.
|
||||
|
|
|
@ -1159,7 +1159,7 @@ const Expr *VarDecl::getAnyInitializer(const VarDecl *&D) const {
|
|||
}
|
||||
|
||||
bool VarDecl::isOutOfLine() const {
|
||||
if (Decl::isOutOfLine())
|
||||
if (getLexicalDeclContext() != getDeclContext())
|
||||
return true;
|
||||
|
||||
if (!isStaticDataMember())
|
||||
|
@ -1883,7 +1883,7 @@ SourceLocation FunctionDecl::getPointOfInstantiation() const {
|
|||
}
|
||||
|
||||
bool FunctionDecl::isOutOfLine() const {
|
||||
if (Decl::isOutOfLine())
|
||||
if (getLexicalDeclContext() != getDeclContext())
|
||||
return true;
|
||||
|
||||
// If this function was instantiated from a member function of a
|
||||
|
|
|
@ -172,6 +172,15 @@ void PrettyStackTraceDecl::print(llvm::raw_ostream &OS) const {
|
|||
// Out-of-line virtual method providing a home for Decl.
|
||||
Decl::~Decl() { }
|
||||
|
||||
bool Decl::isOutOfLine() const {
|
||||
if (const VarDecl *VD = dyn_cast<VarDecl>(this))
|
||||
return VD->isOutOfLine();
|
||||
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(this))
|
||||
return FD->isOutOfLine();
|
||||
|
||||
return getLexicalDeclContext() != getDeclContext();
|
||||
}
|
||||
|
||||
void Decl::setDeclContext(DeclContext *DC) {
|
||||
if (isOutOfSemaDC())
|
||||
delete getMultipleDC();
|
||||
|
|
Loading…
Reference in New Issue