From af699bd76e8888af268d7833e8a46bb1a8f7a5b4 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 7 Jun 2013 02:41:10 +0200 Subject: [PATCH] Rename TD_Confirm to TD_TypeInfo. The old name probably was a reference to the fact that the metadata node is used to _confirm_ that a metadata record found by name really belongs to a given TypeInfo instance, but I found it to be rather non-intuitive. --- gen/metadata.h | 2 +- gen/passes/GarbageCollect2Stack.cpp | 4 ++-- gen/typinf.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gen/metadata.h b/gen/metadata.h index d2523907..13b59750 100644 --- a/gen/metadata.h +++ b/gen/metadata.h @@ -32,7 +32,7 @@ typedef llvm::Value MDNodeField; /// The fields in the metadata node for a TypeInfo instance. /// (Its name will be TD_PREFIX ~ ) enum TypeDataFields { - TD_Confirm, /// The TypeInfo this node is for. + TD_TypeInfo, /// A reference toe the TypeInfo global this node is for. TD_Type, /// A value of the LLVM type corresponding to this D type diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index a65d89e2..9beda12b 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -495,8 +495,8 @@ Type* Analysis::getTypeFor(Value* typeinfo) const { if (node->getNumOperands() != TD_NumFields) return NULL; - if (TD_Confirm >= 0 && (!node->getOperand(TD_Confirm) || - node->getOperand(TD_Confirm)->stripPointerCasts() != ti_global)) + if (TD_TypeInfo >= 0 && (!node->getOperand(TD_TypeInfo) || + node->getOperand(TD_TypeInfo)->stripPointerCasts() != ti_global)) return NULL; return node->getOperand(TD_Type)->getType(); diff --git a/gen/typinf.cpp b/gen/typinf.cpp index 28042511..a472d1c9 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -328,8 +328,8 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid) if (!meta && tid->tinfo->toBasetype()->ty < Terror) { // Construct the fields MDNodeField* mdVals[TD_NumFields]; - if (TD_Confirm >= 0) - mdVals[TD_Confirm] = llvm::cast(irg->value); + if (TD_TypeInfo >= 0) + mdVals[TD_TypeInfo] = llvm::cast(irg->value); mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo)); // Construct the metadata and insert it into the module. llvm::NamedMDNode* node = gIR->module->getOrInsertNamedMetadata(metaname);