versioner: follow __asm__ labels.

Attribute the versioning information on `void foo() __asm("bar")` to
bar, not foo.

The various long double functions in <math.h> run into this.

Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Test: m
Change-Id: Idd3681ddbd006b4705608449935c9cfacfa3556e
This commit is contained in:
Josh Gao 2017-10-30 12:45:09 -07:00
parent dfece7a3ee
commit 38685e1887

View file

@ -54,6 +54,11 @@ class Visitor : public RecursiveASTVisitor<Visitor> {
}
}
// <math.h> maps fool onto foo on 32-bit, since long double is the same as double.
if (auto asm_attr = decl->getAttr<AsmLabelAttr>()) {
return asm_attr->getLabel();
}
// The decl might not have a name (e.g. bitfields).
if (auto identifier = decl->getIdentifier()) {
if (mangler->shouldMangleDeclName(decl)) {