aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-16 06:28:21 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-16 06:28:21 +0000
commit772494c3b8f0c7c80484d0fef5b20cf4e445a8e2 (patch)
treeb4d7f6ed690115c9a387c417cdd662b3b6e26df6
parentac7db1fecfa5dbea890b6b57767d52ac12641352 (diff)
Add abort() as a builtin. This has two effects: one, we warn for incorrect
declarations of abort(), and two, we mark it noreturn. Missing the latter shows up in one of the "embarassing" tests (from the thread on llvmdev "detailed comparison of generated code size for LLVM and other compilers"). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91515 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/Builtins.def1
-rw-r--r--test/Analysis/security-syntax-checks.m1
-rw-r--r--test/SemaObjC/newproperty-class-method-1.m2
-rw-r--r--test/SemaObjC/property-13.m1
-rw-r--r--test/SemaObjC/property-user-setter.m1
5 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def
index e700cdeb5d..1adf85b149 100644
--- a/include/clang/Basic/Builtins.def
+++ b/include/clang/Basic/Builtins.def
@@ -475,6 +475,7 @@ BUILTIN(__sync_fetch_and_umax, "UiUi*Ui", "n")
// C99 library functions
// C99 stdlib.h
+LIBBUILTIN(abort, "v", "fr", "stdlib.h")
LIBBUILTIN(calloc, "v*zz", "f", "stdlib.h")
LIBBUILTIN(exit, "vi", "fr", "stdlib.h")
LIBBUILTIN(_Exit, "vi", "fr", "stdlib.h")
diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m
index 1d35ccffe3..cfdb030746 100644
--- a/test/Analysis/security-syntax-checks.m
+++ b/test/Analysis/security-syntax-checks.m
@@ -48,6 +48,7 @@ int setuid(uid_t);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
extern void check(int);
+void abort(void);
void test_setuid()
{
diff --git a/test/SemaObjC/newproperty-class-method-1.m b/test/SemaObjC/newproperty-class-method-1.m
index 7048fb6aae..d4ea5e54a5 100644
--- a/test/SemaObjC/newproperty-class-method-1.m
+++ b/test/SemaObjC/newproperty-class-method-1.m
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only
+void abort(void);
+
@interface Subclass
+ (int)magicNumber;
+ (void)setMagicNumber:(int)value;
diff --git a/test/SemaObjC/property-13.m b/test/SemaObjC/property-13.m
index dde7af0146..f34ec568b9 100644
--- a/test/SemaObjC/property-13.m
+++ b/test/SemaObjC/property-13.m
@@ -44,6 +44,7 @@
- (void) setOptional_getter_attr:(int)value { ivar = value; }
@end
+void abort(void);
int main ()
{
Test *x = [[Test alloc] init];
diff --git a/test/SemaObjC/property-user-setter.m b/test/SemaObjC/property-user-setter.m
index 96f75164cd..c06f2b6f44 100644
--- a/test/SemaObjC/property-user-setter.m
+++ b/test/SemaObjC/property-user-setter.m
@@ -80,6 +80,7 @@ static int g_val;
}
@end
+void abort(void);
int main (void) {
Subclass *x = [[Subclass alloc] init];