[llvm] 3a29393 - Remove math.h/cmath include from DataTypes.h

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 11:27:59 PDT 2020


Author: Reid Kleckner
Date: 2020-04-06T11:27:52-07:00
New Revision: 3a29393b4709d15069130119cf1d136af4a92d77

URL: https://github.com/llvm/llvm-project/commit/3a29393b4709d15069130119cf1d136af4a92d77
DIFF: https://github.com/llvm/llvm-project/commit/3a29393b4709d15069130119cf1d136af4a92d77.diff

LOG: Remove math.h/cmath include from DataTypes.h

DataTypes.h is meant to wrap the integer type and limits headers, which
have some unfortunate variance. The FP math functions declared by math.h
are not unnecessary. math.h took a noticeable amount of time to parse
(~40ms), but that could be startup costs.

Anyway, we don't need to include it, so skipping it can't hurt.

This has been present since the initial CMake build was added in 2008.

Added: 
    

Modified: 
    llvm/include/llvm-c/DataTypes.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm-c/DataTypes.h b/llvm/include/llvm-c/DataTypes.h
index 893b22b49ffc..0f27ba81865e 100644
--- a/llvm/include/llvm-c/DataTypes.h
+++ b/llvm/include/llvm-c/DataTypes.h
@@ -24,12 +24,6 @@
 #ifndef LLVM_C_DATATYPES_H
 #define LLVM_C_DATATYPES_H
 
-#ifdef __cplusplus
-#include <cmath>
-#else
-#include <math.h>
-#endif
-
 #include <inttypes.h>
 #include <stdint.h>
 


        


More information about the llvm-commits mailing list