X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FSetTheory.h;h=5baed79fb76a6981af44aed0b1cc3f3615f2eeb2;hb=d573aba8e13c2afc5ad7c3c3c442a3a84f8bd94d;hp=e37a76ee68c000ff45faaceadf1519c349f95787;hpb=c017bc1c1e2fa0995e957f6c2ada1339832bb221;p=oota-llvm.git diff --git a/utils/TableGen/SetTheory.h b/utils/TableGen/SetTheory.h index e37a76ee68c..5baed79fb76 100644 --- a/utils/TableGen/SetTheory.h +++ b/utils/TableGen/SetTheory.h @@ -47,15 +47,16 @@ #ifndef SETTHEORY_H #define SETTHEORY_H -#include "llvm/ADT/StringMap.h" #include "llvm/ADT/SetVector.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/Support/SourceMgr.h" #include #include namespace llvm { class DagInit; -struct Init; +class Init; class Record; class RecordKeeper; @@ -65,18 +66,23 @@ public: typedef SmallSetVector RecSet; /// Operator - A callback representing a DAG operator. - struct Operator { + class Operator { + virtual void anchor(); + public: virtual ~Operator() {} /// apply - Apply this operator to Expr's arguments and insert the result /// in Elts. - virtual void apply(SetTheory&, DagInit *Expr, RecSet &Elts) =0; + virtual void apply(SetTheory&, DagInit *Expr, RecSet &Elts, + ArrayRef Loc) =0; }; /// Expander - A callback function that can transform a Record representing a /// set into a fully expanded list of elements. Expanders provide a way for /// users to define named sets that can be used in DAG expressions. - struct Expander { + class Expander { + virtual void anchor(); + public: virtual ~Expander() {} virtual void expand(SetTheory&, Record*, RecSet &Elts) =0; @@ -115,13 +121,13 @@ public: void addOperator(StringRef Name, Operator*); /// evaluate - Evaluate Expr and append the resulting set to Elts. - void evaluate(Init *Expr, RecSet &Elts); + void evaluate(Init *Expr, RecSet &Elts, ArrayRef Loc); /// evaluate - Evaluate a sequence of Inits and append to Elts. template - void evaluate(Iter begin, Iter end, RecSet &Elts) { + void evaluate(Iter begin, Iter end, RecSet &Elts, ArrayRef Loc) { while (begin != end) - evaluate(*begin++, Elts); + evaluate(*begin++, Elts, Loc); } /// expand - Expand a record into a set of elements if possible. Return a