Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
versioner: follow __asm__ labels.
Browse files Browse the repository at this point in the history
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: android/ndk#440
Test: python run_tests.py
Test: m
Change-Id: Idd3681ddbd006b4705608449935c9cfacfa3556e
  • Loading branch information
jmgao committed Oct 30, 2017
1 parent dfece7a commit 38685e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/versioner/src/DeclarationDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 38685e1

Please # to comment.