summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-01-03 10:33:21 +0000
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-01-03 10:33:21 +0000
commitcffa682f10cbaebd37cd6999c4374444a669b27d (patch)
treee1aeb55cdb71a8a8e9d1a60559ad47d1505ba15b /tools
parent5e3fa81ba51e6c674cf00eb1116314255d8ba83f (diff)
Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/c-index-test/c-index-test.c16
-rw-r--r--tools/libclang/CIndex.cpp116
2 files changed, 66 insertions, 66 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 7ff814b6d6..c5e345ef6a 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -809,14 +809,14 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
if (clang_EnumDecl_isScoped(Cursor))
printf(" (scoped)");
if (clang_Cursor_isVariadic(Cursor))
- printf(" (variadic)");
- if (clang_Cursor_isObjCOptional(Cursor))
- printf(" (@optional)");
- if (clang_isInvalidDeclaration(Cursor))
- printf(" (invalid)");
-
- switch (clang_getCursorExceptionSpecificationType(Cursor))
- {
+ printf(" (variadic)");
+ if (clang_Cursor_isObjCOptional(Cursor))
+ printf(" (@optional)");
+ if (clang_isInvalidDeclaration(Cursor))
+ printf(" (invalid)");
+
+ switch (clang_getCursorExceptionSpecificationType(Cursor))
+ {
case CXCursor_ExceptionSpecificationKind_None:
break;
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index f73706dee1..429fca3474 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -782,22 +782,22 @@ bool CursorVisitor::VisitDeclaratorDecl(DeclaratorDecl *DD) {
if (VisitNestedNameSpecifierLoc(QualifierLoc))
return true;
- return false;
-}
-
-static bool HasTrailingReturnType(FunctionDecl *ND) {
- const QualType Ty = ND->getType();
- if (const FunctionType *AFT = Ty->getAs<FunctionType>()) {
- if (const FunctionProtoType *FT = dyn_cast<FunctionProtoType>(AFT))
- return FT->hasTrailingReturn();
- }
-
- return false;
-}
-
-/// \brief Compare two base or member initializers based on their source order.
-static int CompareCXXCtorInitializers(CXXCtorInitializer *const *X,
- CXXCtorInitializer *const *Y) {
+ return false;
+}
+
+static bool HasTrailingReturnType(FunctionDecl *ND) {
+ const QualType Ty = ND->getType();
+ if (const FunctionType *AFT = Ty->getAs<FunctionType>()) {
+ if (const FunctionProtoType *FT = dyn_cast<FunctionProtoType>(AFT))
+ return FT->hasTrailingReturn();
+ }
+
+ return false;
+}
+
+/// \brief Compare two base or member initializers based on their source order.
+static int CompareCXXCtorInitializers(CXXCtorInitializer *const *X,
+ CXXCtorInitializer *const *Y) {
return (*X)->getSourceOrder() - (*Y)->getSourceOrder();
}
@@ -811,22 +811,22 @@ bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) {
if (TypeSourceInfo *TSInfo = ND->getTypeSourceInfo()) {
// Visit the function declaration's syntactic components in the order
- // written. This requires a bit of work.
- TypeLoc TL = TSInfo->getTypeLoc().IgnoreParens();
- FunctionTypeLoc FTL = TL.getAs<FunctionTypeLoc>();
- const bool HasTrailingRT = HasTrailingReturnType(ND);
-
- // If we have a function declared directly (without the use of a typedef),
- // visit just the return type. Otherwise, just visit the function's type
- // now.
- if ((FTL && !isa<CXXConversionDecl>(ND) && !HasTrailingRT &&
- Visit(FTL.getReturnLoc())) ||
- (!FTL && Visit(TL)))
- return true;
-
- // Visit the nested-name-specifier, if present.
- if (NestedNameSpecifierLoc QualifierLoc = ND->getQualifierLoc())
- if (VisitNestedNameSpecifierLoc(QualifierLoc))
+ // written. This requires a bit of work.
+ TypeLoc TL = TSInfo->getTypeLoc().IgnoreParens();
+ FunctionTypeLoc FTL = TL.getAs<FunctionTypeLoc>();
+ const bool HasTrailingRT = HasTrailingReturnType(ND);
+
+ // If we have a function declared directly (without the use of a typedef),
+ // visit just the return type. Otherwise, just visit the function's type
+ // now.
+ if ((FTL && !isa<CXXConversionDecl>(ND) && !HasTrailingRT &&
+ Visit(FTL.getReturnLoc())) ||
+ (!FTL && Visit(TL)))
+ return true;
+
+ // Visit the nested-name-specifier, if present.
+ if (NestedNameSpecifierLoc QualifierLoc = ND->getQualifierLoc())
+ if (VisitNestedNameSpecifierLoc(QualifierLoc))
return true;
// Visit the declaration name.
@@ -836,17 +836,17 @@ bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) {
// FIXME: Visit explicitly-specified template arguments!
- // Visit the function parameters, if we have a function type.
- if (FTL && VisitFunctionTypeLoc(FTL, true))
- return true;
-
- // Visit the function's trailing return type.
- if (FTL && HasTrailingRT && Visit(FTL.getReturnLoc()))
- return true;
-
- // FIXME: Attributes?
- }
-
+ // Visit the function parameters, if we have a function type.
+ if (FTL && VisitFunctionTypeLoc(FTL, true))
+ return true;
+
+ // Visit the function's trailing return type.
+ if (FTL && HasTrailingRT && Visit(FTL.getReturnLoc()))
+ return true;
+
+ // FIXME: Attributes?
+ }
+
if (ND->doesThisDeclarationHaveABody() && !ND->isLateTemplateParsed()) {
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(ND)) {
// Find the initializers that were written in the source.
@@ -5434,21 +5434,21 @@ unsigned clang_isInvalid(enum CXCursorKind K) {
unsigned clang_isDeclaration(enum CXCursorKind K) {
return (K >= CXCursor_FirstDecl && K <= CXCursor_LastDecl) ||
- (K >= CXCursor_FirstExtraDecl && K <= CXCursor_LastExtraDecl);
-}
-
-unsigned clang_isInvalidDeclaration(CXCursor C) {
- if (clang_isDeclaration(C.kind)) {
- if (const Decl *D = getCursorDecl(C))
- return D->isInvalidDecl();
- }
-
- return 0;
-}
-
-unsigned clang_isReference(enum CXCursorKind K) {
- return K >= CXCursor_FirstRef && K <= CXCursor_LastRef;
-}
+ (K >= CXCursor_FirstExtraDecl && K <= CXCursor_LastExtraDecl);
+}
+
+unsigned clang_isInvalidDeclaration(CXCursor C) {
+ if (clang_isDeclaration(C.kind)) {
+ if (const Decl *D = getCursorDecl(C))
+ return D->isInvalidDecl();
+ }
+
+ return 0;
+}
+
+unsigned clang_isReference(enum CXCursorKind K) {
+ return K >= CXCursor_FirstRef && K <= CXCursor_LastRef;
+}
unsigned clang_isExpression(enum CXCursorKind K) {
return K >= CXCursor_FirstExpr && K <= CXCursor_LastExpr;