This revision was automatically updated to reflect the committed changes.
Closed by commit rL310483: Fix broken getAttributeSpellingListIndex for pragma 
attributes (authored by erichkeane).

Changed prior to commit:
  https://reviews.llvm.org/D36473?vs=110217&id=110404#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36473

Files:
  cfe/trunk/include/clang/Sema/AttributeList.h
  cfe/trunk/lib/Sema/SemaStmtAttr.cpp


Index: cfe/trunk/include/clang/Sema/AttributeList.h
===================================================================
--- cfe/trunk/include/clang/Sema/AttributeList.h
+++ cfe/trunk/include/clang/Sema/AttributeList.h
@@ -106,10 +106,12 @@
     AS_Microsoft,
     /// __ptr16, alignas(...), etc.
     AS_Keyword,
-    /// Context-sensitive version of a keyword attribute.
-    AS_ContextSensitiveKeyword,
     /// #pragma ...
     AS_Pragma,
+    // Note TableGen depends on the order above.  Do not add or change the 
order
+    // without adding related code to TableGen/ClangAttrEmitter.cpp.
+    /// Context-sensitive version of a keyword attribute.
+    AS_ContextSensitiveKeyword,
   };
 
 private:
Index: cfe/trunk/lib/Sema/SemaStmtAttr.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaStmtAttr.cpp
+++ cfe/trunk/lib/Sema/SemaStmtAttr.cpp
@@ -100,16 +100,15 @@
     return nullptr;
   }
 
-  LoopHintAttr::Spelling Spelling;
+  LoopHintAttr::Spelling Spelling =
+      LoopHintAttr::Spelling(A.getAttributeSpellingListIndex());
   LoopHintAttr::OptionType Option;
   LoopHintAttr::LoopHintState State;
   if (PragmaNoUnroll) {
     // #pragma nounroll
-    Spelling = LoopHintAttr::Pragma_nounroll;
     Option = LoopHintAttr::Unroll;
     State = LoopHintAttr::Disable;
   } else if (PragmaUnroll) {
-    Spelling = LoopHintAttr::Pragma_unroll;
     if (ValueExpr) {
       // #pragma unroll N
       Option = LoopHintAttr::UnrollCount;
@@ -121,7 +120,6 @@
     }
   } else {
     // #pragma clang loop ...
-    Spelling = LoopHintAttr::Pragma_clang_loop;
     assert(OptionLoc && OptionLoc->Ident &&
            "Attribute must have valid option info.");
     Option = llvm::StringSwitch<LoopHintAttr::OptionType>(


Index: cfe/trunk/include/clang/Sema/AttributeList.h
===================================================================
--- cfe/trunk/include/clang/Sema/AttributeList.h
+++ cfe/trunk/include/clang/Sema/AttributeList.h
@@ -106,10 +106,12 @@
     AS_Microsoft,
     /// __ptr16, alignas(...), etc.
     AS_Keyword,
-    /// Context-sensitive version of a keyword attribute.
-    AS_ContextSensitiveKeyword,
     /// #pragma ...
     AS_Pragma,
+    // Note TableGen depends on the order above.  Do not add or change the order
+    // without adding related code to TableGen/ClangAttrEmitter.cpp.
+    /// Context-sensitive version of a keyword attribute.
+    AS_ContextSensitiveKeyword,
   };
 
 private:
Index: cfe/trunk/lib/Sema/SemaStmtAttr.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaStmtAttr.cpp
+++ cfe/trunk/lib/Sema/SemaStmtAttr.cpp
@@ -100,16 +100,15 @@
     return nullptr;
   }
 
-  LoopHintAttr::Spelling Spelling;
+  LoopHintAttr::Spelling Spelling =
+      LoopHintAttr::Spelling(A.getAttributeSpellingListIndex());
   LoopHintAttr::OptionType Option;
   LoopHintAttr::LoopHintState State;
   if (PragmaNoUnroll) {
     // #pragma nounroll
-    Spelling = LoopHintAttr::Pragma_nounroll;
     Option = LoopHintAttr::Unroll;
     State = LoopHintAttr::Disable;
   } else if (PragmaUnroll) {
-    Spelling = LoopHintAttr::Pragma_unroll;
     if (ValueExpr) {
       // #pragma unroll N
       Option = LoopHintAttr::UnrollCount;
@@ -121,7 +120,6 @@
     }
   } else {
     // #pragma clang loop ...
-    Spelling = LoopHintAttr::Pragma_clang_loop;
     assert(OptionLoc && OptionLoc->Ident &&
            "Attribute must have valid option info.");
     Option = llvm::StringSwitch<LoopHintAttr::OptionType>(
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to