aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-02-20 11:08:44 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-02-20 11:08:44 +0000
commitae9f3a3b7c915f725aef5a7250e88eaeddda03c6 (patch)
treeb32dad9e6075f8f292819f06d26e306fc94427a0 /lib/Analysis
parent6d794746b7ae1ed531f08c04dd29d79c13b35075 (diff)
downloadexternal_llvm-ae9f3a3b7c915f725aef5a7250e88eaeddda03c6.zip
external_llvm-ae9f3a3b7c915f725aef5a7250e88eaeddda03c6.tar.gz
external_llvm-ae9f3a3b7c915f725aef5a7250e88eaeddda03c6.tar.bz2
Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/Analysis.cpp1
-rw-r--r--lib/Analysis/IPA/Andersens.cpp4
-rw-r--r--lib/Analysis/IPA/GlobalsModRef.cpp3
-rw-r--r--lib/Analysis/ScalarEvolution.cpp3
4 files changed, 7 insertions, 4 deletions
diff --git a/lib/Analysis/Analysis.cpp b/lib/Analysis/Analysis.cpp
index 2c52dbd..6b741bc 100644
--- a/lib/Analysis/Analysis.cpp
+++ b/lib/Analysis/Analysis.cpp
@@ -10,6 +10,7 @@
#include "llvm-c/Analysis.h"
#include "llvm/Analysis/Verifier.h"
#include <fstream>
+#include <cstring>
using namespace llvm;
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 037f331..399ce1f 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -139,7 +139,7 @@ namespace {
Constraint(ConstraintType Ty, unsigned D, unsigned S, unsigned O = 0)
: Type(Ty), Dest(D), Src(S), Offset(O) {
- assert(Offset == 0 || Ty != AddressOf &&
+ assert((Offset == 0 || Ty != AddressOf) &&
"Offset is illegal on addressof constraints");
}
@@ -1931,7 +1931,7 @@ void Andersens::RewriteConstraints() {
C.Src = FindEquivalentNode(RHSNode, RHSLabel);
C.Dest = FindEquivalentNode(FindNode(LHSNode), LHSLabel);
- if (C.Src == C.Dest && C.Type == Constraint::Copy
+ if ((C.Src == C.Dest && C.Type == Constraint::Copy)
|| Seen.count(C))
continue;
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index 880298e..9aafe37 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -115,11 +115,12 @@ namespace {
/// case the most generic behavior of this function should be returned.
virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
std::vector<PointerAccessInfo> *Info) {
- if (FunctionRecord *FR = getFunctionInfo(F))
+ if (FunctionRecord *FR = getFunctionInfo(F)) {
if (FR->FunctionEffect == 0)
return DoesNotAccessMemory;
else if ((FR->FunctionEffect & Mod) == 0)
return OnlyReadsMemory;
+ }
return AliasAnalysis::getModRefBehavior(F, CS, Info);
}
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 7f1cac0..30cf950 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -2145,13 +2145,14 @@ static PHINode *getConstantEvolvingPHI(Value *V, const Loop *L) {
Instruction *I = dyn_cast<Instruction>(V);
if (I == 0 || !L->contains(I->getParent())) return 0;
- if (PHINode *PN = dyn_cast<PHINode>(I))
+ if (PHINode *PN = dyn_cast<PHINode>(I)) {
if (L->getHeader() == I->getParent())
return PN;
else
// We don't currently keep track of the control flow needed to evaluate
// PHIs, so we cannot handle PHIs inside of loops.
return 0;
+ }
// If we won't be able to constant fold this expression even if the operands
// are constants, return early.