diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/CIndex/CIndex.cpp | 28 | ||||
-rw-r--r-- | tools/CIndex/CIndex.exports | 1 | ||||
-rw-r--r-- | tools/Makefile | 7 | ||||
-rw-r--r-- | tools/driver/driver.cpp | 4 | ||||
-rwxr-xr-x | tools/scan-build/ccc-analyzer | 13 |
5 files changed, 45 insertions, 8 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 07bb7fb..b52a32e 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -315,6 +315,7 @@ public: bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E); bool VisitExplicitCastExpr(ExplicitCastExpr *E); bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E); + bool VisitObjCMessageExpr(ObjCMessageExpr *E); }; } // end anonymous namespace @@ -532,9 +533,10 @@ bool CursorVisitor::VisitVarDecl(VarDecl *D) { } bool CursorVisitor::VisitObjCMethodDecl(ObjCMethodDecl *ND) { - // FIXME: We really need a TypeLoc covering Objective-C method declarations. - // At the moment, we don't have information about locations in the return - // type. + if (TypeSourceInfo *TSInfo = ND->getResultTypeSourceInfo()) + if (Visit(TSInfo->getTypeLoc())) + return true; + for (ObjCMethodDecl::param_iterator P = ND->param_begin(), PEnd = ND->param_end(); P != PEnd; ++P) { @@ -900,6 +902,14 @@ bool CursorVisitor::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { return VisitExpr(E); } +bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) { + ObjCMessageExpr::ClassInfo CI = E->getClassInfo(); + if (CI.Decl && Visit(MakeCursorObjCClassRef(CI.Decl, CI.Loc, TU))) + return true; + + return VisitExpr(E); +} + bool CursorVisitor::VisitAttributes(Decl *D) { for (const Attr *A = D->getAttrs(); A; A = A->getNext()) if (Visit(MakeCXCursor(A, D, TU))) @@ -1579,6 +1589,18 @@ unsigned clang_isTranslationUnit(enum CXCursorKind K) { return K == CXCursor_TranslationUnit; } +unsigned clang_isUnexposed(enum CXCursorKind K) { + switch (K) { + case CXCursor_UnexposedDecl: + case CXCursor_UnexposedExpr: + case CXCursor_UnexposedStmt: + case CXCursor_UnexposedAttr: + return true; + default: + return false; + } +} + CXCursorKind clang_getCursorKind(CXCursor C) { return C.kind; } diff --git a/tools/CIndex/CIndex.exports b/tools/CIndex/CIndex.exports index e68060b..5b95300 100644 --- a/tools/CIndex/CIndex.exports +++ b/tools/CIndex/CIndex.exports @@ -67,6 +67,7 @@ _clang_isInvalid _clang_isReference _clang_isStatement _clang_isTranslationUnit +_clang_isUnexposed _clang_setUseExternalASTGeneration _clang_tokenize _clang_visitChildren diff --git a/tools/Makefile b/tools/Makefile index ce3e4cd..5a9c674 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -10,4 +10,11 @@ LEVEL := ../../.. DIRS := driver CIndex c-index-test +include $(LEVEL)/Makefile.config + +ifeq ($(OS), $(filter $(OS), Cygwin MingW)) +DIRS := $(filter $(DIRS), CIndex) +DIRS := $(filter $(DIRS), c-index-test) +endif + include $(LEVEL)/Makefile.common diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index fa0f0c2..46f4124 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -194,9 +194,9 @@ int main(int argc, const char **argv) { Diagnostic Diags(&DiagClient); #ifdef CLANG_IS_PRODUCTION - bool IsProduction = true; + const bool IsProduction = true; #else - bool IsProduction = false; + const bool IsProduction = false; #endif Driver TheDriver(Path.getBasename(), Path.getDirname(), llvm::sys::getHostTriple(), diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer index e3db5ea..daf5f7f 100755 --- a/tools/scan-build/ccc-analyzer +++ b/tools/scan-build/ccc-analyzer @@ -380,13 +380,20 @@ my %UniqueOptions = ( '-isysroot' => 0 ); +##----------------------------------------------------------------------------## +# Languages accepted. +##----------------------------------------------------------------------------## + my %LangsAccepted = ( "objective-c" => 1, - "c" => 1, - "c++" => 1, - "objective-c++" => 1 + "c" => 1 ); +if (defined $ENV{'CCC_ANALYZER_CPLUSPLUS'}) { + $LangsAccepted{"c++"} = 1; + $LangsAccepted{"objective-c++"} = 1; +} + ##----------------------------------------------------------------------------## # Main Logic. ##----------------------------------------------------------------------------## |