Fix assert from r309278
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 27 Jul 2017 15:28:10 +0000 (15:28 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 27 Jul 2017 15:28:10 +0000 (15:28 +0000)
llvm-svn: 309281

llvm/lib/Transforms/Utils/FunctionImportUtils.cpp

index 36cbd98..fbb61ac 100644 (file)
@@ -24,14 +24,14 @@ bool FunctionImportGlobalProcessing::doImportAsDefinition(
     const GlobalValue *SGV, SetVector<GlobalValue *> *GlobalsToImport) {
 
   // Only import the globals requested for importing.
-  if (GlobalsToImport->count(const_cast<GlobalValue *>(SGV)))
-    return true;
+  if (!GlobalsToImport->count(const_cast<GlobalValue *>(SGV)))
+    return false;
 
   assert(!isa<GlobalAlias>(SGV) &&
          "Unexpected global alias in the import list.");
 
-  // Otherwise no.
-  return false;
+  // Otherwise yes.
+  return true;
 }
 
 bool FunctionImportGlobalProcessing::doImportAsDefinition(