Re: Clang/LLVM revision 169451

From: Sam Fourman Jr. <sfourman_at_gmail.com>
Date: Mon, 17 Dec 2012 07:40:52 -0500
On Mon, Dec 17, 2012 at 6:50 AM, Dimitry Andric <dim_at_freebsd.org> wrote:
> On 2012-12-17 09:36, Sam Fourman Jr. wrote:
>>>
>>> No, there is no one-click merge script, it needs humanoid help, I'm
>>> afraid. :-)  Is there any reason you cannot just install the port, or
>>> if that is too outdated, just checkout from llvm.org directly and build
>>> it?
>>
>>
>> is it currently possible to build FreeBSD world, without clang and
>> then build clang from ports?
>
>
> There is no real need, as you can just put /usr/local/bin before
> /usr/bin in your PATH, but if you really want to do so, you can put the
> following in /etc/src.conf:
>
> CC=gcc
> CXX=g++
> CPP=gcpp
> WITHOUT_CLANG=
>
> From then on, you build world with gcc, which will also be installed as
> /usr/bin/cc again.


I ended up generating and applying this patch, and rebuilt world again

root_at_www:/root # cat clang-169451.patch

Index: contrib/llvm/tools/clang/include/clang/Sema/Scope.h
===================================================================
--- contrib/llvm/tools/clang/include/clang/Sema/Scope.h (revision 244350)
+++ contrib/llvm/tools/clang/include/clang/Sema/Scope.h (working copy)
_at__at_ -84,11 +84,18 _at__at_
     /// TryScope - This is the scope of a C++ try statement.
     TryScope = 0x1000,

+    /// CatchScope - This is the scope of a C++ catch statement.
+    CatchScope = 0x2000,
+
+    /// FnTryCatchScope - This is the scope for a function-level C++ try or
+    /// catch scope.
+    FnTryCatchScope = 0x4000,
+
     /// FnTryScope - This is the scope of a function-level C++ try scope.
-    FnTryScope = 0x3000,
+    FnTryScope = TryScope | FnTryCatchScope,

     /// FnCatchScope - This is the scope of a function-level C++ catch scope.
-    FnCatchScope = 0x4000
+    FnCatchScope = CatchScope | FnTryCatchScope
   };
 private:
   /// The parent scope for this scope.  This is null for the translation-unit
Index: contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp
===================================================================
--- contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp    (revision 244350)
+++ contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp    (working copy)
_at__at_ -2197,7 +2197,7 _at__at_
   // The name in a catch exception-declaration is local to the handler and
   // shall not be redeclared in the outermost block of the handler.
   ParseScope CatchScope(this, Scope::DeclScope | Scope::ControlScope |
-                          (FnCatch ? Scope::FnCatchScope : 0));
+                          (FnCatch ? Scope::FnCatchScope : Scope::CatchScope));

   // exception-declaration is equivalent to '...' or a parameter-declaration
   // without default arguments.
Index: contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp
===================================================================
--- contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp
(revision 244350)
+++ contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp    (working copy)
_at__at_ -135,16 +135,13 _at__at_
       // of the controlled statement.
       //
       assert(S->getParent() && "No TUScope?");
-      if (S->getFlags() & Scope::FnTryScope)
-        return S->getParent()->isDeclScope(D);
       if (S->getParent()->getFlags() & Scope::ControlScope) {
-        if (S->getParent()->getFlags() & Scope::FnCatchScope) {
-          S = S->getParent();
-          if (S->isDeclScope(D))
-            return true;
-        }
+        S = S->getParent();
+        if (S->isDeclScope(D))
+          return true;
+      }
+      if (S->getFlags() & Scope::FnTryCatchScope)
         return S->getParent()->isDeclScope(D);
-      }
     }
     return false;
   }
Received on Mon Dec 17 2012 - 11:40:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:33 UTC