summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorevgeny <eleviant@accesssoftek.com>2019-11-15 16:13:19 +0300
committerevgeny <eleviant@accesssoftek.com>2019-11-15 16:13:19 +0300
commit3d708bf5c2672cae01e5ecb0ed1877e3d56ee451 (patch)
tree24fe2d3ee2ecc0286cd4a07a4b90d890605a8fdb /llvm/lib/Transforms/Utils
parent5f0c3bad2f03b9bba7f899d7b0ce667ca355f69d (diff)
downloadbcm5719-llvm-3d708bf5c2672cae01e5ecb0ed1877e3d56ee451.tar.gz
bcm5719-llvm-3d708bf5c2672cae01e5ecb0ed1877e3d56ee451.zip
Recommit "[ThinLTO] Add correctness check for RO/WO variable import"
ValueInfo has user-defined 'operator bool' which allows incorrect implicit conversion to GlobalValue::GUID (which is unsigned long). This causes bugs which are hard to track and should be removed in future.
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/FunctionImportUtils.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
index 401be682043..d795a0a2070 100644
--- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
+++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
@@ -250,12 +250,12 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
// contains summaries from the source modules if they are being imported.
// We might have a non-null VI and get here even in that case if the name
// matches one in this module (e.g. weak or appending linkage).
- auto* GVS = dyn_cast_or_null<GlobalVarSummary>(
- ImportIndex.findSummaryInModule(VI, M.getModuleIdentifier()));
+ auto *GVS = dyn_cast_or_null<GlobalVarSummary>(
+ ImportIndex.findSummaryInModule(VI, M.getModuleIdentifier()));
if (GVS &&
(ImportIndex.isReadOnly(GVS) || ImportIndex.isWriteOnly(GVS))) {
V->addAttribute("thinlto-internalize");
- // Objects referenced by writeonly GV initializer should not be
+ // Objects referenced by writeonly GV initializer should not be
// promoted, because there is no any kind of read access to them
// on behalf of this writeonly GV. To avoid promotion we convert
// GV initializer to 'zeroinitializer'. This effectively drops
OpenPOWER on IntegriCloud