]> granicus.if.org Git - llvm/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309281 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/FunctionImportUtils.cpp

index 36cbd98052c33748de04ab8fc48fe82a2d8144b4..fbb61ac1ae91499f5a7b8f6003d813c030fd37b8 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(