Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions compiler/buffetfsm/llvm-patches/Attr.td.patch
Original file line number Diff line number Diff line change
@@ -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];
}

Expand All @@ -12,5 +14,5 @@
+}
+
def ARMInterrupt : InheritableAttr, TargetSpecificAttr<TargetARM> {
// 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.
14 changes: 9 additions & 5 deletions compiler/buffetfsm/llvm-patches/DiagnosticSemaKinds.td.patch
Original file line number Diff line number Diff line change
@@ -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<IgnoredAttributes>;
+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 "
12 changes: 7 additions & 5 deletions compiler/buffetfsm/llvm-patches/SemaDeclAttr.cpp.patch
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
16 changes: 9 additions & 7 deletions compiler/buffetfsm/llvm-patches/SemaStmtAttr.cpp.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
--- 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) {
+ if (isa<ForStmt>(St) || isa<WhileStmt>(St) || isa<DoStmt>(St)) {
+ // 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;
Expand All @@ -32,12 +34,12 @@
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;
+ case AttributeList::AT_LoopFlatten:
+ return handleLoopFlattenAttr(S, St, A, Range);
case AttributeList::AT_FallThrough:
return handleFallThroughAttr(S, St, A, Range);
default:
case AttributeList::AT_LoopHint:
4 changes: 2 additions & 2 deletions install_buffet.sh
Original file line number Diff line number Diff line change
@@ -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)
Binary file not shown.
Binary file not shown.