diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/DeclBase.h | 4 | ||||
| -rw-r--r-- | clang/include/clang/AST/DeclCXX.h | 4 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Frontend/ASTConsumers.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 | 
5 files changed, 10 insertions, 10 deletions
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 5c9fd342fa9..291034e100a 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/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/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index d5ae99c9f01..1dd2bceb43d 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/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/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 82156e9ffa5..a0f0492378f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp index 11c9251ae98..5844be826cf 100644 --- a/clang/lib/Frontend/ASTConsumers.cpp +++ b/clang/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/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 829ea910284..0c5ec60e887 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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  | 

