[poolalloc] r220630 - Fix invalid string comparison due to API change.

Will Dietz wdietz2 at illinois.edu
Sat Oct 25 18:11:26 PDT 2014


Author: wdietz2
Date: Sat Oct 25 20:11:26 2014
New Revision: 220630

URL: http://llvm.org/viewvc/llvm-project?rev=220630&view=rev
Log:
Fix invalid string comparison due to API change.

This was caught by warnings.

Testcases for behavior in this code would be nice!

Modified:
    poolalloc/trunk/lib/DSA/Local.cpp

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=220630&r1=220629&r2=220630&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Sat Oct 25 20:11:26 2014
@@ -1452,7 +1452,7 @@ bool LocalDataStructures::runOnModule(Mo
     // Add initializers for all of the globals to the globals graph.
     for (Module::global_iterator I = M.global_begin(), E = M.global_end();
          I != E; ++I)
-      if (!(I->hasSection() && I->getSection() == "llvm.metadata")) {
+      if (!(I->hasSection() && StringRef(I->getSection()) == "llvm.metadata")) {
         if (I->isDeclaration())
           GGB.mergeExternalGlobal(I);
         else





More information about the llvm-commits mailing list