Add a ELFSectionRef class and use it to expose getSectionType.
[oota-llvm.git] / lib / TableGen / Record.cpp
index 00f022b98c62dbae5748786147ecd7dc481dc1c9..6e982bf1da1917ac81848c13e15c84e796255ed5 100644 (file)
@@ -891,7 +891,7 @@ static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
       return ForeachHelper(LHS, Arg, RHSo, Type, CurRec, CurMultiClass);
 
   std::vector<Init *> NewOperands;
-  for (int i = 0; i < RHSo->getNumOperands(); ++i) {
+  for (unsigned i = 0; i < RHSo->getNumOperands(); ++i) {
     if (auto *RHSoo = dyn_cast<OpInit>(RHSo->getOperand(i))) {
       if (Init *Result = EvaluateOperation(RHSoo, LHS, Arg,
                                            Type, CurRec, CurMultiClass))
@@ -955,7 +955,7 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
 
     for (Init *&Item : NewList) {
       NewOperands.clear();
-      for(int i = 0; i < RHSo->getNumOperands(); ++i) {
+      for(unsigned i = 0; i < RHSo->getNumOperands(); ++i) {
         // First, replace the foreach variable with the list item
         if (LHS->getAsString() == RHSo->getOperand(i)->getAsString())
           NewOperands.push_back(Item);
@@ -1574,13 +1574,9 @@ void Record::checkName() {
 }
 
 DefInit *Record::getDefInit() {
-  static DenseMap<Record *, std::unique_ptr<DefInit>> ThePool;
-  if (TheInit)
-    return TheInit;
-
-  std::unique_ptr<DefInit> &I = ThePool[this];
-  if (!I) I.reset(new DefInit(this, new RecordRecTy(this)));
-  return I.get();
+  if (!TheInit)
+    TheInit.reset(new DefInit(this, new RecordRecTy(this)));
+  return TheInit.get();
 }
 
 const std::string &Record::getName() const {