Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and many
[oota-llvm.git] / lib / CodeGen / ShadowStackGC.cpp
index 9d141e9c823b95cb18dc889035d379781dc7a4a3..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.
@@ -209,7 +207,7 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) {
 
   Constant *DescriptorElts[] = {
     ConstantStruct::get(BaseElts, 2),
-    Context.getConstantArray(Context.getArrayType(VoidPtr, NumMeta),
+    ConstantArray::get(ArrayType::get(VoidPtr, NumMeta),
                        Metadata.begin(), 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) {