]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8

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

index d432086e6e2352c19ce73367ead3671193f8b1b4..611a135e6c11fba63586fbf4566a0c7de3297321 100644 (file)
@@ -100,4 +100,4 @@ public:
 } // end clang namespace
 
 #endif
-  
\ No newline at end of file
+  
index 91db783a53524dd5f21e4d4098eee224e424cdce..72fd5f3dabbf5d2a4cd543278f81f3df3320b3fe 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 ffd19e371d9283dc32a786d3edf7c6bad1507449..86650a1e7e6611ea1c7bba6b5b2a59801e4c5d99 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 445efe8864b0173dea369acc5db7aef3a0ebede9..87b45d3af95f12b159030067bd885b37ec838b02 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 a64fb09eca17d3e6cc234b3200a913a1a064acbf..36c3256a2f3433625e29890fd3e1ca3a4527c8ac 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 b80b64ccced300933a753255593ae0741c67edc8..141d39359a0600b94e66753115fad2459fc53a29 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 40702ad9689936985dfe54160cf3d078f09e49b9..f2432ec973932e59af2da6c9209476453a8dde7c 100644 (file)
@@ -7,4 +7,4 @@ void f() {
     
     static void f() { }
   };
-}
\ No newline at end of file
+}
index adca33cc7c3734b70160a111450ca308de3ef6b2..9ab0260618935689b63af824b6744ca479f6b78b 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 9bafacc00a7b7f4019891e926bf2b6252c0ac768..bc4bb5da40118ae2fc17e472aeaa749c6081af68 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 8b70ded8ca63fe4f3c30394091b769a1e48e3d64..0b9ea35d11b6ed9461b666feb3589bbb744509d1 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 c505823a32ee34f1357c4c11423b0c4e75be5645..a09d0efa297f2596af64454212211bad03a3fe45 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 b13ca937641299a6fb1dc020e84aa4fc80bf27a9..2ddb8eac6c0add004e1dd224891c9971a3df1152 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 37cae38cac6ef3471d6f44c134386d9e8f836113..949a8b0a72c7b37eb874d1b407a9e6e1bcca2b1d 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 f4970b89f693e2f7998cb904f569fd3630fcb217..01030b2a8a20aad1ed49c50518baeecbd65a45e0 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 0a496392a82609bce8a0ae92a88c8aabb862f2ba..86a34500ad41554abb938b1f950cc7be76a444f1 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 bea3af2bb5af448c0fd3a82cc008860884c13802..1d3c5f65ec81713539fbe9185bb193bf7396ce04 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 b8f9622001e11094f9d4d881602884f150e6fba3..d04bbd84840777e820cacc07e079af1d2c642502 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
+}