aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Builtins.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@mozilla.com>2022-12-12 17:02:15 +0100
committerserge-sans-paille <sguelton@mozilla.com>2022-12-23 10:31:47 +0100
commit719d98dfa841c522d8d452f0685e503538415a53 (patch)
tree6f5a3cd17dfb2f7d5c0ac34b552b693065b9b31b /clang/lib/Basic/Builtins.cpp
parenta4e3457fb752d675c58fb14a3d8ed03fe218b6b0 (diff)
downloadllvm-719d98dfa841c522d8d452f0685e503538415a53.zip
llvm-719d98dfa841c522d8d452f0685e503538415a53.tar.gz
llvm-719d98dfa841c522d8d452f0685e503538415a53.tar.bz2
[clang] Use a StringRef instead of a raw char pointer to store builtin and call information
This avoids recomputing string length that is already known at compile time. It has a slight impact on preprocessing / compile time, see https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u Differential Revision: https://reviews.llvm.org/D139881
Diffstat (limited to 'clang/lib/Basic/Builtins.cpp')
-rw-r--r--clang/lib/Basic/Builtins.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Basic/Builtins.cpp b/clang/lib/Basic/Builtins.cpp
index 0e05668..375f474 100644
--- a/clang/lib/Basic/Builtins.cpp
+++ b/clang/lib/Basic/Builtins.cpp
@@ -18,8 +18,9 @@
#include "llvm/ADT/StringRef.h"
using namespace clang;
-static const Builtin::Info BuiltinInfo[] = {
- { "not a builtin function", nullptr, nullptr, nullptr, ALL_LANGUAGES,nullptr},
+static constexpr Builtin::Info BuiltinInfo[] = {
+ {"not a builtin function", nullptr, nullptr, nullptr, ALL_LANGUAGES,
+ nullptr},
#define BUILTIN(ID, TYPE, ATTRS) \
{ #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr },
#define LANGBUILTIN(ID, TYPE, ATTRS, LANGS) \