From 2b45395876c6f351a21b258a32cbeedb80c1146e Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Fri, 16 Jan 2015 20:07:33 +0000 Subject: Move ownership of GCStrategy objects to LLVMContext Note: This change ended up being slightly more controversial than expected. Chandler has tentatively okayed this for the moment, but I may be revisiting this in the near future after we settle some high level questions. Rather than have the GCStrategy object owned by the GCModuleInfo - which is an immutable analysis pass used mainly by gc.root - have it be owned by the LLVMContext. This simplifies the ownership logic (i.e. can you have two instances of the same strategy at once?), but more importantly, allows us to access the GCStrategy in the middle end optimizer. To this end, I add an accessor through Function which becomes the canonical way to get at a GCStrategy instance. In the near future, this will allows me to move some of the checks from http://reviews.llvm.org/D6808 into the Verifier itself, and to introduce optimization legality predicates for some of the recent additions to InstCombine. (These will follow as separate changes.) Differential Revision: http://reviews.llvm.org/D6811 llvm-svn: 226311 --- llvm/lib/CodeGen/GCStrategy.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 llvm/lib/CodeGen/GCStrategy.cpp (limited to 'llvm/lib/CodeGen/GCStrategy.cpp') diff --git a/llvm/lib/CodeGen/GCStrategy.cpp b/llvm/lib/CodeGen/GCStrategy.cpp deleted file mode 100644 index 2b687d9dd20..00000000000 --- a/llvm/lib/CodeGen/GCStrategy.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===-- GCStrategy.cpp - Garbage Collector Description --------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the policy object GCStrategy which describes the -// behavior of a given garbage collector. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CodeGen/GCStrategy.h" - -using namespace llvm; - -GCStrategy::GCStrategy() - : UseStatepoints(false), NeededSafePoints(0), CustomReadBarriers(false), - CustomWriteBarriers(false), CustomRoots(false), - InitRoots(true), UsesMetadata(false) {} -- cgit v1.2.3