aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-23 16:58:45 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-23 16:58:45 +0000
commit277b15684582193d26f6c15b40e90a6e45299857 (patch)
treeeaa01275d82e003ea6ee2e9a31158944852853b4 /tools/libclang/IndexingContext.cpp
parent145f7b2093a0050621141acd089e09edf6118a09 (diff)
Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,
without C++-specific features. Use it to set the language to C++ when indexing non-C-like structs. rdar://10732579 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/IndexingContext.cpp')
-rw-r--r--tools/libclang/IndexingContext.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp
index 3d70144db5..a124cbdff5 100644
--- a/tools/libclang/IndexingContext.cpp
+++ b/tools/libclang/IndexingContext.cpp
@@ -814,12 +814,9 @@ void IndexingContext::getEntityInfo(const NamedDecl *D,
EntityInfo.kind = CXIdxEntity_Enum; break;
}
- if (const CXXRecordDecl *CXXRec = dyn_cast<CXXRecordDecl>(D)) {
- // FIXME: isPOD check is not sufficient, a POD can contain methods,
- // we want a isCStructLike check.
- if (CXXRec->hasDefinition() && !CXXRec->isPOD())
+ if (const CXXRecordDecl *CXXRec = dyn_cast<CXXRecordDecl>(D))
+ if (!CXXRec->isCLike())
EntityInfo.lang = CXIdxEntityLang_CXX;
- }
if (isa<ClassTemplatePartialSpecializationDecl>(D)) {
EntityInfo.templateKind = CXIdxEntity_TemplatePartialSpecialization;