Edit requests from Sabre.

llvm-svn: 26018
This commit is contained in:
Jim Laskey 2006-02-06 19:12:02 +00:00
parent f5b7f16259
commit b643ff5546
2 changed files with 106 additions and 110 deletions

View File

@ -11,7 +11,7 @@
// neutral form that can be used by different debugging schemes. // neutral form that can be used by different debugging schemes.
// //
// The organization of information is primarily clustered around the source // The organization of information is primarily clustered around the source
// compile units. The main exception is source line coorespondence where // compile units. The main exception is source line correspondence where
// inlining may interleave code from various compile units. // inlining may interleave code from various compile units.
// //
// The following information can be retrieved from the MachineDebugInfo. // The following information can be retrieved from the MachineDebugInfo.
@ -23,7 +23,7 @@
// -- Source line coorespondence - A vector of file ID, line#, column# triples. // -- Source line coorespondence - A vector of file ID, line#, column# triples.
// A DEBUG_LOCATION instruction is generated by the DAG Legalizer // A DEBUG_LOCATION instruction is generated by the DAG Legalizer
// corresponding to each entry in the source line list. This allows a debug // corresponding to each entry in the source line list. This allows a debug
// emitter to generate labels referenced by degug information tables. // emitter to generate labels referenced by debug information tables.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -50,9 +50,12 @@ class StructType;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Debug info constants. // Debug info constants.
// Invalid result indicator.
#define DIINVALID (~0U)
enum { enum {
LLVMDebugVersion = 1, // Current version of debug information. LLVMDebugVersion = 1, // Current version of debug information.
DIInvalid = ~0U, // Invalid result indicator.
// DebugInfoDesc type identifying tags. // DebugInfoDesc type identifying tags.
// FIXME - Change over with gcc4. // FIXME - Change over with gcc4.
@ -68,15 +71,15 @@ enum {
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DIApplyManager - Subclasses of this class apply steps to each of the fields /// DIVisitor - Subclasses of this class apply steps to each of the fields in
/// in the supplied DebugInfoDesc. /// the supplied DebugInfoDesc.
class DIApplyManager { class DIVisitor {
public: public:
DIApplyManager() {} DIVisitor() {}
virtual ~DIApplyManager() {} virtual ~DIVisitor() {}
/// ApplyToFields - Target the manager to each field of the debug information /// ApplyToFields - Target the visitor to each field of the debug information
/// descriptor. /// descriptor.
void ApplyToFields(DebugInfoDesc *DD); void ApplyToFields(DebugInfoDesc *DD);
@ -109,8 +112,8 @@ public:
unsigned getTag() const { return Tag; } unsigned getTag() const { return Tag; }
/// TagFromGlobal - Returns the Tag number from a debug info descriptor /// TagFromGlobal - Returns the Tag number from a debug info descriptor
/// GlobalVariable. /// GlobalVariable. Return DIIValid if operand is not an unsigned int.
static unsigned TagFromGlobal(GlobalVariable *GV, bool Checking = false); static unsigned TagFromGlobal(GlobalVariable *GV);
/// DescFactory - Create an instance of debug info descriptor based on Tag. /// DescFactory - Create an instance of debug info descriptor based on Tag.
/// Return NULL if not a recognized Tag. /// Return NULL if not a recognized Tag.
@ -125,9 +128,9 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Subclasses should supply the following virtual methods. // Subclasses should supply the following virtual methods.
/// ApplyToFields - Target the apply manager to the fields of the descriptor. /// ApplyToFields - Target the vistor to the fields of the descriptor.
/// ///
virtual void ApplyToFields(DIApplyManager *Mgr) = 0; virtual void ApplyToFields(DIVisitor *Visitor) = 0;
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
/// ///
@ -181,13 +184,12 @@ public:
} }
/// DebugVersionFromGlobal - Returns the version number from a compile unit /// DebugVersionFromGlobal - Returns the version number from a compile unit
/// GlobalVariable. /// GlobalVariable. Return DIIValid if operand is not an unsigned int.
static unsigned DebugVersionFromGlobal(GlobalVariable *GV, static unsigned DebugVersionFromGlobal(GlobalVariable *GV);
bool Checking = false);
/// ApplyToFields - Target the apply manager to the fields of the /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
/// CompileUnitDesc. ///
virtual void ApplyToFields(DIApplyManager *Mgr); virtual void ApplyToFields(DIVisitor *Visitor);
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
/// ///
@ -242,9 +244,9 @@ public:
return D->getTag() == DI_TAG_global_variable; return D->getTag() == DI_TAG_global_variable;
} }
/// ApplyToFields - Target the apply manager to the fields of the /// ApplyToFields - Target the visitor to the fields of the
/// GlobalVariableDesc. /// GlobalVariableDesc.
virtual void ApplyToFields(DIApplyManager *Mgr); virtual void ApplyToFields(DIVisitor *Visitor);
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
/// ///
@ -295,9 +297,9 @@ public:
return D->getTag() == DI_TAG_subprogram; return D->getTag() == DI_TAG_subprogram;
} }
/// ApplyToFields - Target the apply manager to the fields of the /// ApplyToFields - Target the visitor to the fields of the SubprogramDesc.
/// SubprogramDesc. ///
virtual void ApplyToFields(DIApplyManager *Mgr); virtual void ApplyToFields(DIVisitor *Visitor);
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
/// ///
@ -453,7 +455,6 @@ public:
/// ///
class MachineDebugInfo : public ImmutablePass { class MachineDebugInfo : public ImmutablePass {
private: private:
// Debug indforma
// Use the same serializer/deserializer/verifier for the module. // Use the same serializer/deserializer/verifier for the module.
DISerializer SR; DISerializer SR;
DIDeserializer DR; DIDeserializer DR;

View File

@ -125,9 +125,9 @@ static bool isStringValue(Value *V) {
return false; return false;
} }
/// getGlobalValue - Return either a direct or cast Global value. /// getGlobalVariable - Return either a direct or cast Global value.
/// ///
static GlobalVariable *getGlobalValue(Value *V) { static GlobalVariable *getGlobalVariable(Value *V) {
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) { if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
return GV; return GV;
} else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
@ -138,9 +138,9 @@ static GlobalVariable *getGlobalValue(Value *V) {
return NULL; return NULL;
} }
/// isGlobalValue - Return true if the given value can be coerced to a /// isGlobalVariable - Return true if the given value can be coerced to a
/// GlobalVariable. /// GlobalVariable.
static bool isGlobalValue(Value *V) { static bool isGlobalVariable(Value *V) {
if (isa<GlobalVariable>(V) || isa<ConstantPointerNull>(V)) { if (isa<GlobalVariable>(V) || isa<ConstantPointerNull>(V)) {
return true; return true;
} else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
@ -151,33 +151,31 @@ static bool isGlobalValue(Value *V) {
return false; return false;
} }
/// isUIntOperand - Return true if the ith operand is an unsigned integer. /// getUIntOperand - Return ith operand if it is an unsigned integer.
/// ///
static bool isUIntOperand(GlobalVariable *GV, unsigned i) { static ConstantUInt *getUIntOperand(GlobalVariable *GV, unsigned i) {
// Make sure the GlobalVariable has an initializer. // Make sure the GlobalVariable has an initializer.
if (!GV->hasInitializer()) return false; if (!GV->hasInitializer()) return NULL;
// Get the initializer constant. // Get the initializer constant.
ConstantStruct *CI = dyn_cast<ConstantStruct>(GV->getInitializer()); ConstantStruct *CI = dyn_cast<ConstantStruct>(GV->getInitializer());
if (!CI) return false; if (!CI) return NULL;
// Check if there is at least i + 1 operands. // Check if there is at least i + 1 operands.
unsigned N = CI->getNumOperands(); unsigned N = CI->getNumOperands();
if (i >= N) return false; if (i >= N) return NULL;
// Check constant. // Check constant.
return isa<ConstantUInt>(CI->getOperand(i)); return dyn_cast<ConstantUInt>(CI->getOperand(i));
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// TagFromGlobal - Returns the Tag number from a debug info descriptor /// TagFromGlobal - Returns the Tag number from a debug info descriptor
/// GlobalVariable. /// GlobalVariable.
unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV, bool Checking) { unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV) {
if (Checking && !isUIntOperand(GV, 0)) return DIInvalid; ConstantUInt *C = getUIntOperand(GV, 0);
ConstantStruct *CI = cast<ConstantStruct>(GV->getInitializer()); return C ? C->getValue() : DIINVALID;
Constant *C = CI->getOperand(0);
return cast<ConstantUInt>(C)->getValue();
} }
/// DescFactory - Create an instance of debug info descriptor based on Tag. /// DescFactory - Create an instance of debug info descriptor based on Tag.
@ -194,21 +192,21 @@ DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// ApplyToFields - Target the manager to each field of the debug information /// ApplyToFields - Target the visitor to each field of the debug information
/// descriptor. /// descriptor.
void DIApplyManager::ApplyToFields(DebugInfoDesc *DD) { void DIVisitor::ApplyToFields(DebugInfoDesc *DD) {
DD->ApplyToFields(this); DD->ApplyToFields(this);
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DICountAppMgr - This DIApplyManager counts all the fields in the supplied /// DICountVisitor - This DIVisitor counts all the fields in the supplied debug
/// debug the supplied DebugInfoDesc. /// the supplied DebugInfoDesc.
class DICountAppMgr : public DIApplyManager { class DICountVisitor : public DIVisitor {
private: private:
unsigned Count; // Running count of fields. unsigned Count; // Running count of fields.
public: public:
DICountAppMgr() : DIApplyManager(), Count(1) {} DICountVisitor() : DIVisitor(), Count(1) {}
// Accessors. // Accessors.
unsigned getCount() const { return Count; } unsigned getCount() const { return Count; }
@ -224,17 +222,17 @@ public:
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DIDeserializeAppMgr - This DIApplyManager deserializes all the fields in /// DIDeserializeVisitor - This DIVisitor deserializes all the fields in the
/// the supplied DebugInfoDesc. /// supplied DebugInfoDesc.
class DIDeserializeAppMgr : public DIApplyManager { class DIDeserializeVisitor : public DIVisitor {
private: private:
DIDeserializer &DR; // Active deserializer. DIDeserializer &DR; // Active deserializer.
unsigned I; // Current operand index. unsigned I; // Current operand index.
ConstantStruct *CI; // GlobalVariable constant initializer. ConstantStruct *CI; // GlobalVariable constant initializer.
public: public:
DIDeserializeAppMgr(DIDeserializer &D, GlobalVariable *GV) DIDeserializeVisitor(DIDeserializer &D, GlobalVariable *GV)
: DIApplyManager() : DIVisitor()
, DR(D) , DR(D)
, I(1) , I(1)
, CI(cast<ConstantStruct>(GV->getInitializer())) , CI(cast<ConstantStruct>(GV->getInitializer()))
@ -264,21 +262,21 @@ public:
} }
virtual void Apply(GlobalVariable *&Field) { virtual void Apply(GlobalVariable *&Field) {
Constant *C = CI->getOperand(I++); Constant *C = CI->getOperand(I++);
Field = getGlobalValue(C); Field = getGlobalVariable(C);
} }
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DISerializeAppMgr - This DIApplyManager serializes all the fields in /// DISerializeVisitor - This DIVisitor serializes all the fields in
/// the supplied DebugInfoDesc. /// the supplied DebugInfoDesc.
class DISerializeAppMgr : public DIApplyManager { class DISerializeVisitor : public DIVisitor {
private: private:
DISerializer &SR; // Active serializer. DISerializer &SR; // Active serializer.
std::vector<Constant*> &Elements; // Element accumulator. std::vector<Constant*> &Elements; // Element accumulator.
public: public:
DISerializeAppMgr(DISerializer &S, std::vector<Constant*> &E) DISerializeVisitor(DISerializer &S, std::vector<Constant*> &E)
: DIApplyManager() : DIVisitor()
, SR(S) , SR(S)
, Elements(E) , Elements(E)
{} {}
@ -321,16 +319,16 @@ public:
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DIGetTypesAppMgr - This DIApplyManager gathers all the field types in /// DIGetTypesVisitor - This DIVisitor gathers all the field types in
/// the supplied DebugInfoDesc. /// the supplied DebugInfoDesc.
class DIGetTypesAppMgr : public DIApplyManager { class DIGetTypesVisitor : public DIVisitor {
private: private:
DISerializer &SR; // Active serializer. DISerializer &SR; // Active serializer.
std::vector<const Type*> &Fields; // Type accumulator. std::vector<const Type*> &Fields; // Type accumulator.
public: public:
DIGetTypesAppMgr(DISerializer &S, std::vector<const Type*> &F) DIGetTypesVisitor(DISerializer &S, std::vector<const Type*> &F)
: DIApplyManager() : DIVisitor()
, SR(S) , SR(S)
, Fields(F) , Fields(F)
{} {}
@ -361,9 +359,9 @@ public:
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DIVerifyAppMgr - This DIApplyManager verifies all the field types against /// DIVerifyVisitor - This DIVisitor verifies all the field types against
/// a constant initializer. /// a constant initializer.
class DIVerifyAppMgr : public DIApplyManager { class DIVerifyVisitor : public DIVisitor {
private: private:
DIVerifier &VR; // Active verifier. DIVerifier &VR; // Active verifier.
bool IsValid; // Validity status. bool IsValid; // Validity status.
@ -371,8 +369,8 @@ private:
ConstantStruct *CI; // GlobalVariable constant initializer. ConstantStruct *CI; // GlobalVariable constant initializer.
public: public:
DIVerifyAppMgr(DIVerifier &V, GlobalVariable *GV) DIVerifyVisitor(DIVerifier &V, GlobalVariable *GV)
: DIApplyManager() : DIVisitor()
, VR(V) , VR(V)
, IsValid(true) , IsValid(true)
, I(1) , I(1)
@ -404,11 +402,11 @@ public:
virtual void Apply(DebugInfoDesc *&Field) { virtual void Apply(DebugInfoDesc *&Field) {
// FIXME - Prepare the correct descriptor. // FIXME - Prepare the correct descriptor.
Constant *C = CI->getOperand(I++); Constant *C = CI->getOperand(I++);
IsValid = IsValid && isGlobalValue(C); IsValid = IsValid && isGlobalVariable(C);
} }
virtual void Apply(GlobalVariable *&Field) { virtual void Apply(GlobalVariable *&Field) {
Constant *C = CI->getOperand(I++); Constant *C = CI->getOperand(I++);
IsValid = IsValid && isGlobalValue(C); IsValid = IsValid && isGlobalVariable(C);
} }
}; };
@ -416,23 +414,20 @@ public:
/// DebugVersionFromGlobal - Returns the version number from a compile unit /// DebugVersionFromGlobal - Returns the version number from a compile unit
/// GlobalVariable. /// GlobalVariable.
unsigned CompileUnitDesc::DebugVersionFromGlobal(GlobalVariable *GV, unsigned CompileUnitDesc::DebugVersionFromGlobal(GlobalVariable *GV) {
bool Checking) { ConstantUInt *C = getUIntOperand(GV, 1);
if (Checking && !isUIntOperand(GV, 1)) return DIInvalid; return C ? C->getValue() : DIINVALID;
ConstantStruct *CI = cast<ConstantStruct>(GV->getInitializer());
Constant *C = CI->getOperand(1);
return cast<ConstantUInt>(C)->getValue();
} }
/// ApplyToFields - Target the apply manager to the fields of the /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
/// CompileUnitDesc. ///
void CompileUnitDesc::ApplyToFields(DIApplyManager *Mgr) { void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) {
Mgr->Apply(DebugVersion); Visitor->Apply(DebugVersion);
Mgr->Apply(Language); Visitor->Apply(Language);
Mgr->Apply(FileName); Visitor->Apply(FileName);
Mgr->Apply(Directory); Visitor->Apply(Directory);
Mgr->Apply(Producer); Visitor->Apply(Producer);
Mgr->Apply(TransUnit); Visitor->Apply(TransUnit);
} }
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
@ -454,16 +449,16 @@ void CompileUnitDesc::dump() {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// ApplyToFields - Target the apply manager to the fields of the /// ApplyToFields - Target the visitor to the fields of the GlobalVariableDesc.
/// GlobalVariableDesc. ///
void GlobalVariableDesc::ApplyToFields(DIApplyManager *Mgr) { void GlobalVariableDesc::ApplyToFields(DIVisitor *Visitor) {
Mgr->Apply(Context); Visitor->Apply(Context);
Mgr->Apply(Name); Visitor->Apply(Name);
Mgr->Apply(TransUnit); Visitor->Apply(TransUnit);
Mgr->Apply(TyDesc); Visitor->Apply(TyDesc);
Mgr->Apply(IsStatic); Visitor->Apply(IsStatic);
Mgr->Apply(IsDefinition); Visitor->Apply(IsDefinition);
Mgr->Apply(Global); Visitor->Apply(Global);
} }
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
@ -486,19 +481,19 @@ void GlobalVariableDesc::dump() {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// ApplyToFields - Target the apply manager to the fields of the /// ApplyToFields - Target the visitor to the fields of the
/// SubprogramDesc. /// SubprogramDesc.
void SubprogramDesc::ApplyToFields(DIApplyManager *Mgr) { void SubprogramDesc::ApplyToFields(DIVisitor *Visitor) {
Mgr->Apply(Context); Visitor->Apply(Context);
Mgr->Apply(Name); Visitor->Apply(Name);
Mgr->Apply(TransUnit); Visitor->Apply(TransUnit);
Mgr->Apply(TyDesc); Visitor->Apply(TyDesc);
Mgr->Apply(IsStatic); Visitor->Apply(IsStatic);
Mgr->Apply(IsDefinition); Visitor->Apply(IsDefinition);
// FIXME - Temp variable until restructured. // FIXME - Temp variable until restructured.
GlobalVariable *Tmp; GlobalVariable *Tmp;
Mgr->Apply(Tmp); Visitor->Apply(Tmp);
} }
/// TypeString - Return a string used to compose globalnames and labels. /// TypeString - Return a string used to compose globalnames and labels.
@ -541,7 +536,7 @@ DebugInfoDesc *DIDeserializer::Deserialize(GlobalVariable *GV) {
assert(Slot && "Unknown Tag"); assert(Slot && "Unknown Tag");
// Deserialize the fields. // Deserialize the fields.
DIDeserializeAppMgr DRAM(*this, GV); DIDeserializeVisitor DRAM(*this, GV);
DRAM.ApplyToFields(Slot); DRAM.ApplyToFields(Slot);
return Slot; return Slot;
@ -592,7 +587,7 @@ const StructType *DISerializer::getTagType(DebugInfoDesc *DD) {
// Add tag field. // Add tag field.
Fields.push_back(Type::UIntTy); Fields.push_back(Type::UIntTy);
// Get types of remaining fields. // Get types of remaining fields.
DIGetTypesAppMgr GTAM(*this, Fields); DIGetTypesVisitor GTAM(*this, Fields);
GTAM.ApplyToFields(DD); GTAM.ApplyToFields(DD);
// Construct structured type. // Construct structured type.
@ -655,7 +650,7 @@ GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) {
// Add Tag value. // Add Tag value.
Elements.push_back(ConstantUInt::get(Type::UIntTy, Tag)); Elements.push_back(ConstantUInt::get(Type::UIntTy, Tag));
// Add remaining fields. // Add remaining fields.
DISerializeAppMgr SRAM(*this, Elements); DISerializeVisitor SRAM(*this, Elements);
SRAM.ApplyToFields(DD); SRAM.ApplyToFields(DD);
// Set the globals initializer. // Set the globals initializer.
@ -688,13 +683,13 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
if (markVisited(GV)) return true; if (markVisited(GV)) return true;
// Get the Tag // Get the Tag
unsigned Tag = DebugInfoDesc::TagFromGlobal(GV, true); unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
if (Tag == DIInvalid) return false; if (Tag == DIINVALID) return false;
// If a compile unit we need the debug version. // If a compile unit we need the debug version.
if (Tag == DI_TAG_compile_unit) { if (Tag == DI_TAG_compile_unit) {
DebugVersion = CompileUnitDesc::DebugVersionFromGlobal(GV, true); DebugVersion = CompileUnitDesc::DebugVersionFromGlobal(GV);
if (DebugVersion == DIInvalid) return false; if (DebugVersion == DIINVALID) return false;
} }
// Construct an empty DebugInfoDesc. // Construct an empty DebugInfoDesc.
@ -711,7 +706,7 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
unsigned &Slot = Counts[Tag]; unsigned &Slot = Counts[Tag];
if (!Slot) { if (!Slot) {
// Check the operand count to the field count // Check the operand count to the field count
DICountAppMgr CTAM; DICountVisitor CTAM;
CTAM.ApplyToFields(DD); CTAM.ApplyToFields(DD);
Slot = CTAM.getCount(); Slot = CTAM.getCount();
} }
@ -723,7 +718,7 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
} }
// Check each field for valid type. // Check each field for valid type.
DIVerifyAppMgr VRAM(*this, GV); DIVerifyVisitor VRAM(*this, GV);
VRAM.ApplyToFields(DD); VRAM.ApplyToFields(DD);
// Release empty DebugInfoDesc. // Release empty DebugInfoDesc.
@ -810,7 +805,7 @@ MachineDebugInfo::getGlobalVariables(Module &M) {
// Scan all globals. // Scan all globals.
for (unsigned i = 0, N = Globals.size(); i < N; ++i) { for (unsigned i = 0, N = Globals.size(); i < N; ++i) {
GlobalVariable *GV = Globals[i]; GlobalVariable *GV = Globals[i];
if (DebugInfoDesc::TagFromGlobal(GV, true) == DI_TAG_global_variable) { if (DebugInfoDesc::TagFromGlobal(GV) == DI_TAG_global_variable) {
GlobalVariableDesc *GVD = GlobalVariableDesc *GVD =
static_cast<GlobalVariableDesc *>(DR.Deserialize(GV)); static_cast<GlobalVariableDesc *>(DR.Deserialize(GV));
GlobalVariables.push_back(GVD); GlobalVariables.push_back(GVD);