aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-09-08 23:01:30 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-09-08 23:01:30 +0000
commit25a80bf9b6a4c01eb50dacac5007262c09eca6e0 (patch)
treebd8d6a2104901fcf6b7f1e510594e93eeccb66e6 /clang/lib/CodeGen/CodeGenModule.h
parente438e078563fac5ae62b63d6698303d24d3c5813 (diff)
downloadllvm-25a80bf9b6a4c01eb50dacac5007262c09eca6e0.zip
llvm-25a80bf9b6a4c01eb50dacac5007262c09eca6e0.tar.gz
llvm-25a80bf9b6a4c01eb50dacac5007262c09eca6e0.tar.bz2
CodeGen: Introduce CodeGenModule::CreateMetadataIdentifierForType.
This function can be used to create a metadata identifier for a specific type. No functionality change, but this will be used by D11857 and D12026. Differential Revision: http://reviews.llvm.org/D12038 llvm-svn: 247098
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 4bb50a3..754e3d1 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -483,6 +483,12 @@ private:
llvm::DenseMap<const Decl *, bool> DeferredEmptyCoverageMappingDecls;
std::unique_ptr<CoverageMappingModuleGen> CoverageMapping;
+
+ /// Mapping from canonical types to their metadata identifiers. We need to
+ /// maintain this mapping because identifiers may be formed from distinct
+ /// MDNodes.
+ llvm::DenseMap<QualType, llvm::Metadata *> MetadataIdMap;
+
public:
CodeGenModule(ASTContext &C, const HeaderSearchOptions &headersearchopts,
const PreprocessorOptions &ppopts,
@@ -1112,6 +1118,11 @@ public:
void EmitVTableBitSetEntries(llvm::GlobalVariable *VTable,
const VTableLayout &VTLayout);
+ /// Create a metadata identifier for the given type. This may either be an
+ /// MDString (for external identifiers) or a distinct unnamed MDNode (for
+ /// internal identifiers).
+ llvm::Metadata *CreateMetadataIdentifierForType(QualType T);
+
/// Create a bitset entry for the given vtable.
llvm::MDTuple *CreateVTableBitSetEntry(llvm::GlobalVariable *VTable,
CharUnits Offset,