[PATCH] D18970: Add functions in ctype.h to builtin function database
    Taewook Oh via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Apr 11 09:41:53 PDT 2016
    
    
  
twoh created this revision.
twoh added reviewers: rsmith, aaron.ballman.
twoh added a subscriber: cfe-commits.
Add functions declared in ctype.h to builtin function database. All functions are annotated with nothrow and const attribute, which enables better optimization. 
http://reviews.llvm.org/D18970
Files:
  include/clang/Basic/Builtins.def
Index: include/clang/Basic/Builtins.def
===================================================================
--- include/clang/Basic/Builtins.def
+++ include/clang/Basic/Builtins.def
@@ -773,6 +773,22 @@
 LIBBUILTIN(vscanf, "icC*Ra",      "fS:0:", "stdio.h", ALL_LANGUAGES)
 LIBBUILTIN(vfscanf, "iP*RcC*Ra",  "fS:1:", "stdio.h", ALL_LANGUAGES)
 LIBBUILTIN(vsscanf, "icC*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES)
+// C99 ctype.h
+LIBBUILTIN(isalnum, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isalpha, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isblank, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(iscntrl, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isdigit, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isgraph, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(islower, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isprint, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(ispunct, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isspace, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isupper, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(isxdigit, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(tolower, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+LIBBUILTIN(toupper, "ii", "fnc", "ctype.h", ALL_LANGUAGES)
+
 // C99
 // In some systems setjmp is a macro that expands to _setjmp. We undefine
 // it here to avoid having two identical LIBBUILTIN entries.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18970.53260.patch
Type: text/x-patch
Size: 1417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160411/0967f935/attachment.bin>
    
    
More information about the cfe-commits
mailing list