diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-19 01:28:30 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-19 01:28:30 +0000 |
| commit | b9ea63c551f667af119cce25e1b5a59b8bbe8091 (patch) | |
| tree | e1d879ee81b6312f035044601fcd2d6179c5e6f0 /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
| parent | b32d009b4f51fcd6c055f88d4085620c7a040550 (diff) | |
| download | bcm5719-llvm-b9ea63c551f667af119cce25e1b5a59b8bbe8091.tar.gz bcm5719-llvm-b9ea63c551f667af119cce25e1b5a59b8bbe8091.zip | |
Avoid an infinite cycle with private linkage and -f{data|function}-sections.
When outputting an object we check its section to find its name, but when
looking for the section with -ffunction-section we look for the symbol name.
Break the loop by requesting a name with the private prefix when constructing
the section name. This matches the behavior before r201608.
llvm-svn: 201622
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index a0ea3b3ba3b..d3c42be5e6c 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1431,8 +1431,9 @@ bool TargetLoweringBase::isLegalAddressingMode(const AddrMode &AM, void TargetLoweringBase::getNameWithPrefix(SmallVectorImpl<char> &Name, const GlobalValue *GV, - Mangler &Mang) const { - if (!GV->hasPrivateLinkage()) { + Mangler &Mang, + bool MayAlwaysUsePrivate) const { + if (MayAlwaysUsePrivate || !GV->hasPrivateLinkage()) { // Simple case: If GV is not private, it is not important to find out if // private labels are legal in this case or not. Mang.getNameWithPrefix(Name, GV, false); |

