diff --git a/compiler/buffetfsm/llvm-patches/Attr.td.patch b/compiler/buffetfsm/llvm-patches/Attr.td.patch index 6f0d347..84c23b3 100644 --- a/compiler/buffetfsm/llvm-patches/Attr.td.patch +++ b/compiler/buffetfsm/llvm-patches/Attr.td.patch @@ -1,6 +1,8 @@ ---- include/clang/Basic/Attr.td (revision 209914) -+++ include/clang/Basic/Attr.td (working copy) -@@ -382,6 +382,13 @@ +Index: include/clang/Basic/Attr.td +=================================================================== +--- include/clang/Basic/Attr.td (revision 319532) ++++ include/clang/Basic/Attr.td (working copy) +@@ -612,6 +612,13 @@ let Documentation = [Undocumented]; } @@ -12,5 +14,5 @@ +} + def ARMInterrupt : InheritableAttr, TargetSpecificAttr { - // NOTE: If you add any additional spellings, MSP430Interrupt's spellings - // must match. + // NOTE: If you add any additional spellings, MSP430Interrupt's, + // MipsInterrupt's and AnyX86Interrupt's spellings must match. diff --git a/compiler/buffetfsm/llvm-patches/DiagnosticSemaKinds.td.patch b/compiler/buffetfsm/llvm-patches/DiagnosticSemaKinds.td.patch index bbd29c0..5ea780c 100644 --- a/compiler/buffetfsm/llvm-patches/DiagnosticSemaKinds.td.patch +++ b/compiler/buffetfsm/llvm-patches/DiagnosticSemaKinds.td.patch @@ -1,15 +1,19 @@ ---- include/clang/Basic/DiagnosticSemaKinds.td (revision 209914) -+++ include/clang/Basic/DiagnosticSemaKinds.td (working copy) -@@ -2059,8 +2059,12 @@ +Index: include/clang/Basic/DiagnosticSemaKinds.td +=================================================================== +--- include/clang/Basic/DiagnosticSemaKinds.td (revision 319532) ++++ include/clang/Basic/DiagnosticSemaKinds.td (working copy) +@@ -2690,10 +2690,14 @@ def warn_unhandled_ms_attribute_ignored : Warning< "__declspec attribute %0 is not supported">, InGroup; +def err_attribute_invalid_on_nonloop : Error< + "%0 attribute cannot be applied to a non-loop statement">; - def err_attribute_invalid_on_stmt : Error< + def err_decl_attribute_invalid_on_stmt : Error< "%0 attribute cannot be applied to a statement">; + def err_stmt_attribute_invalid_on_decl : Error< + "%0 attribute cannot be applied to a declaration">; +def err_attribute_invalid_on_decl : Error< + "%0 attribute cannot be applied to a declaration">; def warn_declspec_attribute_ignored : Warning< "attribute %0 is ignored, place it after " - "\"%select{class|struct|union|interface|enum}1\" to apply attribute to " + "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " diff --git a/compiler/buffetfsm/llvm-patches/SemaDeclAttr.cpp.patch b/compiler/buffetfsm/llvm-patches/SemaDeclAttr.cpp.patch index 22e00be..9cd4b8f 100644 --- a/compiler/buffetfsm/llvm-patches/SemaDeclAttr.cpp.patch +++ b/compiler/buffetfsm/llvm-patches/SemaDeclAttr.cpp.patch @@ -1,8 +1,10 @@ ---- lib/Sema/SemaDeclAttr.cpp (revision 209914) -+++ lib/Sema/SemaDeclAttr.cpp (working copy) -@@ -4054,6 +4054,9 @@ - // Type attributes are handled elsewhere; silently move on. - assert(Attr.isTypeAttr() && "Non-type attribute not handled"); +Index: lib/Sema/SemaDeclAttr.cpp +=================================================================== +--- lib/Sema/SemaDeclAttr.cpp (revision 319532) ++++ lib/Sema/SemaDeclAttr.cpp (working copy) +@@ -5997,6 +5997,9 @@ + S.Diag(Attr.getLoc(), diag::err_stmt_attribute_invalid_on_decl) + << Attr.getName() << D->getLocation(); break; + case AttributeList::AT_LoopFlatten: + S.Diag(Attr.getLoc(), diag::err_attribute_invalid_on_decl) << Attr.getName() << D->getLocStart(); diff --git a/compiler/buffetfsm/llvm-patches/SemaStmtAttr.cpp.patch b/compiler/buffetfsm/llvm-patches/SemaStmtAttr.cpp.patch index 0a188bb..c3e36a4 100644 --- a/compiler/buffetfsm/llvm-patches/SemaStmtAttr.cpp.patch +++ b/compiler/buffetfsm/llvm-patches/SemaStmtAttr.cpp.patch @@ -1,7 +1,9 @@ ---- lib/Sema/SemaStmtAttr.cpp (revision 209914) -+++ lib/Sema/SemaStmtAttr.cpp (working copy) -@@ -42,7 +42,31 @@ - A.getAttributeSpellingListIndex()); +Index: lib/Sema/SemaStmtAttr.cpp +=================================================================== +--- lib/Sema/SemaStmtAttr.cpp (revision 319532) ++++ lib/Sema/SemaStmtAttr.cpp (working copy) +@@ -288,6 +288,31 @@ + return OpenCLUnrollHintAttr::CreateImplicit(S.Context, UnrollFactor); } +static Attr *handleLoopFlattenAttr(Sema &S, Stmt *St, const AttributeList &A, SourceRange Range) { @@ -9,7 +11,7 @@ + // expecting an expression argument + const Expr *e = A.getArgAsExpr(0); + llvm::APSInt ilit; - ++ + // if we can't convert arg to an integer, abort + if (! e->EvaluateAsInt(ilit, S.Context)) { + S.Diag(e->getLocStart(), diag::err_attribute_argument_type) << A.getName() << AANT_ArgumentIntegerConstant; @@ -32,7 +34,7 @@ static Attr *ProcessStmtAttribute(Sema &S, Stmt *St, const AttributeList &A, SourceRange Range) { switch (A.getKind()) { -@@ -51,6 +75,8 @@ +@@ -296,6 +321,8 @@ diag::warn_unhandled_ms_attribute_ignored : diag::warn_unknown_attribute_ignored) << A.getName(); return nullptr; @@ -40,4 +42,4 @@ + return handleLoopFlattenAttr(S, St, A, Range); case AttributeList::AT_FallThrough: return handleFallThroughAttr(S, St, A, Range); - default: + case AttributeList::AT_LoopHint: diff --git a/install_buffet.sh b/install_buffet.sh index 73587c6..ce33689 100755 --- a/install_buffet.sh +++ b/install_buffet.sh @@ -1,9 +1,9 @@ #!/bin/bash set -e cd compiler/buffetfsm/ -tar xjvf ../../thirdparty/llvm_clang-r209914-patched-buffet_fsm_patch.tar.bz2 +tar xjvf ../../thirdparty/llvm_clang-r319532-patched-buffet_fsm_patch.tar.bz2 mkdir toolchain mkdir llvm-build cd llvm-build -$PWD/../llvm/configure --prefix=$PWD/../toolchain --enable-shared --enable-optimized +cmake -DCMAKE_INSTALL_PREFIX=$PWD/../toolchain -DBUILD_SHARED_LIBS=True -DLLVM_OPTIMIZED_TABLEGEN=True $PWD/../llvm/ make -j$(nproc) diff --git a/thirdparty/llvm_clang-r209914-patched-buffet_fsm_patch.tar.bz2 b/thirdparty/llvm_clang-r209914-patched-buffet_fsm_patch.tar.bz2 deleted file mode 100644 index f2070bd..0000000 Binary files a/thirdparty/llvm_clang-r209914-patched-buffet_fsm_patch.tar.bz2 and /dev/null differ diff --git a/thirdparty/llvm_clang-r319532-patched-buffet_fsm_patch.tar.bz2 b/thirdparty/llvm_clang-r319532-patched-buffet_fsm_patch.tar.bz2 new file mode 100644 index 0000000..6cfaa21 Binary files /dev/null and b/thirdparty/llvm_clang-r319532-patched-buffet_fsm_patch.tar.bz2 differ