Adding dllimport, dllexport and external weak linkage types.
[oota-llvm.git] / lib / Transforms / IPO / SimplifyLibCalls.cpp
index 79cdf28e0a4bfeeb02b241cade09828b81eb540c..9f9c52788bc5c4101fc7cab3d1330f322c4924de 100644 (file)
@@ -178,8 +178,10 @@ public:
         // All the "well-known" functions are external and have external linkage
         // because they live in a runtime library somewhere and were (probably)
         // not compiled by LLVM.  So, we only act on external functions that
-        // have external linkage and non-empty uses.
-        if (!FI->isExternal() || !FI->hasExternalLinkage() || FI->use_empty())
+        // have external or dllimport linkage and non-empty uses.
+        if (!FI->isExternal() ||
+            !(FI->hasExternalLinkage() || FI->hasDLLImportLinkage()) ||
+            FI->use_empty())
           continue;
 
         // Get the optimization class that pertains to this function