@@ -24,9 +24,18 @@ static thread_local detail::code_location GCodeLocTLS = {};
24
24
// / check and see if code location object is available. If not, continue with
25
25
// / instrumentation as needed
26
26
tls_code_loc_t::tls_code_loc_t ()
27
+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
28
+ : CodeLocTLSRef(GCodeLocTLS),
29
+ // Check TLS to see if a previously stashed code_location object is
30
+ // available; if so, we are in a local scope.
31
+ MLocalScope (CodeLocTLSRef.fileName() && CodeLocTLSRef.functionName())
32
+ #else
27
33
: // Check TLS to see if a previously stashed code_location object is
28
34
// available; if so, we are in a local scope.
29
- MLocalScope (GCodeLocTLS.fileName() && GCodeLocTLS.functionName()) {}
35
+ MLocalScope (GCodeLocTLS.fileName() && GCodeLocTLS.functionName())
36
+ #endif // __INTEL_PREVIEW_BREAKING_CHANGES
37
+ {
38
+ }
30
39
31
40
ur_code_location_t codeLocationCallback (void *) {
32
41
ur_code_location_t codeloc;
@@ -44,24 +53,45 @@ ur_code_location_t codeLocationCallback(void *) {
44
53
// / location has been stashed in the TLS at a higher level. If not, we have the
45
54
// / code location information that must be active for the current calling scope.
46
55
tls_code_loc_t::tls_code_loc_t (const detail::code_location &CodeLoc)
56
+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
57
+ : CodeLocTLSRef(GCodeLocTLS),
58
+ // Check TLS to see if a previously stashed code_location object is
59
+ // available; if so, then don't overwrite the previous information as we
60
+ // are still in scope of the instrumented function.
61
+ MLocalScope (CodeLocTLSRef.fileName() && CodeLocTLSRef.functionName()) {
62
+ if (!MLocalScope)
63
+ // Update the TLS information with the code_location information
64
+ CodeLocTLSRef = CodeLoc;
65
+ #else
47
66
: // Check TLS to see if a previously stashed code_location object is
48
67
// available; if so, then don't overwrite the previous information as we
49
68
// are still in scope of the instrumented function.
50
69
MLocalScope (GCodeLocTLS.fileName () && GCodeLocTLS.functionName ()) {
51
70
if (!MLocalScope)
52
71
// Update the TLS information with the code_location information
53
72
GCodeLocTLS = CodeLoc;
73
+ #endif // __INTEL_PREVIEW_BREAKING_CHANGES
54
74
}
55
75
56
76
// / @brief If we are the top lovel scope, reset the code location info
57
77
tls_code_loc_t ::~tls_code_loc_t () {
58
78
// Only reset the TLS data if the top level function is going out of scope
59
79
if (!MLocalScope) {
80
+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
81
+ CodeLocTLSRef = {};
82
+ #else
60
83
GCodeLocTLS = {};
84
+ #endif // __INTEL_PREVIEW_BREAKING_CHANGES
61
85
}
62
86
}
63
87
64
- const detail::code_location &tls_code_loc_t ::query() { return GCodeLocTLS; }
88
+ const detail::code_location &tls_code_loc_t::query () {
89
+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
90
+ return CodeLocTLSRef;
91
+ #else
92
+ return GCodeLocTLS;
93
+ #endif // __INTEL_PREVIEW_BREAKING_CHANGES
94
+ }
65
95
66
96
} // namespace detail
67
97
} // namespace _V1
0 commit comments