Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Analysis/PathSensitive/Checker.h b/include/clang/Analysis/PathSensitive/Checker.h
index d432086..611a135 100644
--- a/include/clang/Analysis/PathSensitive/Checker.h
+++ b/include/clang/Analysis/PathSensitive/Checker.h
@@ -100,4 +100,4 @@
} // end clang namespace
#endif
-
\ No newline at end of file
+
diff --git a/include/clang/Analysis/PathSensitive/CheckerVisitor.h b/include/clang/Analysis/PathSensitive/CheckerVisitor.h
index 91db783..72fd5f3 100644
--- a/include/clang/Analysis/PathSensitive/CheckerVisitor.h
+++ b/include/clang/Analysis/PathSensitive/CheckerVisitor.h
@@ -51,4 +51,4 @@
} // end clang namespace
#endif
-
\ No newline at end of file
+
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index ffd19e3..86650a1 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -66,7 +66,7 @@
return RValue::get(llvm::ConstantInt::get(VMContext,
Result.Val.getInt()));
else if (Result.Val.isFloat())
- return RValue::get(VMContext.getConstantFP(Result.Val.getFloat()));
+ return RValue::get(ConstantFP::get(VMContext, Result.Val.getFloat()));
}
switch (BuiltinID) {
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index 445efe8..87b45d3 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -367,8 +367,6 @@
ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
bool isInc, bool isPre) {
- llvm::LLVMContext &VMContext = CGF.getLLVMContext();
-
LValue LV = CGF.EmitLValue(E->getSubExpr());
ComplexPairTy InVal = EmitLoadOfComplex(LV.getAddress(),
LV.isVolatileQualified());
@@ -386,7 +384,7 @@
llvm::APFloat FVal(CGF.getContext().getFloatTypeSemantics(ElemTy), 1);
if (!isInc)
FVal.changeSign();
- NextVal = VMContext.getConstantFP(FVal);
+ NextVal = llvm::ConstantFP::get(CGF.getLLVMContext(), FVal);
// Add the inc/dec to the real part.
NextVal = Builder.CreateFAdd(InVal.first, NextVal, isInc ? "inc" : "dec");
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index a64fb09..36c3256 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -879,12 +879,14 @@
return VMContext.getConstantStruct(Complex, 2);
}
case APValue::Float:
- return VMContext.getConstantFP(Result.Val.getFloat());
+ return llvm::ConstantFP::get(VMContext, Result.Val.getFloat());
case APValue::ComplexFloat: {
llvm::Constant *Complex[2];
- Complex[0] = VMContext.getConstantFP(Result.Val.getComplexFloatReal());
- Complex[1] = VMContext.getConstantFP(Result.Val.getComplexFloatImag());
+ Complex[0] = llvm::ConstantFP::get(VMContext,
+ Result.Val.getComplexFloatReal());
+ Complex[1] = llvm::ConstantFP::get(VMContext,
+ Result.Val.getComplexFloatImag());
return VMContext.getConstantStruct(Complex, 2);
}
@@ -897,7 +899,7 @@
if (Elt.isInt())
Inits.push_back(llvm::ConstantInt::get(VMContext, Elt.getInt()));
else
- Inits.push_back(VMContext.getConstantFP(Elt.getFloat()));
+ Inits.push_back(llvm::ConstantFP::get(VMContext, Elt.getFloat()));
}
return VMContext.getConstantVector(&Inits[0], Inits.size());
}
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index b80b64c..141d393 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -112,7 +112,7 @@
return llvm::ConstantInt::get(VMContext, E->getValue());
}
Value *VisitFloatingLiteral(const FloatingLiteral *E) {
- return VMContext.getConstantFP(E->getValue());
+ return llvm::ConstantFP::get(VMContext, E->getValue());
}
Value *VisitCharacterLiteral(const CharacterLiteral *E) {
return llvm::ConstantInt::get(ConvertType(E->getType()), E->getValue());
@@ -731,16 +731,18 @@
// Add the inc/dec to the real part.
if (InVal->getType() == llvm::Type::FloatTy)
NextVal =
- VMContext.getConstantFP(llvm::APFloat(static_cast<float>(AmountVal)));
+ llvm::ConstantFP::get(VMContext,
+ llvm::APFloat(static_cast<float>(AmountVal)));
else if (InVal->getType() == llvm::Type::DoubleTy)
NextVal =
- VMContext.getConstantFP(llvm::APFloat(static_cast<double>(AmountVal)));
+ llvm::ConstantFP::get(VMContext,
+ llvm::APFloat(static_cast<double>(AmountVal)));
else {
llvm::APFloat F(static_cast<float>(AmountVal));
bool ignored;
F.convert(CGF.Target.getLongDoubleFormat(), llvm::APFloat::rmTowardZero,
&ignored);
- NextVal = VMContext.getConstantFP(F);
+ NextVal = llvm::ConstantFP::get(VMContext, F);
}
NextVal = Builder.CreateFAdd(InVal, NextVal, isInc ? "inc" : "dec");
}
diff --git a/test/CXX/class/class.local/p4.cpp b/test/CXX/class/class.local/p4.cpp
index 40702ad..f2432ec 100644
--- a/test/CXX/class/class.local/p4.cpp
+++ b/test/CXX/class/class.local/p4.cpp
@@ -7,4 +7,4 @@
static void f() { }
};
-}
\ No newline at end of file
+}
diff --git a/test/CXX/over/over.over/p2.cpp b/test/CXX/over/over.over/p2.cpp
index adca33c..9ab0260 100644
--- a/test/CXX/over/over.over/p2.cpp
+++ b/test/CXX/over/over.over/p2.cpp
@@ -7,4 +7,4 @@
int (*f0b)(int, int) = &f0;
int (*f0c)(int, float) = f0; // expected-error{{incompatible type}}
// FIXME: poor error message above!
-}
\ No newline at end of file
+}
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp b/test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp
index 9bafacc..bc4bb5d 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp
@@ -24,4 +24,4 @@
inner2.x = &i;
inner2.y = &f;
inner2.f(); // expected-note{{instantiation}}
-}
\ No newline at end of file
+}
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp
index 8b70ded..0b9ea35 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp
@@ -9,4 +9,4 @@
};
template<typename T>
-typename X0<T>::size_type X0<T>::f0() const { }
\ No newline at end of file
+typename X0<T>::size_type X0<T>::f0() const { }
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
index c505823..a09d0ef 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
@@ -14,4 +14,4 @@
void test_f(X0<float, int> xfi, X0<void, int> xvi, float *fp, void *vp, int i) {
xfi.f(fp, i);
xvi.f(vp, i); // expected-note{{instantiation}}
-}
\ No newline at end of file
+}
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp b/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
index b13ca93..2ddb8ea 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
@@ -25,4 +25,4 @@
CannotInit &returnError() {
return X<CannotInit>::value; // expected-note{{instantiation}}
-}
\ No newline at end of file
+}
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp b/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
index 37cae38..949a8b0 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
@@ -23,4 +23,4 @@
return X0<X2>::value; // expected-note{{instantiation}}
}
-template<typename T> T x; // expected-error{{variable 'x' declared as a template}}
\ No newline at end of file
+template<typename T> T x; // expected-error{{variable 'x' declared as a template}}
diff --git a/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp b/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
index f4970b8..01030b2 100644
--- a/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
+++ b/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
@@ -8,4 +8,4 @@
f<int>("aa",3.0); // Y is deduced to be char*, and
// Z is deduced to be double
f("aa",3.0); // expected-error{{no matching}}
-}
\ No newline at end of file
+}
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
index 0a49639..86a3450 100644
--- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
+++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
@@ -19,4 +19,4 @@
float (*f1d)(float) = (f1);
float (*f1e)(float) = &f1;
float (*f1f)(float) = (&f1);
-}
\ No newline at end of file
+}
diff --git a/test/CodeGenCXX/function-template-specialization.cpp b/test/CodeGenCXX/function-template-specialization.cpp
index bea3af2..1d3c5f6 100644
--- a/test/CodeGenCXX/function-template-specialization.cpp
+++ b/test/CodeGenCXX/function-template-specialization.cpp
@@ -24,4 +24,4 @@
// FIXME: should be "_Z4nextIdiEPT_S1_RKT0_"
// RUN: grep "_Z4nextIdiEPdPdRKi" %t
dptr = next(dptr, diff);
-}
\ No newline at end of file
+}
diff --git a/test/SemaTemplate/implicit-instantiation-1.cpp b/test/SemaTemplate/implicit-instantiation-1.cpp
index b8f9622..d04bbd8 100644
--- a/test/SemaTemplate/implicit-instantiation-1.cpp
+++ b/test/SemaTemplate/implicit-instantiation-1.cpp
@@ -22,4 +22,4 @@
char* cp2 = add(cp, i);
add(cp, cp); // expected-note{{instantiation of}}
(void)sizeof(add(ip, ip));
-}
\ No newline at end of file
+}