[Tooling/Inclusion] Add the generic abs symbol to the table.
authorHaojian Wu <hokein.wu@gmail.com>
Fri, 24 Feb 2023 11:49:06 +0000 (12:49 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Fri, 24 Feb 2023 12:56:00 +0000 (13:56 +0100)
Fixes https://github.com/llvm/llvm-project/issues/60964

Differential Revision: https://reviews.llvm.org/D144721

clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc

index 90a9aa9..692f61a 100644 (file)
@@ -233,6 +233,15 @@ SYMBOL(ssize, std::, <unordered_map>)
 SYMBOL(ssize, std::, <unordered_set>)
 SYMBOL(ssize, std::, <vector>)
 
+// Add headers for generic integer-type abs.
+// Ignore other variants (std::complex, std::valarray, std::intmax_t)
+SYMBOL(abs, std::, <cstdlib>)
+SYMBOL(abs, std::, <cmath>)
+SYMBOL(abs, None, <cstdlib>)
+SYMBOL(abs, None, <stdlib.h>)
+SYMBOL(abs, None, <cmath>)
+SYMBOL(abs, None, <math.h>)
+
 // std::get has a few variants for different types (tuple, array, pair etc)
 // which is tricky to disambiguate without type information.
 // Don't set any header for it, as it comes with the type header.