Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.
Ok, not really, but do support some common LISP functions:
* car
* cdr
* null
llvm-svn: 71805
diff --git a/llvm/utils/TableGen/Record.h b/llvm/utils/TableGen/Record.h
index c37f6e6..c2549da 100644
--- a/llvm/utils/TableGen/Record.h
+++ b/llvm/utils/TableGen/Record.h
@@ -690,9 +690,14 @@
class ListInit : public Init {
std::vector<Init*> Values;
public:
+ typedef std::vector<Init*>::iterator iterator;
+ typedef std::vector<Init*>::const_iterator const_iterator;
+
explicit ListInit(std::vector<Init*> &Vs) {
Values.swap(Vs);
}
+ explicit ListInit(iterator Start, iterator End)
+ : Values(Start, End) {}
unsigned getSize() const { return Values.size(); }
Init *getElement(unsigned i) const {
@@ -717,9 +722,6 @@
virtual std::string getAsString() const;
- typedef std::vector<Init*>::iterator iterator;
- typedef std::vector<Init*>::const_iterator const_iterator;
-
inline iterator begin() { return Values.begin(); }
inline const_iterator begin() const { return Values.begin(); }
inline iterator end () { return Values.end(); }
@@ -761,7 +763,7 @@
///
class UnOpInit : public OpInit {
public:
- enum UnaryOp { CAST };
+ enum UnaryOp { CAST, CAR, CDR, LNULL };
private:
UnaryOp Opc;
Init *LHS;