@@ -253,22 +253,6 @@ void system_library_symbolst::add_to_system_library(
253
253
}
254
254
}
255
255
256
- // / Helper function to call `is_symbol_internal_symbol` on a nameless
257
- // / fake symbol with the given type, to determine whether the type alone
258
- // / is sufficient to classify a symbol of that type as internal.
259
- // / \param type: the type to check
260
- // / \param [out] out_system_headers: specific system headers that need to be
261
- // / included
262
- // / \return True if the type is an internal type
263
- bool system_library_symbolst::is_type_internal (
264
- const typet &type,
265
- std::set<std::string> &out_system_headers) const
266
- {
267
- symbolt symbol;
268
- symbol.type =type;
269
- return is_symbol_internal_symbol (symbol, out_system_headers);
270
- }
271
-
272
256
// / To find out if a symbol is an internal symbol.
273
257
// / \param symbol: the symbol to check
274
258
// / \param [out] out_system_headers: specific system headers that need to be
@@ -336,17 +320,36 @@ bool system_library_symbolst::is_symbol_internal_symbol(
336
320
return true ;
337
321
}
338
322
339
- if (use_all_headers &&
340
- has_prefix (file_str, " /usr/include/" ))
323
+ if (use_all_headers)
341
324
{
342
- if (file_str.find (" /bits/" )==std::string::npos)
325
+ if (
326
+ has_prefix (file_str, " /usr/include/" ) ||
327
+ ((has_prefix (file_str, " /Library/Developer/" ) ||
328
+ has_prefix (file_str, " /Applications/Xcode" )) &&
329
+ file_str.find (" /usr/include/" ) != std::string::npos))
343
330
{
344
- // Do not include transitive includes of system headers!
345
- std::string::size_type prefix_len=std::string (" /usr/include/" ).size ();
346
- out_system_headers.insert (file_str.substr (prefix_len));
331
+ if (file_str.find (" /bits/" ) == std::string::npos)
332
+ {
333
+ // Do not include transitive includes of system headers!
334
+ const std::string::size_type prefix_len =
335
+ file_str.find (" /usr/include/" ) + std::string (" /usr/include/" ).size ();
336
+ out_system_headers.insert (file_str.substr (prefix_len));
337
+ }
338
+
339
+ return true ;
347
340
}
341
+ else if (
342
+ (has_prefix (
343
+ file_str, " C:\\ Program Files (x86)\\ Microsoft Visual Studio\\ " ) ||
344
+ has_prefix (file_str, " C:\\ Program Files\\ Microsoft Visual Studio\\ " )) &&
345
+ file_str.find (" \\ include\\ " ) != std::string::npos)
346
+ {
347
+ const std::string::size_type prefix_len =
348
+ file_str.find (" \\ include\\ " ) + std::string (" \\ include\\ " ).size ();
349
+ out_system_headers.insert (file_str.substr (prefix_len));
348
350
349
- return true ;
351
+ return true ;
352
+ }
350
353
}
351
354
352
355
return false ;
0 commit comments