Update for LLVM API change.
authorOwen Anderson <resistor@mac.com>
Mon, 27 Jul 2009 21:00:51 +0000 (21:00 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 27 Jul 2009 21:00:51 +0000 (21:00 +0000)
llvm-svn: 77249

17 files changed:
clang/include/clang/Analysis/PathSensitive/Checker.h
clang/include/clang/Analysis/PathSensitive/CheckerVisitor.h
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGExprComplex.cpp
clang/lib/CodeGen/CGExprConstant.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/test/CXX/class/class.local/p4.cpp
clang/test/CXX/over/over.over/p2.cpp
clang/test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp
clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp
clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
clang/test/CodeGenCXX/function-template-specialization.cpp
clang/test/SemaTemplate/implicit-instantiation-1.cpp

index 91db783..72fd5f3 100644 (file)
@@ -51,4 +51,4 @@ void PreVisit ## NAME(CheckerContext &C, const NAME* S) {}
 } // end clang namespace
 
 #endif
-  
\ No newline at end of file
+  
index ffd19e3..86650a1 100644 (file)
@@ -66,7 +66,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
       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) {
index 445efe8..87b45d3 100644 (file)
@@ -367,8 +367,6 @@ ComplexPairTy ComplexExprEmitter::EmitCast(Expr *Op, QualType DestTy) {
 
 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 @@ ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
     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");
index a64fb09..36c3256 100644 (file)
@@ -879,12 +879,14 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
       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 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
         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());
     }
index b80b64c..141d393 100644 (file)
@@ -112,7 +112,7 @@ public:
     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 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
     // 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");
   }
index 40702ad..f2432ec 100644 (file)
@@ -7,4 +7,4 @@ void f() {
     
     static void f() { }
   };
-}
\ No newline at end of file
+}
index adca33c..9ab0260 100644 (file)
@@ -7,4 +7,4 @@ void test_f0() {
   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
+}
index 9bafacc..bc4bb5d 100644 (file)
@@ -24,4 +24,4 @@ void test(int i, float f) {
   inner2.x = &i;
   inner2.y = &f;
   inner2.f(); // expected-note{{instantiation}}
-}
\ No newline at end of file
+}
index 8b70ded..0b9ea35 100644 (file)
@@ -9,4 +9,4 @@ struct X0 {
 };
 
 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 { }
index c505823..a09d0ef 100644 (file)
@@ -14,4 +14,4 @@ void X0<T, U>::f(T *t, const U &u) {
 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
+}
index b13ca93..2ddb8ea 100644 (file)
@@ -25,4 +25,4 @@ unsigned long sizeOkay() { return sizeof(X<CannotInit>::value); }
   
 CannotInit &returnError() {
   return X<CannotInit>::value; // expected-note{{instantiation}}
-}
\ No newline at end of file
+}
index 37cae38..949a8b0 100644 (file)
@@ -23,4 +23,4 @@ X2& get_X2() {
   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}}
index f4970b8..01030b2 100644 (file)
@@ -8,4 +8,4 @@ void g() {
   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
+}
index 0a49639..86a3450 100644 (file)
@@ -19,4 +19,4 @@ void test_f1() {
   float (*f1d)(float) = (f1);
   float (*f1e)(float) = &f1;
   float (*f1f)(float) = (&f1);
-}
\ No newline at end of file
+}
index bea3af2..1d3c5f6 100644 (file)
@@ -24,4 +24,4 @@ void test2(int *iptr, double *dptr, int diff) {
   // FIXME: should be "_Z4nextIdiEPT_S1_RKT0_"
   // RUN: grep "_Z4nextIdiEPdPdRKi" %t
   dptr = next(dptr, diff);
-}
\ No newline at end of file
+}
index b8f9622..d04bbd8 100644 (file)
@@ -22,4 +22,4 @@ void test_add(char *cp, int i, int *ip) {
   char* cp2 = add(cp, i);
   add(cp, cp); // expected-note{{instantiation of}}
   (void)sizeof(add(ip, ip));
-}
\ No newline at end of file
+}