<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 3:00 PM, Kaelyn Takata <span dir="ltr"><<a href="mailto:rikka@google.com" target="_blank">rikka@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rikka<br>
Date: Tue Nov 11 17:00:42 2014<br>
New Revision: 221724<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221724&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221724&view=rev</a><br>
Log:<br>
Make LookupResult be copyable to avoid decomposing an existing one and<br>
initializing a new one every time a copy is needed.<br></blockquote><div><br>Looks great - though I don't see the use case - I guess that'll be in a follow-up commit?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/UnresolvedSet.h<br>
    cfe/trunk/include/clang/Sema/Lookup.h<br>
    cfe/trunk/lib/Sema/SemaLookup.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/UnresolvedSet.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/UnresolvedSet.h?rev=221724&r1=221723&r2=221724&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/UnresolvedSet.h?rev=221724&r1=221723&r2=221724&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/UnresolvedSet.h (original)<br>
+++ cfe/trunk/include/clang/AST/UnresolvedSet.h Tue Nov 11 17:00:42 2014<br>
@@ -98,7 +98,7 @@ class UnresolvedSetImpl {<br>
 private:<br>
   template <unsigned N> friend class UnresolvedSet;<br>
   UnresolvedSetImpl() {}<br>
-  UnresolvedSetImpl(const UnresolvedSetImpl &) LLVM_DELETED_FUNCTION;<br>
+  UnresolvedSetImpl(const UnresolvedSetImpl &) {};<br></blockquote><div><br>Unnecessary semicolon (GCC will probably warn about this) at the end of this line ^<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 public:<br>
   // We don't currently support assignment through this iterator, so we might<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Lookup.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=221724&r1=221723&r2=221724&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=221724&r1=221723&r2=221724&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Lookup.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Lookup.h Tue Nov 11 17:00:42 2014<br>
@@ -132,7 +132,7 @@ public:<br>
     : ResultKind(NotFound),<br>
       Paths(nullptr),<br>
       NamingClass(nullptr),<br>
-      SemaRef(SemaRef),<br>
+      SemaPtr(&SemaRef),<br>
       NameInfo(NameInfo),<br>
       LookupKind(LookupKind),<br>
       IDNS(0),<br>
@@ -154,7 +154,7 @@ public:<br>
     : ResultKind(NotFound),<br>
       Paths(nullptr),<br>
       NamingClass(nullptr),<br>
-      SemaRef(SemaRef),<br>
+      SemaPtr(&SemaRef),<br>
       NameInfo(Name, NameLoc),<br>
       LookupKind(LookupKind),<br>
       IDNS(0),<br>
@@ -174,7 +174,7 @@ public:<br>
     : ResultKind(NotFound),<br>
       Paths(nullptr),<br>
       NamingClass(nullptr),<br>
-      SemaRef(Other.SemaRef),<br>
+      SemaPtr(Other.SemaPtr),<br>
       NameInfo(Other.NameInfo),<br>
       LookupKind(Other.LookupKind),<br>
       IDNS(Other.IDNS),<br>
@@ -305,7 +305,7 @@ public:<br>
     if (!D->isInIdentifierNamespace(IDNS))<br>
       return nullptr;<br>
<br>
-    if (isHiddenDeclarationVisible() || isVisible(SemaRef, D))<br>
+    if (isHiddenDeclarationVisible() || isVisible(getSema(), D))<br>
       return D;<br>
<br>
     return getAcceptableDeclSlow(D);<br>
@@ -551,7 +551,7 @@ public:<br>
<br>
   /// \brief Get the Sema object that this lookup result is searching<br>
   /// with.<br>
-  Sema &getSema() const { return SemaRef; }<br>
+  Sema &getSema() const { return *SemaPtr; }<br>
<br>
   /// A class for iterating through a result set and possibly<br>
   /// filtering out results.  The results returned are possibly<br>
@@ -630,9 +630,9 @@ public:<br>
 private:<br>
   void diagnose() {<br>
     if (isAmbiguous())<br>
-      SemaRef.DiagnoseAmbiguousLookup(*this);<br>
-    else if (isClassLookup() && SemaRef.getLangOpts().AccessControl)<br>
-      SemaRef.CheckLookupAccess(*this);<br>
+      getSema().DiagnoseAmbiguousLookup(*this);<br>
+    else if (isClassLookup() && getSema().getLangOpts().AccessControl)<br>
+      getSema().CheckLookupAccess(*this);<br>
   }<br>
<br>
   void setAmbiguous(AmbiguityKind AK) {<br>
@@ -664,7 +664,7 @@ private:<br>
   QualType BaseObjectType;<br>
<br>
   // Parameters.<br>
-  Sema &SemaRef;<br>
+  Sema *SemaPtr;<br>
   DeclarationNameInfo NameInfo;<br>
   SourceRange NameContextRange;<br>
   Sema::LookupNameKind LookupKind;<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=221724&r1=221723&r2=221724&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=221724&r1=221723&r2=221724&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Tue Nov 11 17:00:42 2014<br>
@@ -285,7 +285,7 @@ static inline unsigned getIDNS(Sema::Loo<br>
 }<br>
<br>
 void LookupResult::configure() {<br>
-  IDNS = getIDNS(LookupKind, SemaRef.getLangOpts().CPlusPlus,<br>
+  IDNS = getIDNS(LookupKind, getSema().getLangOpts().CPlusPlus,<br>
                  isForRedeclaration());<br>
<br>
   // If we're looking for one of the allocation or deallocation<br>
@@ -296,7 +296,7 @@ void LookupResult::configure() {<br>
   case OO_Delete:<br>
   case OO_Array_New:<br>
   case OO_Array_Delete:<br>
-    SemaRef.DeclareGlobalNewDelete();<br>
+    getSema().DeclareGlobalNewDelete();<br>
     break;<br>
<br>
   default:<br>
@@ -307,7 +307,7 @@ void LookupResult::configure() {<br>
   // up being declared.<br>
   if (IdentifierInfo *Id = NameInfo.getName().getAsIdentifierInfo()) {<br>
     if (unsigned BuiltinID = Id->getBuiltinID()) {<br>
-      if (!SemaRef.Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID))<br>
+      if (!getSema().Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID))<br>
         AllowHidden = true;<br>
     }<br>
   }<br>
@@ -400,8 +400,8 @@ void LookupResult::resolveKind() {<br>
     // canonical type.<br>
     if (TypeDecl *TD = dyn_cast<TypeDecl>(D)) {<br>
       if (!TD->getDeclContext()->isRecord()) {<br>
-        QualType T = SemaRef.Context.getTypeDeclType(TD);<br>
-        if (!UniqueTypes.insert(SemaRef.Context.getCanonicalType(T))) {<br>
+        QualType T = getSema().Context.getTypeDeclType(TD);<br>
+        if (!UniqueTypes.insert(getSema().Context.getCanonicalType(T))) {<br>
           // The type is not unique; pull something off the back and continue<br>
           // at this index.<br>
           Decls[I] = Decls[--N];<br>
@@ -1265,7 +1265,7 @@ static NamedDecl *findAcceptableDecl(Sem<br>
 }<br>
<br>
 NamedDecl *LookupResult::getAcceptableDeclSlow(NamedDecl *D) const {<br>
-  return findAcceptableDecl(SemaRef, D);<br>
+  return findAcceptableDecl(getSema(), D);<br>
 }<br>
<br>
 /// @brief Perform unqualified name lookup starting from a given<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>