forked from OSchip/llvm-project
Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.
llvm-svn: 73651
This commit is contained in:
parent
b1743254e7
commit
c4b766bc65
|
@ -268,6 +268,10 @@ public:
|
|||
const DeclContext *getLexicalDeclContext() const {
|
||||
return const_cast<Decl*>(this)->getLexicalDeclContext();
|
||||
}
|
||||
|
||||
bool isOutOfLine() const {
|
||||
return getLexicalDeclContext() != getDeclContext();
|
||||
}
|
||||
|
||||
/// setDeclContext - Set both the semantic and lexical DeclContext
|
||||
/// to DC.
|
||||
|
|
|
@ -477,10 +477,6 @@ public:
|
|||
bool isStatic() const { return getStorageClass() == Static; }
|
||||
bool isInstance() const { return !isStatic(); }
|
||||
|
||||
bool isOutOfLineDefinition() const {
|
||||
return getLexicalDeclContext() != getDeclContext();
|
||||
}
|
||||
|
||||
bool isVirtual() const {
|
||||
return isVirtualAsWritten() ||
|
||||
(begin_overridden_methods() != end_overridden_methods());
|
||||
|
|
|
@ -244,7 +244,7 @@ static CodeGenModule::GVALinkage
|
|||
GetLinkageForFunction(const FunctionDecl *FD, const LangOptions &Features) {
|
||||
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
|
||||
// C++ member functions defined inside the class are always inline.
|
||||
if (MD->isInline() || !MD->isOutOfLineDefinition())
|
||||
if (MD->isInline() || !MD->isOutOfLine())
|
||||
return CodeGenModule::GVA_CXXInline;
|
||||
|
||||
return CodeGenModule::GVA_StrongExternal;
|
||||
|
|
|
@ -243,7 +243,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
|
|||
}
|
||||
case Decl::CXXMethod: {
|
||||
const CXXMethodDecl* D = cast<CXXMethodDecl>(DC);
|
||||
if (D->isOutOfLineDefinition())
|
||||
if (D->isOutOfLine())
|
||||
Out << "[c++ method] ";
|
||||
else if (D->isImplicit())
|
||||
Out << "(c++ method) ";
|
||||
|
@ -273,7 +273,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
|
|||
}
|
||||
case Decl::CXXConstructor: {
|
||||
const CXXConstructorDecl* D = cast<CXXConstructorDecl>(DC);
|
||||
if (D->isOutOfLineDefinition())
|
||||
if (D->isOutOfLine())
|
||||
Out << "[c++ ctor] ";
|
||||
else if (D->isImplicit())
|
||||
Out << "(c++ ctor) ";
|
||||
|
@ -302,7 +302,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
|
|||
}
|
||||
case Decl::CXXDestructor: {
|
||||
const CXXDestructorDecl* D = cast<CXXDestructorDecl>(DC);
|
||||
if (D->isOutOfLineDefinition())
|
||||
if (D->isOutOfLine())
|
||||
Out << "[c++ dtor] ";
|
||||
else if (D->isImplicit())
|
||||
Out << "(c++ dtor) ";
|
||||
|
@ -318,7 +318,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
|
|||
}
|
||||
case Decl::CXXConversion: {
|
||||
const CXXConversionDecl* D = cast<CXXConversionDecl>(DC);
|
||||
if (D->isOutOfLineDefinition())
|
||||
if (D->isOutOfLine())
|
||||
Out << "[c++ conversion] ";
|
||||
else if (D->isImplicit())
|
||||
Out << "(c++ conversion) ";
|
||||
|
|
|
@ -183,7 +183,7 @@ DeclSpec::TST Sema::isTagName(IdentifierInfo &II, Scope *S) {
|
|||
DeclContext *Sema::getContainingDC(DeclContext *DC) {
|
||||
if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DC)) {
|
||||
// A C++ out-of-line method will return to the file declaration context.
|
||||
if (MD->isOutOfLineDefinition())
|
||||
if (MD->isOutOfLine())
|
||||
return MD->getLexicalDeclContext();
|
||||
|
||||
// A C++ inline method is parsed *after* the topmost class it was declared
|
||||
|
|
Loading…
Reference in New Issue