Commit Graph

1 Commits

Author SHA1 Message Date
Petr Pavlu 924068e9a7 Fix setting of empty implicit-section-name attribute
Code in `CodeGenModule::SetFunctionAttributes()` could set an empty
attribute `implicit-section-name` on a function that is affected by
`#pragma clang text="section"`. This is incorrect because the attribute
should contain a valid section name. If the function additionally also
used `__attribute__((section("section")))` then this could result in
emitting the function in a section with an empty name.

The patch fixes the issue by removing the problematic code that sets
empty `implicit-section-name` from
`CodeGenModule::SetFunctionAttributes()` because it is sufficient to set
this attribute only from a similar code in `setNonAliasAttributes()`
when the function is emitted.

Differential Revision: https://reviews.llvm.org/D48916


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336842 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-11 20:17:54 +00:00