Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and many
[oota-llvm.git] / lib / CodeGen / ShadowStackGC.cpp
index e3281d249260975eb9bd1445d53d71256b0421bb..b412532e331037a16e2f8069cd948d2b2e8ffda4 100644 (file)
@@ -188,8 +188,6 @@ ShadowStackGC::ShadowStackGC() : Head(0), StackEntryTy(0) {
 
 Constant *ShadowStackGC::GetFrameMap(Function &F) {
   // doInitialization creates the abstract type of this value.
-  LLVMContext &Context = F.getContext();
-
   Type *VoidPtr = PointerType::getUnqual(Type::Int8Ty);
 
   // Truncate the ShadowStackDescriptor if some metadata is null.
@@ -208,12 +206,12 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) {
   };
 
   Constant *DescriptorElts[] = {
-    Context.getConstantStruct(BaseElts, 2),
-    Context.getConstantArray(Context.getArrayType(VoidPtr, NumMeta),
+    ConstantStruct::get(BaseElts, 2),
+    ConstantArray::get(ArrayType::get(VoidPtr, NumMeta),
                        Metadata.begin(), NumMeta)
   };
 
-  Constant *FrameMap = Context.getConstantStruct(DescriptorElts, 2);
+  Constant *FrameMap = ConstantStruct::get(DescriptorElts, 2);
 
   std::string TypeName("gc_map.");
   TypeName += utostr(NumMeta);
@@ -238,7 +236,7 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) {
 
   Constant *GEPIndices[2] = { ConstantInt::get(Type::Int32Ty, 0),
                               ConstantInt::get(Type::Int32Ty, 0) };
-  return Context.getConstantExprGetElementPtr(GV, GEPIndices, 2);
+  return ConstantExpr::getGetElementPtr(GV, GEPIndices, 2);
 }
 
 const Type* ShadowStackGC::GetConcreteStackEntryType(Function &F) {