[PATCH] Partial revert of 183015

Evgeniy Stepanov eugenis at google.com
Tue Apr 15 01:11:02 PDT 2014


  Reverted changes for "pr" builtins.
  The only ones that are re-enabled now are "j" - i.e., returns_twice.
  PTAL

Hi rsmith,

http://reviews.llvm.org/D3369

CHANGE SINCE LAST DIFF
  http://reviews.llvm.org/D3369?vs=8504&id=8523#toc

Files:
  test/CodeGen/function-attributes.c
  test/Sema/builtins-gnu-mode.c
  include/clang/Basic/Builtins.def

Index: test/CodeGen/function-attributes.c
===================================================================
--- test/CodeGen/function-attributes.c
+++ test/CodeGen/function-attributes.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -Os -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -Os -std=c99 -o - %s | FileCheck %s
 // CHECK: define signext i8 @f0(i32 %x) [[NUW:#[0-9]+]]
 // CHECK: define zeroext i8 @f1(i32 %x) [[NUW]]
 // CHECK: define void @f2(i8 signext %x) [[NUW]]
@@ -117,6 +118,16 @@
   setjmp(0);
 }
 
+// CHECK-LABEL: define void @f20()
+// CHECK: {
+// CHECK: call i32 @_setjmp(i32* null)
+// CHECK: [[RT_CALL]]
+// CHECK: ret void
+int _setjmp(jmp_buf);
+void f20(void) {
+  _setjmp(0);
+}
+
 // CHECK: attributes [[NUW]] = { nounwind optsize readnone{{.*}} }
 // CHECK: attributes [[AI]] = { alwaysinline nounwind optsize readnone{{.*}} }
 // CHECK: attributes [[ALIGN]] = { nounwind optsize readnone alignstack=16{{.*}} }
Index: test/Sema/builtins-gnu-mode.c
===================================================================
--- test/Sema/builtins-gnu-mode.c
+++ test/Sema/builtins-gnu-mode.c
@@ -13,14 +13,6 @@
 int strcasecmp;
 int strncasecmp;
 int _exit;
-int vfork;
-int _setjmp;
-int __sigsetjmp;
-int sigsetjmp;
-int setjmp_syscall;
-int savectx;
-int qsetjmp;
-int getcontext;
 int _longjmp;
 int siglongjmp;
 int strlcpy;
Index: include/clang/Basic/Builtins.def
===================================================================
--- include/clang/Basic/Builtins.def
+++ include/clang/Basic/Builtins.def
@@ -756,18 +756,18 @@
 LIBBUILTIN(strncasecmp, "icC*cC*z", "f",   "strings.h", ALL_GNU_LANGUAGES)
 // POSIX unistd.h
 LIBBUILTIN(_exit, "vi",           "fr",    "unistd.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(vfork, "p",            "fj",    "unistd.h", ALL_GNU_LANGUAGES)
+LIBBUILTIN(vfork, "p",            "fj",    "unistd.h", ALL_LANGUAGES)
 // POSIX setjmp.h
 
 // In some systems setjmp is a macro that expands to _setjmp. We undefine
 // it here to avoid having two identical LIBBUILTIN entries.
-LIBBUILTIN(_setjmp, "iJ",         "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(__sigsetjmp, "iSJi",   "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(sigsetjmp, "iSJi",     "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(setjmp_syscall, "iJ",  "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(savectx, "iJ",         "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(qsetjmp, "iJ",         "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
-LIBBUILTIN(getcontext, "iK*",     "fj",   "setjmp.h", ALL_GNU_LANGUAGES)
+LIBBUILTIN(_setjmp, "iJ",         "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(__sigsetjmp, "iSJi",   "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(sigsetjmp, "iSJi",     "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(setjmp_syscall, "iJ",  "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(savectx, "iJ",         "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(qsetjmp, "iJ",         "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(getcontext, "iK*",     "fj",   "setjmp.h", ALL_LANGUAGES)
 
 LIBBUILTIN(_longjmp, "vJi",       "fr",    "setjmp.h", ALL_GNU_LANGUAGES)
 LIBBUILTIN(siglongjmp, "vSJi",    "fr",    "setjmp.h", ALL_GNU_LANGUAGES)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3369.2.patch
Type: text/x-patch
Size: 3257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140415/367e4ddd/attachment.bin>


More information about the cfe-commits mailing list