From 57765d53477910de18f8c5e7d2ce585a0f782935 Mon Sep 17 00:00:00 2001 From: Robert Lytton Date: Thu, 3 Jul 2014 09:30:33 +0000 Subject: Move the calling of emitTargetMD() later. Summary: Because a global created by GetOrCreateLLVMGlobal() is not finalised until later viz: extern char a[]; char f(){ return a[5];} char a[10]; Change MangledDeclNames to use a MapVector rather than a DenseMap so that the Metadata is output in order of original declaration, so to make deterministic and improve human readablity. Differential Revision: http://reviews.llvm.org/D4176 llvm-svn: 212263 --- clang/lib/CodeGen/CodeGenModule.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 88f5faf7093..c0bfb4c5e6b 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -349,8 +349,8 @@ class CodeGenModule : public CodeGenTypeCache { /// emitted when the translation unit is complete. CtorList GlobalDtors; - /// A map of canonical GlobalDecls to their mangled names. - llvm::DenseMap MangledDeclNames; + /// An ordered map of canonical GlobalDecls to their mangled names. + llvm::MapVector MangledDeclNames; llvm::StringMap Manglings; /// Global annotations. @@ -1146,6 +1146,9 @@ private: /// \brief Emit the Clang version as llvm.ident metadata. void EmitVersionIdentMetadata(); + /// Emits target specific Metadata for global declarations. + void EmitTargetMetadata(); + /// Emit the llvm.gcov metadata used to tell LLVM where to emit the .gcno and /// .gcda files in a way that persists in .bc files. void EmitCoverageFile(); -- cgit v1.2.3