[GCC] Attribute ifunc support in llvm
This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. Patch
for Clang http://reviews.llvm.org/D15524
Differential Revision: http://reviews.llvm.org/D15525
llvm-svn: 265667
This commit is contained in:
@@ -809,6 +809,18 @@ static uint64_t WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
|
||||
Vals.clear();
|
||||
}
|
||||
|
||||
// Emit the ifunc information.
|
||||
for (const GlobalIFunc &I : M->ifuncs()) {
|
||||
// IFUNC: [ifunc type, address space, resolver val#, linkage, visibility]
|
||||
Vals.push_back(VE.getTypeID(I.getValueType()));
|
||||
Vals.push_back(I.getType()->getAddressSpace());
|
||||
Vals.push_back(VE.getValueID(I.getResolver()));
|
||||
Vals.push_back(getEncodedLinkage(I));
|
||||
Vals.push_back(getEncodedVisibility(I));
|
||||
Stream.EmitRecord(bitc::MODULE_CODE_IFUNC, Vals);
|
||||
Vals.clear();
|
||||
}
|
||||
|
||||
// Emit the module's source file name.
|
||||
{
|
||||
StringEncoding Bits = getStringEncoding(M->getSourceFileName().data(),
|
||||
|
||||
Reference in New Issue
Block a user