[llvm] r222401 - Remove support for undocumented SpecialCaseList entries.

Alexey Samsonov vonosmas at gmail.com
Wed Nov 19 17:27:19 PST 2014


Author: samsonov
Date: Wed Nov 19 19:27:19 2014
New Revision: 222401

URL: http://llvm.org/viewvc/llvm-project?rev=222401&view=rev
Log:
Remove support for undocumented SpecialCaseList entries.

"global-init", "global-init-src" and "global-init-type" were originally
used to blacklist entities in ASan init-order checker. However, they
were never documented, and later were replaced by "=init" category.

Old blacklist entries should be converted as follows:
  * global-init:foo -> global:foo=init
  * global-init-src:bar -> src:bar=init
  * global-init-type:baz -> type:baz=init


Modified:
    llvm/trunk/lib/Support/SpecialCaseList.cpp
    llvm/trunk/unittests/Support/SpecialCaseListTest.cpp

Modified: llvm/trunk/lib/Support/SpecialCaseList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SpecialCaseList.cpp?rev=222401&r1=222400&r2=222401&view=diff
==============================================================================
--- llvm/trunk/lib/Support/SpecialCaseList.cpp (original)
+++ llvm/trunk/lib/Support/SpecialCaseList.cpp Wed Nov 19 19:27:19 2014
@@ -103,18 +103,6 @@ bool SpecialCaseList::parse(const Memory
     std::string Regexp = SplitRegexp.first;
     StringRef Category = SplitRegexp.second;
 
-    // Backwards compatibility.
-    if (Prefix == "global-init") {
-      Prefix = "global";
-      Category = "init";
-    } else if (Prefix == "global-init-type") {
-      Prefix = "type";
-      Category = "init";
-    } else if (Prefix == "global-init-src") {
-      Prefix = "src";
-      Category = "init";
-    }
-
     // See if we can store Regexp in Strings.
     if (Regex::isLiteralERE(Regexp)) {
       Entries[Prefix][Category].Strings.insert(Regexp);

Modified: llvm/trunk/unittests/Support/SpecialCaseListTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/SpecialCaseListTest.cpp?rev=222401&r1=222400&r2=222401&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/SpecialCaseListTest.cpp (original)
+++ llvm/trunk/unittests/Support/SpecialCaseListTest.cpp Wed Nov 19 19:27:19 2014
@@ -49,7 +49,7 @@ TEST_F(SpecialCaseListTest, Basic) {
   EXPECT_FALSE(SCL->inSection("src", "hello", "category"));
 }
 
-TEST_F(SpecialCaseListTest, GlobalInitCompat) {
+TEST_F(SpecialCaseListTest, GlobalInit) {
   std::unique_ptr<SpecialCaseList> SCL =
       makeSpecialCaseList("global:foo=init\n");
   EXPECT_FALSE(SCL->inSection("global", "foo"));
@@ -57,34 +57,16 @@ TEST_F(SpecialCaseListTest, GlobalInitCo
   EXPECT_TRUE(SCL->inSection("global", "foo", "init"));
   EXPECT_FALSE(SCL->inSection("global", "bar", "init"));
 
-  SCL = makeSpecialCaseList("global-init:foo\n");
-  EXPECT_FALSE(SCL->inSection("global", "foo"));
-  EXPECT_FALSE(SCL->inSection("global", "bar"));
-  EXPECT_TRUE(SCL->inSection("global", "foo", "init"));
-  EXPECT_FALSE(SCL->inSection("global", "bar", "init"));
-
   SCL = makeSpecialCaseList("type:t2=init\n");
   EXPECT_FALSE(SCL->inSection("type", "t1"));
   EXPECT_FALSE(SCL->inSection("type", "t2"));
   EXPECT_FALSE(SCL->inSection("type", "t1", "init"));
   EXPECT_TRUE(SCL->inSection("type", "t2", "init"));
 
-  SCL = makeSpecialCaseList("global-init-type:t2\n");
-  EXPECT_FALSE(SCL->inSection("type", "t1"));
-  EXPECT_FALSE(SCL->inSection("type", "t2"));
-  EXPECT_FALSE(SCL->inSection("type", "t1", "init"));
-  EXPECT_TRUE(SCL->inSection("type", "t2", "init"));
-
   SCL = makeSpecialCaseList("src:hello=init\n");
   EXPECT_FALSE(SCL->inSection("src", "hello"));
   EXPECT_FALSE(SCL->inSection("src", "bye"));
   EXPECT_TRUE(SCL->inSection("src", "hello", "init"));
-  EXPECT_FALSE(SCL->inSection("src", "bye", "init"));
-
-  SCL = makeSpecialCaseList("global-init-src:hello\n");
-  EXPECT_FALSE(SCL->inSection("src", "hello"));
-  EXPECT_FALSE(SCL->inSection("src", "bye"));
-  EXPECT_TRUE(SCL->inSection("src", "hello", "init"));
   EXPECT_FALSE(SCL->inSection("src", "bye", "init"));
 }
 





More information about the llvm-commits mailing list