Skip to content

Commit

Permalink
Make LLVMContext and LLVMContextImpl classes instead of structs.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Aug 11, 2009
1 parent c588d55 commit 12ddd40
Show file tree
Hide file tree
Showing 40 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion include/llvm/Analysis/ConstantFolding.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace llvm {
class TargetData;
class Function;
class Type;
struct LLVMContext;
class LLVMContext;

/// ConstantFoldInstruction - Attempt to constant fold the specified
/// instruction. If successful, the constant result is returned, if not, null
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/DebugInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace llvm {
class DebugLoc;
struct DebugLocTracker;
class Instruction;
struct LLVMContext;
class LLVMContext;

class DIDescriptor {
protected:
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/ScalarEvolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace llvm {
class Type;
class ScalarEvolution;
class TargetData;
struct LLVMContext;
class LLVMContext;
class Loop;
class LoopInfo;
class Operator;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/SparsePropagation.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace llvm {
class BasicBlock;
class Function;
class SparseSolver;
struct LLVMContext;
class LLVMContext;

template<typename T> class SmallVectorImpl;

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/ValueTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace llvm {
class Instruction;
class APInt;
class TargetData;
struct LLVMContext;
class LLVMContext;

/// ComputeMaskedBits - Determine which of the bits specified in Mask are
/// known to be either zero or one and return them in the KnownZero/KnownOne
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Assembly/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace llvm {
class Module;
class SMDiagnostic;
class raw_ostream;
struct LLVMContext;
class LLVMContext;

/// This function is the main interface to the LLVM Assembly Parser. It parses
/// an ASCII file that (presumably) contains LLVM Assembly code. It returns a
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/BasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace llvm {

class TerminatorInst;
struct LLVMContext;
class LLVMContext;

template<> struct ilist_traits<Instruction>
: public SymbolTableListTraits<Instruction, BasicBlock> {
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Bitcode/Archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ModuleProvider; // From VMCore
class Module; // From VMCore
class Archive; // Declared below
class ArchiveMemberHeader; // Internal implementation class
struct LLVMContext; // Global data
class LLVMContext; // Global data

/// This class is the main class manipulated by users of the Archive class. It
/// holds information about one member of the Archive. It is also the element
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Bitcode/ReaderWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace llvm {
class MemoryBuffer;
class ModulePass;
class BitstreamWriter;
struct LLVMContext;
class LLVMContext;
class raw_ostream;

/// getBitcodeModuleProvider - Read the header of the specified bitcode buffer
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/CodeGen/ValueTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace llvm {
class Type;
struct LLVMContext;
class LLVMContext;

struct EVT { // EVT = Machine Value Type
public:
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace llvm {
class APInt;

template<typename T> class SmallVectorImpl;
struct LLVMContext;
class LLVMContext;

/// This is an important base class in LLVM. It provides the common facilities
/// of all constant values in an LLVM program. A constant is a value that is
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class ConstantFP : public Constant {
APFloat Val;
void *operator new(size_t, unsigned);// DO NOT IMPLEMENT
ConstantFP(const ConstantFP &); // DO NOT IMPLEMENT
friend struct LLVMContextImpl;
friend class LLVMContextImpl;
protected:
ConstantFP(const Type *Ty, const APFloat& V);
protected:
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Debugger/Debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace llvm {
class Module;
class InferiorProcess;
struct LLVMContext;
class LLVMContext;

/// Debugger class - This class implements the LLVM source-level debugger.
/// This allows clients to handle the user IO processing without having to
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/DerivedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PointerValType;
class VectorValType;
class IntegerValType;
class APInt;
struct LLVMContext;
class LLVMContext;

class DerivedType : public Type {
friend class Type;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace llvm {

class FunctionType;
struct LLVMContext;
class LLVMContext;

// Traits for intrusive list of basic blocks...
template<> struct ilist_traits<BasicBlock>
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/GlobalVariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace llvm {

class Module;
class Constant;
struct LLVMContext;
class LLVMContext;
template<typename ValueSubClass, typename ItemParentClass>
class SymbolTableListTraits;

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/InstrTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace llvm {

struct LLVMContext;
class LLVMContext;

//===----------------------------------------------------------------------===//
// TerminatorInst Class
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace llvm {

struct LLVMContext;
class LLVMContext;

template<typename ValueSubClass, typename ItemParentClass>
class SymbolTableListTraits;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace llvm {
class ConstantInt;
class ConstantRange;
class APInt;
struct LLVMContext;
class LLVMContext;

//===----------------------------------------------------------------------===//
// AllocationInst Class
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace llvm {
class Type;
class FunctionType;
class Function;
struct LLVMContext;
class LLVMContext;
class Module;
class AttrListPtr;

Expand Down
5 changes: 3 additions & 2 deletions include/llvm/LLVMContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

namespace llvm {

struct LLVMContextImpl;
class LLVMContextImpl;

/// This is an important class for using LLVM in a threaded context. It
/// (opaquely) owns and manages the core "global" data of LLVM's core
/// infrastructure, including the type and constant uniquing tables.
/// LLVMContext itself provides no locking guarantees, so you should be careful
/// to have one context per thread.
struct LLVMContext {
class LLVMContext {
public:
LLVMContextImpl* pImpl;
bool RemoveDeadMetadata();
LLVMContext();
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Linker.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace llvm {

class Module;
struct LLVMContext;
class LLVMContext;

/// This class provides the core functionality of linking in LLVM. It retains a
/// Module object which is the composite of the modules and libraries linked
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace llvm {
class Constant;
struct LLVMContext;
class LLVMContext;
template<class ConstantClass, class TypeClass, class ValType>
struct ConstantCreator;

Expand Down Expand Up @@ -205,7 +205,7 @@ template<typename ValueSubClass, typename ItemParentClass>

class NamedMDNode : public MetadataBase, public ilist_node<NamedMDNode> {
friend class SymbolTableListTraits<NamedMDNode, Module>;
friend struct LLVMContextImpl;
friend class LLVMContextImpl;

NamedMDNode(const NamedMDNode &); // DO NOT IMPLEMENT
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace llvm {

class GlobalValueRefMap; // Used by ConstantVals.cpp
class FunctionType;
struct LLVMContext;
class LLVMContext;

template<> struct ilist_traits<Function>
: public SymbolTableListTraits<Function, Module> {
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Support/ConstantFolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace llvm {

struct LLVMContext;
class LLVMContext;

/// ConstantFolder - Create constants with minimum, target independent, folding.
class ConstantFolder {
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Support/NoFolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace llvm {

struct LLVMContext;
class LLVMContext;

/// NoFolder - Create "constants" (actually, values) with no folding.
class NoFolder {
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Support/TargetFolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace llvm {

class TargetData;
struct LLVMContext;
class LLVMContext;

/// TargetFolder - Create constants with target dependent folding.
class TargetFolder {
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Transforms/Utils/Cloning.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CallGraph;
class TargetData;
class Loop;
class LoopInfo;
struct LLVMContext;
class LLVMContext;

/// CloneModule - Return an exact copy of the specified module
///
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Transforms/Utils/Local.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PHINode;
class AllocaInst;
class ConstantExpr;
class TargetData;
struct LLVMContext;
class LLVMContext;
struct DbgInfoIntrinsic;

template<typename T> class SmallVectorImpl;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Transforms/Utils/PromoteMemToReg.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AllocaInst;
class DominatorTree;
class DominanceFrontier;
class AliasSetTracker;
struct LLVMContext;
class LLVMContext;

/// isAllocaPromotable - Return true if this alloca is legal for promotion.
/// This is true if there are only loads and stores to the alloca...
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Transforms/Utils/ValueMapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace llvm {
class Value;
class Instruction;
struct LLVMContext;
class LLVMContext;
typedef DenseMap<const Value *, Value *> ValueMapTy;

Value *MapValue(const Value *V, ValueMapTy &VM, LLVMContext &Context);
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef StringMapEntry<Value*> ValueName;
class raw_ostream;
class AssemblyAnnotationWriter;
class ValueHandleBase;
struct LLVMContext;
class LLVMContext;

//===----------------------------------------------------------------------===//
// Value Class
Expand Down
2 changes: 1 addition & 1 deletion lib/Archive/ArchiveInternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace llvm {

struct LLVMContext;
class LLVMContext;

/// The ArchiveMemberHeader structure is used internally for bitcode
/// archives.
Expand Down
2 changes: 1 addition & 1 deletion lib/AsmParser/LLLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace llvm {
class MemoryBuffer;
class Type;
class SMDiagnostic;
struct LLVMContext;
class LLVMContext;

class LLLexer {
const char *CurPtr;
Expand Down
2 changes: 1 addition & 1 deletion lib/Bitcode/Reader/BitcodeReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace llvm {
class MemoryBuffer;
struct LLVMContext;
class LLVMContext;

//===----------------------------------------------------------------------===//
// BitcodeReaderValueList Class
Expand Down
2 changes: 1 addition & 1 deletion lib/VMCore/ConstantFold.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace llvm {
class Value;
class Constant;
class Type;
struct LLVMContext;
class LLVMContext;

// Constant fold various types of instruction...
Constant *ConstantFoldCastInstruction(
Expand Down
2 changes: 1 addition & 1 deletion lib/VMCore/LLVMContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// This file implements LLVMContext, as a wrapper around the opaque
// struct LLVMContextImpl.
// class LLVMContextImpl.
//
//===----------------------------------------------------------------------===//

Expand Down
5 changes: 3 additions & 2 deletions lib/VMCore/LLVMContextImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ConstantInt;
class ConstantFP;
class MDString;
class MDNode;
struct LLVMContext;
class LLVMContext;
class Type;
class Value;

Expand Down Expand Up @@ -90,7 +90,8 @@ struct DenseMapAPFloatKeyInfo {
static bool isPod() { return false; }
};

struct LLVMContextImpl {
class LLVMContextImpl {
public:
sys::SmartRWMutex<true> ConstantsLock;

typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*,
Expand Down
2 changes: 1 addition & 1 deletion tools/bugpoint/BugDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Function;
class BasicBlock;
class AbstractInterpreter;
class Instruction;
struct LLVMContext;
class LLVMContext;

class DebugCrashes;

Expand Down
2 changes: 1 addition & 1 deletion tools/llvm-db/CLIDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace llvm {
struct SourceLanguage;
class ProgramInfo;
class RuntimeInfo;
struct LLVMContext;
class LLVMContext;

/// CLIDebugger - This class implements the command line interface for the
/// LLVM debugger.
Expand Down

0 comments on commit 12ddd40

Please sign in to comment.