From 60c77079d4767133a587c1c9390f2f5fd43fba9f Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Mon, 16 Apr 2012 16:29:47 +0000 Subject: [PATCH] Adjust for LLVM name tweaks requested by Chandler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154824 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 6 +++--- lib/CodeGen/CodeGenTBAA.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index e585c5796a..5f2b1f055d 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -910,7 +910,7 @@ llvm::MDNode *CodeGenFunction::getRangeForLoadFromType(QualType Ty) { } llvm::MDBuilder MDHelper(getLLVMContext()); - return MDHelper.CreateRange(Min, End); + return MDHelper.createRange(Min, End); } llvm::Value *CodeGenFunction::EmitLoadOfScalar(llvm::Value *Addr, bool Volatile, @@ -3166,8 +3166,8 @@ void CodeGenFunction::SetFPAccuracy(llvm::Value *Val, float Accuracy) { if (Accuracy == 0.0 || !isa(Val)) return; - llvm::Value *ULPs = llvm::ConstantFP::get(Builder.getFloatTy(), Accuracy); - llvm::MDNode *Node = llvm::MDNode::get(getLLVMContext(), ULPs); + llvm::MDBuilder MDHelper(getLLVMContext()); + llvm::MDNode *Node = MDHelper.createFPMath(Accuracy); cast(Val)->setMetadata(llvm::LLVMContext::MD_fpmath, Node); } diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp index 34f91e1621..a3cadcf392 100644 --- a/lib/CodeGen/CodeGenTBAA.cpp +++ b/lib/CodeGen/CodeGenTBAA.cpp @@ -40,7 +40,7 @@ llvm::MDNode *CodeGenTBAA::getRoot() { // (or a different version of this front-end), their TBAA trees will // remain distinct, and the optimizer will treat them conservatively. if (!Root) - Root = MDHelper.CreateTBAARoot("Simple C/C++ TBAA"); + Root = MDHelper.createTBAARoot("Simple C/C++ TBAA"); return Root; } @@ -51,7 +51,7 @@ llvm::MDNode *CodeGenTBAA::getChar() { // these special powers only cover user-accessible memory, and doesn't // include things like vtables. if (!Char) - Char = MDHelper.CreateTBAANode("omnipotent char", getRoot()); + Char = MDHelper.createTBAANode("omnipotent char", getRoot()); return Char; } @@ -115,7 +115,7 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { // "underlying types". default: return MetadataCache[Ty] = - MDHelper.CreateTBAANode(BTy->getName(Features), getChar()); + MDHelper.createTBAANode(BTy->getName(Features), getChar()); } } @@ -123,7 +123,7 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { // TODO: Implement C++'s type "similarity" and consider dis-"similar" // pointers distinct. if (Ty->isPointerType()) - return MetadataCache[Ty] = MDHelper.CreateTBAANode("any pointer", + return MetadataCache[Ty] = MDHelper.createTBAANode("any pointer", getChar()); // Enum types are distinct types. In C++ they have "underlying types", @@ -151,7 +151,7 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { llvm::raw_svector_ostream Out(OutName); MContext.mangleCXXRTTIName(QualType(ETy, 0), Out); Out.flush(); - return MetadataCache[Ty] = MDHelper.CreateTBAANode(OutName, getChar()); + return MetadataCache[Ty] = MDHelper.createTBAANode(OutName, getChar()); } // For now, handle any other kind of type conservatively. @@ -159,5 +159,5 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { } llvm::MDNode *CodeGenTBAA::getTBAAInfoForVTablePtr() { - return MDHelper.CreateTBAANode("vtable pointer", getRoot()); + return MDHelper.createTBAANode("vtable pointer", getRoot()); } -- 2.40.0