]> granicus.if.org Git - clang/commitdiff
Fix line endings.
authorIvan Donchevskii <ivan.donchevskii@qt.io>
Wed, 3 Jan 2018 10:33:21 +0000 (10:33 +0000)
committerIvan Donchevskii <ivan.donchevskii@qt.io>
Wed, 3 Jan 2018 10:33:21 +0000 (10:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321700 91177308-0d34-0410-b5e6-96231b3b80d8

test/Index/annotate-tokens.cpp
test/Index/print-type-size.cpp
tools/c-index-test/c-index-test.c
tools/libclang/CIndex.cpp

index f477b964371c8ad8345e4d2cc47fec039e495b77..67bdf6317aa6c4e0fd6dc07c999208077a00849e 100644 (file)
@@ -34,15 +34,15 @@ void test4() {
 }
 
 class C {
-  ~C();\r
-};\r
-\r
-auto test5(X) -> X;\r
-\r
-// RUN: c-index-test -test-annotate-tokens=%s:1:1:41:1 %s -std=c++14 -fno-delayed-template-parsing | FileCheck %s\r
-// CHECK: Keyword: "struct" [1:1 - 1:7] StructDecl=bonk:1:8 (Definition)\r
-// CHECK: Identifier: "bonk" [1:8 - 1:12] StructDecl=bonk:1:8 (Definition)\r
-// CHECK: Punctuation: "{" [1:13 - 1:14] StructDecl=bonk:1:8 (Definition)\r
+  ~C();
+};
+
+auto test5(X) -> X;
+
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:41:1 %s -std=c++14 -fno-delayed-template-parsing | FileCheck %s
+// CHECK: Keyword: "struct" [1:1 - 1:7] StructDecl=bonk:1:8 (Definition)
+// CHECK: Identifier: "bonk" [1:8 - 1:12] StructDecl=bonk:1:8 (Definition)
+// CHECK: Punctuation: "{" [1:13 - 1:14] StructDecl=bonk:1:8 (Definition)
 // CHECK: Punctuation: "}" [1:15 - 1:16] StructDecl=bonk:1:8 (Definition)
 // CHECK: Punctuation: ";" [1:16 - 1:17]
 // CHECK: Keyword: "void" [2:1 - 2:5] FunctionDecl=test:2:6 (Definition)
@@ -183,20 +183,20 @@ auto test5(X) -> X;
 // CHECK: Punctuation: "(" [29:18 - 29:19] CXXMethod=foo:29:15 (Definition)
 // CHECK: Punctuation: ")" [29:19 - 29:20] CXXMethod=foo:29:15 (Definition)
 // CHECK: Punctuation: "{" [29:21 - 29:22] CompoundStmt=
-// CHECK: Punctuation: "}" [29:22 - 29:23] CompoundStmt=\r
-// CHECK: Punctuation: "~" [37:3 - 37:4] CXXDestructor=~C:37:3\r
-// CHECK: Identifier: "C" [37:4 - 37:5] CXXDestructor=~C:37:3\r
-// CHECK: Keyword: "auto" [40:1 - 40:5] FunctionDecl=test5:40:6\r
-// CHECK: Identifier: "test5" [40:6 - 40:11] FunctionDecl=test5:40:6\r
-// CHECK: Punctuation: "(" [40:11 - 40:12] FunctionDecl=test5:40:6\r
-// CHECK: Identifier: "X" [40:12 - 40:13] TypeRef=struct X:7:8\r
-// CHECK: Punctuation: ")" [40:13 - 40:14] FunctionDecl=test5:40:6\r
-// CHECK: Punctuation: "->" [40:15 - 40:17] FunctionDecl=test5:40:6\r
-// CHECK: Identifier: "X" [40:18 - 40:19] TypeRef=struct X:7:8\r
-// CHECK: Punctuation: ";" [40:19 - 40:20]\r
-\r
-// RUN: env LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-annotate-tokens=%s:32:1:32:13 %s | FileCheck %s -check-prefix=CHECK2\r
-// CHECK2: Keyword: "if" [32:3 - 32:5] IfStmt=\r
+// CHECK: Punctuation: "}" [29:22 - 29:23] CompoundStmt=
+// CHECK: Punctuation: "~" [37:3 - 37:4] CXXDestructor=~C:37:3
+// CHECK: Identifier: "C" [37:4 - 37:5] CXXDestructor=~C:37:3
+// CHECK: Keyword: "auto" [40:1 - 40:5] FunctionDecl=test5:40:6
+// CHECK: Identifier: "test5" [40:6 - 40:11] FunctionDecl=test5:40:6
+// CHECK: Punctuation: "(" [40:11 - 40:12] FunctionDecl=test5:40:6
+// CHECK: Identifier: "X" [40:12 - 40:13] TypeRef=struct X:7:8
+// CHECK: Punctuation: ")" [40:13 - 40:14] FunctionDecl=test5:40:6
+// CHECK: Punctuation: "->" [40:15 - 40:17] FunctionDecl=test5:40:6
+// CHECK: Identifier: "X" [40:18 - 40:19] TypeRef=struct X:7:8
+// CHECK: Punctuation: ";" [40:19 - 40:20]
+
+// RUN: env LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-annotate-tokens=%s:32:1:32:13 %s | FileCheck %s -check-prefix=CHECK2
+// CHECK2: Keyword: "if" [32:3 - 32:5] IfStmt=
 // CHECK2: Punctuation: "(" [32:6 - 32:7] IfStmt=
 // CHECK2: Keyword: "int" [32:7 - 32:10] VarDecl=p:32:11 (Definition)
 // CHECK2: Identifier: "p" [32:11 - 32:12] VarDecl=p:32:11 (Definition)
