-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Restrict Inline Builtin to non-static, non-odr linkage
Inline builtins have a very special behavior compared to other functions, it's better if we keep them restricted to a minimal set of functions. Add a linkage check which prevents considering ODR definitions as inline builtins. Fix #62958 Differential Revision: https://reviews.llvm.org/D148723
- Loading branch information
1 parent
752f9d0
commit e20931b
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang_cc1 -triple x86_64-windows -S -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s | ||
// Inline builtin are not supported for odr linkage | ||
// CHECK-NOT: .inline | ||
|
||
double __cdecl frexp( double _X, int* _Y); | ||
inline __attribute__((always_inline)) long double __cdecl frexpl( long double __x, int *__exp ) { | ||
return (long double) frexp((double)__x, __exp ); | ||
} | ||
|
||
long double pain(void) | ||
{ | ||
long double f = 123.45; | ||
int i; | ||
long double f2 = frexpl(f, &i); | ||
return f2; | ||
} |