Don't add the 'Value' string if there isn't one.
authorBill Wendling <isanbard@gmail.com>
Thu, 28 Feb 2013 21:17:03 +0000 (21:17 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 28 Feb 2013 21:17:03 +0000 (21:17 +0000)
This was causing the folding set to fail to fold attributes, because it was
being calculated in one spot without an empty values string but here with an
empty values string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176301 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/AttributeImpl.h

index cb2c55ccbe78931ebc15aef74c0063b467cf9701..ad2670dade12577aacfe40f3de3fa1d082721437 100644 (file)
@@ -146,7 +146,7 @@ public:
   }
   static void Profile(FoldingSetNodeID &ID, StringRef Kind, StringRef Values) {
     ID.AddString(Kind);
-    ID.AddString(Values);
+    if (!Values.empty()) ID.AddString(Values);
   }
 
   // FIXME: Remove this!