index 3aa172f99ae07693fbc3bc48bf5b802a9c368366..1ea53462733f89eea94f8785806af976ba03faee 100644 (file)
@@ -1,14 +1,14 @@
 // from SemaCXX/class-layout.cpp
 // RUN: c-index-test -test-print-type-size %s -target x86_64-pc-linux-gnu | FileCheck -check-prefix=CHECK64 %s
 // RUN: c-index-test -test-print-type-size %s -target i386-apple-darwin9 | FileCheck -check-prefix=CHECK32 %s
-\r
-namespace basic {\r
-\r
-// CHECK64: VarDecl=v:[[@LINE+2]]:6 (Definition) (invalid) [type=void] [typekind=Void]\r
-// CHECK32: VarDecl=v:[[@LINE+1]]:6 (Definition) (invalid) [type=void] [typekind=Void]\r
-void v;\r
-\r
-// CHECK64: VarDecl=v1:[[@LINE+2]]:7 (Definition) [type=void *] [typekind=Pointer] [sizeof=8] [alignof=8]\r
+
+namespace basic {
+
+// CHECK64: VarDecl=v:[[@LINE+2]]:6 (Definition) (invalid) [type=void] [typekind=Void]
+// CHECK32: VarDecl=v:[[@LINE+1]]:6 (Definition) (invalid) [type=void] [typekind=Void]
+void v;
+
+// CHECK64: VarDecl=v1:[[@LINE+2]]:7 (Definition) [type=void *] [typekind=Pointer] [sizeof=8] [alignof=8]
 // CHECK32: VarDecl=v1:[[@LINE+1]]:7 (Definition) [type=void *] [typekind=Pointer] [sizeof=4] [alignof=4]
 void *v1;
 
index 7ff814b6d67ac6c696f88826dbcfd2873b593060..c5e345ef6af53217246e84e7c168da5d640c41a6 100644 (file)
@@ -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)");\r
-    if (clang_Cursor_isObjCOptional(Cursor))\r
-      printf(" (@optional)");\r
-    if (clang_isInvalidDeclaration(Cursor))\r
-      printf(" (invalid)");\r
-\r
-    switch (clang_getCursorExceptionSpecificationType(Cursor))\r
-    {\r
+      printf(" (variadic)");
+    if (clang_Cursor_isObjCOptional(Cursor))
+      printf(" (@optional)");
+    if (clang_isInvalidDeclaration(Cursor))
+      printf(" (invalid)");
+
+    switch (clang_getCursorExceptionSpecificationType(Cursor))
+    {
       case CXCursor_ExceptionSpecificationKind_None:
         break;
 
index f73706dee1a95c5bb14021749cc7fe189ef2548e..429fca34744a7141bc661e356321470a5ad57499 100644 (file)
@@ -782,22 +782,22 @@ bool CursorVisitor::VisitDeclaratorDecl(DeclaratorDecl *DD) {
     if (VisitNestedNameSpecifierLoc(QualifierLoc))
       return true;
 
-  return false;\r
-}\r
-\r
-static bool HasTrailingReturnType(FunctionDecl *ND) {\r
-  const QualType Ty = ND->getType();\r
-  if (const FunctionType *AFT = Ty->getAs<FunctionType>()) {\r
-    if (const FunctionProtoType *FT = dyn_cast<FunctionProtoType>(AFT))\r
-      return FT->hasTrailingReturn();\r
-  }\r
-\r
-  return false;\r
-}\r
-\r
-/// \brief Compare two base or member initializers based on their source order.\r
-static int CompareCXXCtorInitializers(CXXCtorInitializer *const *X,\r
-                                      CXXCtorInitializer *const *Y) {\r
+  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.\r
-    TypeLoc TL = TSInfo->getTypeLoc().IgnoreParens();\r
-    FunctionTypeLoc FTL = TL.getAs<FunctionTypeLoc>();\r
-    const bool HasTrailingRT = HasTrailingReturnType(ND);\r
-    \r
-    // If we have a function declared directly (without the use of a typedef),\r
-    // visit just the return type. Otherwise, just visit the function's type\r
-    // now.\r
-    if ((FTL && !isa<CXXConversionDecl>(ND) && !HasTrailingRT &&\r
-         Visit(FTL.getReturnLoc())) ||\r
-        (!FTL && Visit(TL)))\r
-      return true;\r
-\r
-    // Visit the nested-name-specifier, if present.\r
-    if (NestedNameSpecifierLoc QualifierLoc = ND->getQualifierLoc())\r
-      if (VisitNestedNameSpecifierLoc(QualifierLoc))\r
+    // 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.\r
-    if (FTL && VisitFunctionTypeLoc(FTL, true))\r
-      return true;\r
-\r
-    // Visit the function's trailing return type.\r
-    if (FTL && HasTrailingRT && Visit(FTL.getReturnLoc()))\r
-      return true;\r
-\r
-    // FIXME: Attributes?\r
-  }\r
-  \r
+    // 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);\r
-}\r
-\r
-unsigned clang_isInvalidDeclaration(CXCursor C) {\r
-  if (clang_isDeclaration(C.kind)) {\r
-    if (const Decl *D = getCursorDecl(C))\r
-      return D->isInvalidDecl();\r
-  }\r
-\r
-  return 0;\r
-}\r
-\r
-unsigned clang_isReference(enum CXCursorKind K) {\r
-  return K >= CXCursor_FirstRef && K <= CXCursor_LastRef;\r
-}\r
+         (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;