Provide a way to specify inliner's attribute compatibility and merging.
[oota-llvm.git] / utils / TableGen / Attributes.cpp
index ffa49d0686de1c17e9385f9aac6a0bd5ab3f0c96..7b001bf14de588a4ee6831d2da740e70b26c9cfa 100644 (file)
@@ -43,7 +43,7 @@ void Attributes::emitTargetIndependentEnums(raw_ostream &OS) {
   OS << "#ifdef GET_ATTR_ENUM\n";
   OS << "#undef GET_ATTR_ENUM\n";
 
-  const std::vector<Record*> &Attrs =
+  std::vector<Record*> Attrs =
       Records.getAllDerivedDefinitions("EnumAttr");
 
   for (auto A : Attrs)
@@ -93,7 +93,7 @@ void Attributes::emitFnAttrCompatCheck(raw_ostream &OS, bool IsStringAttr) {
       Records.getAllDerivedDefinitions("CompatRule");
 
   for (auto *Rule : CompatRules) {
-    StringRef FuncName = Rule->getValueAsString("CompatFunc");
+    std::string FuncName = Rule->getValueAsString("CompatFunc");
     OS << "  Ret &= " << FuncName << "(Caller, Callee);\n";
   }
 
@@ -107,7 +107,7 @@ void Attributes::emitFnAttrCompatCheck(raw_ostream &OS, bool IsStringAttr) {
      << "                                const Function &Callee) {\n";
 
   for (auto *Rule : MergeRules) {
-    StringRef FuncName = Rule->getValueAsString("MergeFunc");
+    std::string FuncName = Rule->getValueAsString("MergeFunc");
     OS << "  " << FuncName << "(Caller, Callee);\n";
   }