myatsina created this revision.
myatsina added reviewers: rnk, hintonda, rjmccall, dblaikie.
myatsina added a subscriber: cfe-commits.
myatsina set the repository for this revision to rL LLVM.

The purpose of this patch is to keep the same functionality without using 
LookupResult's implicit copy ctor and assignment operator, because they cause 
warnings when -Wdeprecated is passed.
This patch is meant to help the following review: 
http://reviews.llvm.org/D18123.




Repository:
  rL LLVM

http://reviews.llvm.org/D18175

Files:
  lib/Sema/SemaStmtAsm.cpp

Index: lib/Sema/SemaStmtAsm.cpp
===================================================================
--- lib/Sema/SemaStmtAsm.cpp
+++ lib/Sema/SemaStmtAsm.cpp
@@ -623,16 +623,15 @@
 
   if (!LookupName(BaseResult, getCurScope()))
     return true;
-
-  LookupResult CurrBaseResult(BaseResult);
-
+  
+  bool IsSingleRes = BaseResult.isSingleResult();
+  NamedDecl *FoundDecl = BaseResult.getFoundDecl();
   for (StringRef NextMember : Members) {
 
-    if (!CurrBaseResult.isSingleResult())
+    if (!IsSingleRes)
       return true;
 
     const RecordType *RT = nullptr;
-    NamedDecl *FoundDecl = CurrBaseResult.getFoundDecl();
     if (VarDecl *VD = dyn_cast<VarDecl>(FoundDecl))
       RT = VD->getType()->getAs<RecordType>();
     else if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(FoundDecl)) {
@@ -660,7 +659,8 @@
     if (!FD)
       return true;
 
-    CurrBaseResult = FieldResult;
+    IsSingleRes = FieldResult.isSingleResult();
+    FoundDecl = FieldResult.getFoundDecl();
 
     const ASTRecordLayout &RL = Context.getASTRecordLayout(RT->getDecl());
     unsigned i = FD->getFieldIndex();


Index: lib/Sema/SemaStmtAsm.cpp
===================================================================
--- lib/Sema/SemaStmtAsm.cpp
+++ lib/Sema/SemaStmtAsm.cpp
@@ -623,16 +623,15 @@
 
   if (!LookupName(BaseResult, getCurScope()))
     return true;
-
-  LookupResult CurrBaseResult(BaseResult);
-
+  
+  bool IsSingleRes = BaseResult.isSingleResult();
+  NamedDecl *FoundDecl = BaseResult.getFoundDecl();
   for (StringRef NextMember : Members) {
 
-    if (!CurrBaseResult.isSingleResult())
+    if (!IsSingleRes)
       return true;
 
     const RecordType *RT = nullptr;
-    NamedDecl *FoundDecl = CurrBaseResult.getFoundDecl();
     if (VarDecl *VD = dyn_cast<VarDecl>(FoundDecl))
       RT = VD->getType()->getAs<RecordType>();
     else if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(FoundDecl)) {
@@ -660,7 +659,8 @@
     if (!FD)
       return true;
 
-    CurrBaseResult = FieldResult;
+    IsSingleRes = FieldResult.isSingleResult();
+    FoundDecl = FieldResult.getFoundDecl();
 
     const ASTRecordLayout &RL = Context.getASTRecordLayout(RT->getDecl());
     unsigned i = FD->getFieldIndex();
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to