Large mechanical patch.

s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 820a1e3..205650d 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -32,7 +32,7 @@
   std::vector<PATypeHolder>().swap(TypeList);
   ValueList.clear();
   
-  std::vector<PAListPtr>().swap(ParamAttrs);
+  std::vector<AttrListPtr>().swap(Attributes);
   std::vector<BasicBlock*>().swap(FunctionBBs);
   std::vector<Function*>().swap(FunctionsWithBodies);
   DeferredFunctionInfo.clear();
@@ -313,16 +313,16 @@
 //  Functions for parsing blocks from the bitcode file
 //===----------------------------------------------------------------------===//
 
-bool BitcodeReader::ParseParamAttrBlock() {
+bool BitcodeReader::ParseAttributeBlock() {
   if (Stream.EnterSubBlock(bitc::PARAMATTR_BLOCK_ID))
     return Error("Malformed block record");
   
-  if (!ParamAttrs.empty())
+  if (!Attributes.empty())
     return Error("Multiple PARAMATTR blocks found!");
   
   SmallVector<uint64_t, 64> Record;
   
-  SmallVector<FnAttributeWithIndex, 8> Attrs;
+  SmallVector<AttributeWithIndex, 8> Attrs;
   
   // Read all the records.
   while (1) {
@@ -356,11 +356,11 @@
         return Error("Invalid ENTRY record");
 
       for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
-        if (Record[i+1] != ParamAttr::None)
-          Attrs.push_back(FnAttributeWithIndex::get(Record[i], Record[i+1]));
+        if (Record[i+1] != Attribute::None)
+          Attrs.push_back(AttributeWithIndex::get(Record[i], Record[i+1]));
       }
 
-      ParamAttrs.push_back(PAListPtr::get(Attrs.begin(), Attrs.end()));
+      Attributes.push_back(AttrListPtr::get(Attrs.begin(), Attrs.end()));
       Attrs.clear();
       break;
     }
@@ -1030,7 +1030,7 @@
           return Error("Malformed BlockInfoBlock");
         break;
       case bitc::PARAMATTR_BLOCK_ID:
-        if (ParseParamAttrBlock())
+        if (ParseAttributeBlock())
           return true;
         break;
       case bitc::TYPE_BLOCK_ID:
@@ -1183,7 +1183,7 @@
       Func->setCallingConv(Record[1]);
       bool isProto = Record[2];
       Func->setLinkage(GetDecodedLinkage(Record[3]));
-      Func->setParamAttrs(getParamAttrs(Record[4]));
+      Func->setAttributes(getAttributes(Record[4]));
       
       Func->setAlignment((1 << Record[5]) >> 1);
       if (Record[6]) {
@@ -1695,7 +1695,7 @@
     case bitc::FUNC_CODE_INST_INVOKE: {
       // INVOKE: [attrs, cc, normBB, unwindBB, fnty, op0,op1,op2, ...]
       if (Record.size() < 4) return Error("Invalid INVOKE record");
-      PAListPtr PAL = getParamAttrs(Record[0]);
+      AttrListPtr PAL = getAttributes(Record[0]);
       unsigned CCInfo = Record[1];
       BasicBlock *NormalBB = getBasicBlock(Record[2]);
       BasicBlock *UnwindBB = getBasicBlock(Record[3]);
@@ -1736,7 +1736,7 @@
       I = InvokeInst::Create(Callee, NormalBB, UnwindBB,
                              Ops.begin(), Ops.end());
       cast<InvokeInst>(I)->setCallingConv(CCInfo);
-      cast<InvokeInst>(I)->setParamAttrs(PAL);
+      cast<InvokeInst>(I)->setAttributes(PAL);
       break;
     }
     case bitc::FUNC_CODE_INST_UNWIND: // UNWIND
@@ -1834,7 +1834,7 @@
       if (Record.size() < 3)
         return Error("Invalid CALL record");
       
-      PAListPtr PAL = getParamAttrs(Record[0]);
+      AttrListPtr PAL = getAttributes(Record[0]);
       unsigned CCInfo = Record[1];
       
       unsigned OpNum = 2;
@@ -1874,7 +1874,7 @@
       I = CallInst::Create(Callee, Args.begin(), Args.end());
       cast<CallInst>(I)->setCallingConv(CCInfo>>1);
       cast<CallInst>(I)->setTailCall(CCInfo & 1);
-      cast<CallInst>(I)->setParamAttrs(PAL);
+      cast<CallInst>(I)->setAttributes(PAL);
       break;
     }
     case bitc::FUNC_CODE_INST_VAARG: { // VAARG: [valistty, valist, instty]
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index 9eac14f..e8ad1dd 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/Reader/BitcodeReader.h
@@ -136,10 +136,10 @@
   std::vector<std::pair<GlobalVariable*, unsigned> > GlobalInits;
   std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits;
   
-  /// ParamAttrs - The set of parameter attributes by index.  Index zero in the
+  /// Attributes - The set of parameter attributes by index.  Index zero in the
   /// file is for null, and is thus not represented here.  As such all indices
   /// are off by one.
-  std::vector<PAListPtr> ParamAttrs;
+  std::vector<AttrListPtr> Attributes;
   
   /// FunctionBBs - While parsing a function body, this is a list of the basic
   /// blocks for the function.
@@ -203,10 +203,10 @@
     if (ID >= FunctionBBs.size()) return 0; // Invalid ID
     return FunctionBBs[ID];
   }
-  PAListPtr getParamAttrs(unsigned i) const {
-    if (i-1 < ParamAttrs.size())
-      return ParamAttrs[i-1];
-    return PAListPtr();
+  AttrListPtr getAttributes(unsigned i) const {
+    if (i-1 < Attributes.size())
+      return Attributes[i-1];
+    return AttrListPtr();
   }
   
   /// getValueTypePair - Read a value/type pair out of the specified record from
@@ -239,7 +239,7 @@
 
   
   bool ParseModule(const std::string &ModuleID);
-  bool ParseParamAttrBlock();
+  bool ParseAttributeBlock();
   bool ParseTypeTable();
   bool ParseTypeSymbolTable();
   bool ParseValueSymbolTable();