From 6f69f4074fdc5b464b32134d6be96a67a9c1376e Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 11 Jun 2015 21:41:27 +0000 Subject: [PATCH] LTO: expose LTO_SYMBOL_COMDAT flag, which indicates that the definition is part of a comdat group. Reviewers: rafael Subscribers: llvm-commits, ruiu Differential Revision: http://reviews.llvm.org/D10330 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239559 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/lto.h | 3 ++- lib/LTO/LTOModule.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/llvm-c/lto.h b/include/llvm-c/lto.h index 1db077822ae..9f37dd71e31 100644 --- a/include/llvm-c/lto.h +++ b/include/llvm-c/lto.h @@ -62,7 +62,8 @@ typedef enum { LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000, LTO_SYMBOL_SCOPE_PROTECTED = 0x00002000, LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800, - LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN = 0x00002800 + LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN = 0x00002800, + LTO_SYMBOL_COMDAT = 0x00004000 } lto_symbol_attributes; /** diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index 5cdbca66a80..0794d3c9ea4 100644 --- a/lib/LTO/LTOModule.cpp +++ b/lib/LTO/LTOModule.cpp @@ -468,6 +468,9 @@ void LTOModule::addDefinedSymbol(const char *Name, const GlobalValue *def, else attr |= LTO_SYMBOL_SCOPE_DEFAULT; + if (def->hasComdat()) + attr |= LTO_SYMBOL_COMDAT; + auto Iter = _defines.insert(Name).first; // fill information structure -- 2.34.1