Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

llvm-svn: 73651
This commit is contained in:
Argyrios Kyrtzidis 2009-06-17 22:49:50 +00:00
parent b1743254e7
commit c4b766bc65
5 changed files with 10 additions and 10 deletions

View File

@ -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.

View File

@ -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());

View File

@ -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;

View File

@ -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) ";

View File

@ -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