diff options
-rw-r--r-- | include/clang/AST/DeclBase.h | 4 | ||||
-rw-r--r-- | include/clang/AST/DeclCXX.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/ASTConsumers.cpp | 8 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 5c9fd342fa..291034e100 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -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. diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index d5ae99c9f0..1dd2bceb43 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -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()); diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 82156e9ffa..a0f0492378 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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; diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 11c9251ae9..5844be826c 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -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) "; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 829ea91028..0c5ec60e88 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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 |