Make SpecialCaseList match full strings, as documented, using anchors.
[oota-llvm.git] / lib / Transforms / Utils / SpecialCaseList.cpp
index a747230def2ae07502908b7a36c1b8222e0a3e73..ef8a7ac75b68090728a1d582af390d25609eb10c 100644 (file)
@@ -99,7 +99,7 @@ void SpecialCaseList::init(const MemoryBuffer *MB) {
     // Add this regexp into the proper group by its prefix.
     if (!Regexps[Prefix][Category].empty())
       Regexps[Prefix][Category] += "|";
     // Add this regexp into the proper group by its prefix.
     if (!Regexps[Prefix][Category].empty())
       Regexps[Prefix][Category] += "|";
-    Regexps[Prefix][Category] += Regexp;
+    Regexps[Prefix][Category] += "^" + Regexp + "$";
   }
 
   // Iterate through each of the prefixes, and create Regexs for them.
   }
 
   // Iterate through each of the prefixes, and create Regexs for them.