From b83a67e1e3fe210bd99a82eccd3dc5b1b44f1503 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Mon, 13 Feb 2012 06:30:56 +0000 Subject: Fix various issues (or do cleanups) found by enabling certain MSVC warnings. - Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default. - Remove misplaced llvm_unreachable. - Add static to a declaration of a function on MSVC x86 only. - Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150364 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GlobalMerge.cpp | 4 ++-- lib/Transforms/Scalar/MemCpyOptimizer.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/Transforms') diff --git a/lib/Transforms/Scalar/GlobalMerge.cpp b/lib/Transforms/Scalar/GlobalMerge.cpp index ad8689a..c2bd6e6 100644 --- a/lib/Transforms/Scalar/GlobalMerge.cpp +++ b/lib/Transforms/Scalar/GlobalMerge.cpp @@ -193,8 +193,8 @@ bool GlobalMerge::doInitialization(Module &M) { continue; if (TD->getTypeAllocSize(Ty) < MaxOffset) { - const TargetLoweringObjectFile &TLOF = TLI->getObjFileLowering(); - if (TLOF.getKindForGlobal(I, TLI->getTargetMachine()).isBSSLocal()) + if (TargetLoweringObjectFile::getKindForGlobal(I, TLI->getTargetMachine()) + .isBSSLocal()) BSSGlobals.push_back(I); else if (I->isConstant()) ConstGlobals.push_back(I); diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 7335626..a87cce3 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -816,9 +816,8 @@ bool MemCpyOpt::processMemCpy(MemCpyInst *M) { } } } - - AliasAnalysis &AA = getAnalysis(); - AliasAnalysis::Location SrcLoc = AA.getLocationForSource(M); + + AliasAnalysis::Location SrcLoc = AliasAnalysis::getLocationForSource(M); MemDepResult SrcDepInfo = MD->getPointerDependencyFrom(SrcLoc, true, M, M->getParent()); if (SrcDepInfo.isClobber()) { -- cgit v1.1