Fix line endings.
authorNikola Smiljanic <popizdeh@gmail.com>
Wed, 28 May 2014 11:19:43 +0000 (11:19 +0000)
committerNikola Smiljanic <popizdeh@gmail.com>
Wed, 28 May 2014 11:19:43 +0000 (11:19 +0000)
llvm-svn: 209727

clang/include/clang/AST/DeclCXX.h
clang/lib/Analysis/ThreadSafetyLogical.cpp
clang/lib/Parse/ParseDeclCXX.cpp

index 01af64a..56bbbb1 100644 (file)
@@ -2767,9 +2767,9 @@ public:
   static UsingShadowDecl *CreateDeserialized(ASTContext &C, unsigned ID);
 
   typedef redeclarable_base::redecl_range redecl_range;
-  typedef redeclarable_base::redecl_iterator redecl_iterator;\r
-  using redeclarable_base::redecls_begin;\r
-  using redeclarable_base::redecls_end;\r
+  typedef redeclarable_base::redecl_iterator redecl_iterator;
+  using redeclarable_base::redecls_begin;
+  using redeclarable_base::redecls_end;
   using redeclarable_base::redecls;
   using redeclarable_base::getPreviousDecl;
   using redeclarable_base::getMostRecentDecl;
index 51a8077..facfa11 100644 (file)
-//===- ThreadSafetyLogical.cpp ---------------------------------*- C++ --*-===//\r
-//\r
-//                     The LLVM Compiler Infrastructure\r
-//\r
-// This file is distributed under the University of Illinois Open Source\r
-// License. See LICENSE.TXT for details.\r
-//\r
-//===----------------------------------------------------------------------===//\r
-// This file defines a representation for logical expressions with SExpr leaves\r
-// that are used as part of fact-checking capability expressions.\r
-//===----------------------------------------------------------------------===//\r
-\r
-#include "clang/Analysis/Analyses/ThreadSafetyLogical.h"\r
-\r
-using namespace llvm;\r
-using namespace clang::threadSafety::lexpr;\r
-\r
-// Implication.  We implement De Morgan's Laws by maintaining LNeg and RNeg\r
-// to keep track of whether LHS and RHS are negated.\r
-static bool implies(const LExpr *LHS, bool LNeg, const LExpr *RHS, bool RNeg) {\r
-  // In comments below, we write => for implication.\r
-\r
-  // Calculates the logical AND implication operator.\r
-  const auto LeftAndOperator = [=](const BinOp *A) {\r
-    return implies(A->left(), LNeg, RHS, RNeg) &&\r
-           implies(A->right(), LNeg, RHS, RNeg);\r
-  };\r
-  const auto RightAndOperator = [=](const BinOp *A) {\r
-    return implies(LHS, LNeg, A->left(), RNeg) &&\r
-           implies(LHS, LNeg, A->right(), RNeg);\r
-  };\r
-\r
-  // Calculates the logical OR implication operator.\r
-  const auto LeftOrOperator = [=](const BinOp *A) {\r
-    return implies(A->left(), LNeg, RHS, RNeg) ||\r
-           implies(A->right(), LNeg, RHS, RNeg);\r
-  };\r
-  const auto RightOrOperator = [=](const BinOp *A) {\r
-    return implies(LHS, LNeg, A->left(), RNeg) ||\r
-           implies(LHS, LNeg, A->right(), RNeg);\r
-  };\r
-\r
-  // Recurse on right.\r
-  switch (RHS->kind()) {\r
-  case LExpr::And:\r
-    // When performing right recursion:\r
-    //   C => A & B  [if]  C => A and C => B\r
-    // When performing right recursion (negated):\r
-    //   C => !(A & B)  [if]  C => !A | !B  [===]  C => !A or C => !B\r
-    return RNeg ? RightOrOperator(cast<And>(RHS))\r
-                : RightAndOperator(cast<And>(RHS));\r
-  case LExpr::Or:\r
-    // When performing right recursion:\r
-    //   C => (A | B)  [if]  C => A or C => B\r
-    // When performing right recursion (negated):\r
-    //   C => !(A | B)  [if]  C => !A & !B  [===]  C => !A and C => !B\r
-    return RNeg ? RightAndOperator(cast<Or>(RHS))\r
-                : RightOrOperator(cast<Or>(RHS));\r
-  case LExpr::Not:\r
-    // Note that C => !A is very different from !(C => A). It would be incorrect\r
-    // to return !implies(LHS, RHS).\r
-    return implies(LHS, LNeg, cast<Not>(RHS)->exp(), !RNeg);\r
-  case LExpr::Terminal:\r
-    // After reaching the terminal, it's time to recurse on the left.\r
-    break;\r
-  }\r
-\r
-  // RHS is now a terminal.  Recurse on Left.\r
-  switch (LHS->kind()) {\r
-  case LExpr::And:\r
-    // When performing left recursion:\r
-    //   A & B => C  [if]  A => C or B => C\r
-    // When performing left recursion (negated):\r
-    //   !(A & B) => C  [if]  !A | !B => C  [===]  !A => C and !B => C\r
-    return LNeg ? LeftAndOperator(cast<And>(LHS))\r
-                : LeftOrOperator(cast<And>(LHS));\r
-  case LExpr::Or:\r
-    // When performing left recursion:\r
-    //   A | B => C  [if]  A => C and B => C\r
-    // When performing left recursion (negated):\r
-    //   !(A | B) => C  [if]  !A & !B => C  [===]  !A => C or !B => C\r
-    return LNeg ? LeftOrOperator(cast<Or>(LHS))\r
-                : LeftAndOperator(cast<Or>(LHS));\r
-  case LExpr::Not:\r
-    // Note that A => !C is very different from !(A => C). It would be incorrect\r
-    // to return !implies(LHS, RHS).\r
-    return implies(cast<Not>(LHS)->exp(), !LNeg, RHS, RNeg);\r
-  case LExpr::Terminal:\r
-    // After reaching the terminal, it's time to perform identity comparisons.\r
-    break;\r
-  }\r
-\r
-  // A => A\r
-  // !A => !A\r
-  if (LNeg != RNeg)\r
-    return false;\r
-\r
-  // FIXME -- this should compare SExprs for equality, not pointer equality.\r
-  return cast<Terminal>(LHS)->expr() == cast<Terminal>(RHS)->expr();\r
-}\r
-\r
-namespace clang {\r
-namespace threadSafety {\r
-namespace lexpr {\r
-\r
-bool implies(const LExpr *LHS, const LExpr *RHS) {\r
-  // Start out by assuming that LHS and RHS are not negated.\r
-  return ::implies(LHS, false, RHS, false);\r
-}\r
-}\r
-}\r
-}\r
+//===- ThreadSafetyLogical.cpp ---------------------------------*- C++ --*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// This file defines a representation for logical expressions with SExpr leaves
+// that are used as part of fact-checking capability expressions.
+//===----------------------------------------------------------------------===//
+
+#include "clang/Analysis/Analyses/ThreadSafetyLogical.h"
+
+using namespace llvm;
+using namespace clang::threadSafety::lexpr;
+
+// Implication.  We implement De Morgan's Laws by maintaining LNeg and RNeg
+// to keep track of whether LHS and RHS are negated.
+static bool implies(const LExpr *LHS, bool LNeg, const LExpr *RHS, bool RNeg) {
+  // In comments below, we write => for implication.
+
+  // Calculates the logical AND implication operator.
+  const auto LeftAndOperator = [=](const BinOp *A) {
+    return implies(A->left(), LNeg, RHS, RNeg) &&
+           implies(A->right(), LNeg, RHS, RNeg);
+  };
+  const auto RightAndOperator = [=](const BinOp *A) {
+    return implies(LHS, LNeg, A->left(), RNeg) &&
+           implies(LHS, LNeg, A->right(), RNeg);
+  };
+
+  // Calculates the logical OR implication operator.
+  const auto LeftOrOperator = [=](const BinOp *A) {
+    return implies(A->left(), LNeg, RHS, RNeg) ||
+           implies(A->right(), LNeg, RHS, RNeg);
+  };
+  const auto RightOrOperator = [=](const BinOp *A) {
+    return implies(LHS, LNeg, A->left(), RNeg) ||
+           implies(LHS, LNeg, A->right(), RNeg);
+  };
+
+  // Recurse on right.
+  switch (RHS->kind()) {
+  case LExpr::And:
+    // When performing right recursion:
+    //   C => A & B  [if]  C => A and C => B
+    // When performing right recursion (negated):
+    //   C => !(A & B)  [if]  C => !A | !B  [===]  C => !A or C => !B
+    return RNeg ? RightOrOperator(cast<And>(RHS))
+                : RightAndOperator(cast<And>(RHS));
+  case LExpr::Or:
+    // When performing right recursion:
+    //   C => (A | B)  [if]  C => A or C => B
+    // When performing right recursion (negated):
+    //   C => !(A | B)  [if]  C => !A & !B  [===]  C => !A and C => !B
+    return RNeg ? RightAndOperator(cast<Or>(RHS))
+                : RightOrOperator(cast<Or>(RHS));
+  case LExpr::Not:
+    // Note that C => !A is very different from !(C => A). It would be incorrect
+    // to return !implies(LHS, RHS).
+    return implies(LHS, LNeg, cast<Not>(RHS)->exp(), !RNeg);
+  case LExpr::Terminal:
+    // After reaching the terminal, it's time to recurse on the left.
+    break;
+  }
+
+  // RHS is now a terminal.  Recurse on Left.
+  switch (LHS->kind()) {
+  case LExpr::And:
+    // When performing left recursion:
+    //   A & B => C  [if]  A => C or B => C
+    // When performing left recursion (negated):
+    //   !(A & B) => C  [if]  !A | !B => C  [===]  !A => C and !B => C
+    return LNeg ? LeftAndOperator(cast<And>(LHS))
+                : LeftOrOperator(cast<And>(LHS));
+  case LExpr::Or:
+    // When performing left recursion:
+    //   A | B => C  [if]  A => C and B => C
+    // When performing left recursion (negated):
+    //   !(A | B) => C  [if]  !A & !B => C  [===]  !A => C or !B => C
+    return LNeg ? LeftOrOperator(cast<Or>(LHS))
+                : LeftAndOperator(cast<Or>(LHS));
+  case LExpr::Not:
+    // Note that A => !C is very different from !(A => C). It would be incorrect
+    // to return !implies(LHS, RHS).
+    return implies(cast<Not>(LHS)->exp(), !LNeg, RHS, RNeg);
+  case LExpr::Terminal:
+    // After reaching the terminal, it's time to perform identity comparisons.
+    break;
+  }
+
+  // A => A
+  // !A => !A
+  if (LNeg != RNeg)
+    return false;
+
+  // FIXME -- this should compare SExprs for equality, not pointer equality.
+  return cast<Terminal>(LHS)->expr() == cast<Terminal>(RHS)->expr();
+}
+
+namespace clang {
+namespace threadSafety {
+namespace lexpr {
+
+bool implies(const LExpr *LHS, const LExpr *RHS) {
+  // Start out by assuming that LHS and RHS are not negated.
+  return ::implies(LHS, false, RHS, false);
+}
+}
+}
+}
index ddecd75..91ca58d 100644 (file)
@@ -3251,15 +3251,15 @@ bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
       // parsing an argument list, we need to determine whether this attribute
       // was allowed to have an argument list (such as [[deprecated]]), and how
       // many arguments were parsed (so we can diagnose on [[deprecated()]]).
-      if (Attr->getMaxArgs() && !NumArgs) {\r
-        // The attribute was allowed to have arguments, but none were provided\r
-        // even though the attribute parsed successfully. This is an error.\r
-        // FIXME: This is a good place for a fixit which removes the parens.\r
-        Diag(LParenLoc, diag::err_attribute_requires_arguments) << AttrName;\r
-        return false;\r
-      } else if (!Attr->getMaxArgs()) {\r
-        // The attribute parsed successfully, but was not allowed to have any\r
-        // arguments. It doesn't matter whether any were provided -- the\r
+      if (Attr->getMaxArgs() && !NumArgs) {
+        // The attribute was allowed to have arguments, but none were provided
+        // even though the attribute parsed successfully. This is an error.
+        // FIXME: This is a good place for a fixit which removes the parens.
+        Diag(LParenLoc, diag::err_attribute_requires_arguments) << AttrName;
+        return false;
+      } else if (!Attr->getMaxArgs()) {
+        // The attribute parsed successfully, but was not allowed to have any
+        // arguments. It doesn't matter whether any were provided -- the
         // presence of the argument list (even if empty) is diagnosed.
         Diag(LParenLoc, diag::err_cxx11_attribute_forbids_arguments)
             << AttrName;