class Function;
class GlobalVariable;
class Module;
+ class Type;
class Value;
class DIDescriptor {
bool isNull() const { return GV == 0; }
GlobalVariable *getGV() const { return GV; }
-
- /// getCastToEmpty - Return this descriptor as a Constant* with type '{}*'.
- Constant *getCastToEmpty() const;
};
/// DIAnchor - A wrapper for various anchor descriptors.
/// DIGlobal - This is a common class for global variables and subprograms.
class DIGlobal : public DIDescriptor {
protected:
- explicit DIGlobal(GlobalVariable *GV = 0, unsigned RequiredTag)
+ explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag)
: DIDescriptor(GV, RequiredTag) {}
public:
Module &M;
// Cached values for uniquing and faster lookups.
DIAnchor CompileUnitAnchor, SubProgramAnchor, GlobalVariableAnchor;
+ const Type *EmptyStructPtr; // "{}*".
Function *StopPointFn; // llvm.dbg.stoppoint
Function *FuncStartFn; // llvm.dbg.func.start
Function *RegionStartFn; // llvm.dbg.region.start
DIFactory(const DIFactory &); // DO NOT IMPLEMENT
void operator=(const DIFactory&); // DO NOT IMPLEMENT
public:
- explicit DIFactory(Module &m) : M(m) {
- StopPointFn = FuncStartFn = RegionStartFn = RegionEndFn = DeclareFn = 0;
- }
+ explicit DIFactory(Module &m);
/// GetOrCreateCompileUnitAnchor - Return the anchor for compile units,
/// creating a new one if there isn't already one in the module.
Constant *GetTagConstant(unsigned TAG);
Constant *GetStringConstant(const std::string &String);
DIAnchor GetOrCreateAnchor(unsigned TAG, const char *Name);
+
+ /// getCastToEmpty - Return the descriptor as a Constant* with type '{}*'.
+ Constant *getCastToEmpty(DIDescriptor D);
};