[cfe-commits] r159684 - in /cfe/trunk: include/clang/Basic/ lib/Basic/ lib/CodeGen/ lib/Driver/ test/CodeGenObjC/ test/Coverage/ test/Driver/ test/Preprocessor/
David Chisnall
csdavec at swan.ac.uk
Tue Jul 3 13:49:52 PDT 2012
Author: theraven
Date: Tue Jul 3 15:49:52 2012
New Revision: 159684
URL: http://llvm.org/viewvc/llvm-project?rev=159684&view=rev
Log:
Rename the GCC Objective-C runtime to gcc from gnu-fragile and the GNUstep
runtime to gnustep from gnu. Fix EH for the GCC runtime.
Modified:
cfe/trunk/include/clang/Basic/ObjCRuntime.h
cfe/trunk/lib/Basic/ObjCRuntime.cpp
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Driver/ToolChain.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/CodeGenObjC/bitfield-gnu.m
cfe/trunk/test/CodeGenObjC/bitfield_encoding.m
cfe/trunk/test/CodeGenObjC/constant-strings.m
cfe/trunk/test/CodeGenObjC/gnu-exceptions.m
cfe/trunk/test/CodeGenObjC/messages.m
cfe/trunk/test/CodeGenObjC/undefined-protocol.m
cfe/trunk/test/Coverage/codegen-gnu.m
cfe/trunk/test/Driver/gnu-runtime.m
cfe/trunk/test/Preprocessor/init.c
cfe/trunk/test/Preprocessor/non_fragile_feature1.m
Modified: cfe/trunk/include/clang/Basic/ObjCRuntime.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/ObjCRuntime.h?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/ObjCRuntime.h (original)
+++ cfe/trunk/include/clang/Basic/ObjCRuntime.h Tue Jul 3 15:49:52 2012
@@ -40,11 +40,12 @@
/// version of iOS.
iOS,
- /// 'gnu' is the non-fragile GNU runtime.
- GNU,
+ /// 'gcc' is the Objective-C runtime shipped with GCC, implementing a
+ /// fragile Objective-C ABI
+ GCC,
- /// 'gnu-fragile' is the fragile GNU runtime.
- FragileGNU
+ /// 'gnustep' is the modern non-fragile GNUstep runtime.
+ GNUstep
};
private:
@@ -71,9 +72,9 @@
bool isNonFragile() const {
switch (getKind()) {
case FragileMacOSX: return false;
- case FragileGNU: return false;
+ case GCC: return false;
case MacOSX: return true;
- case GNU: return true;
+ case GNUstep: return true;
case iOS: return true;
}
llvm_unreachable("bad kind");
@@ -83,15 +84,15 @@
/// implied behaviors for a "fragile" ABI?
bool isFragile() const { return !isNonFragile(); }
- /// \brief Is this runtime basically of the GNU family of runtimes?
+ /// \brief Is this runtime basically of the GNUstep family of runtimes?
bool isGNUFamily() const {
switch (getKind()) {
case FragileMacOSX:
case MacOSX:
case iOS:
return false;
- case FragileGNU:
- case GNU:
+ case GCC:
+ case GNUstep:
return true;
}
llvm_unreachable("bad kind");
@@ -118,8 +119,8 @@
// This is really a lie, because some implementations and versions
// of the runtime do not support ARC. Probably -fgnu-runtime
// should imply a "maximal" runtime or something?
- case FragileGNU: return true;
- case GNU: return true;
+ case GCC: return true;
+ case GNUstep: return true;
}
llvm_unreachable("bad kind");
}
@@ -143,8 +144,8 @@
// This is really a lie, because some implementations and versions
// of the runtime do not support ARC. Probably -fgnu-runtime
// should imply a "maximal" runtime or something?
- case FragileGNU: return true;
- case GNU: return true;
+ case GCC: return true;
+ case GNUstep: return true;
}
llvm_unreachable("bad kind");
}
@@ -158,8 +159,8 @@
case FragileMacOSX: return getVersion() >= VersionTuple(10, 8);
case MacOSX: return getVersion() >= VersionTuple(10, 8);
case iOS: return getVersion() >= VersionTuple(5);
- case FragileGNU: return false;
- case GNU: return false;
+ case GCC: return false;
+ case GNUstep: return false;
}
llvm_unreachable("bad kind");
}
@@ -170,8 +171,19 @@
case MacOSX: return true;
case iOS: return true;
case FragileMacOSX: return false;
- case FragileGNU: return false;
- case GNU: return false;
+ case GCC: return true;
+ case GNUstep: return true;
+ }
+ llvm_unreachable("bad kind");
+ }
+ /// \brief Does this runtime use zero-cost exceptions?
+ bool hasUnwindExceptions() const {
+ switch (getKind()) {
+ case MacOSX: return true;
+ case iOS: return true;
+ case FragileMacOSX: return false;
+ case GCC: return true;
+ case GNUstep: return true;
}
llvm_unreachable("bad kind");
}
Modified: cfe/trunk/lib/Basic/ObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/ObjCRuntime.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/ObjCRuntime.cpp (original)
+++ cfe/trunk/lib/Basic/ObjCRuntime.cpp Tue Jul 3 15:49:52 2012
@@ -30,8 +30,8 @@
case ObjCRuntime::MacOSX: out << "macosx"; break;
case ObjCRuntime::FragileMacOSX: out << "macosx-fragile"; break;
case ObjCRuntime::iOS: out << "ios"; break;
- case ObjCRuntime::GNU: out << "gnu"; break;
- case ObjCRuntime::FragileGNU: out << "gnu-fragile"; break;
+ case ObjCRuntime::GNUstep: out << "gnustep"; break;
+ case ObjCRuntime::GCC: out << "gcc"; break;
}
if (value.getVersion() > VersionTuple(0)) {
out << '-' << value.getVersion();
@@ -60,10 +60,10 @@
kind = ObjCRuntime::FragileMacOSX;
} else if (runtimeName == "ios") {
kind = ObjCRuntime::iOS;
- } else if (runtimeName == "gnu") {
- kind = ObjCRuntime::GNU;
- } else if (runtimeName == "gnu-fragile") {
- kind = ObjCRuntime::FragileGNU;
+ } else if (runtimeName == "gnustep") {
+ kind = ObjCRuntime::GNUstep;
+ } else if (runtimeName == "gcc") {
+ kind = ObjCRuntime::GCC;
} else {
return true;
}
Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Tue Jul 3 15:49:52 2012
@@ -186,8 +186,8 @@
case ObjCRuntime::MacOSX:
case ObjCRuntime::iOS:
return EHPersonality::NeXT_ObjC;
- case ObjCRuntime::GNU:
- case ObjCRuntime::FragileGNU:
+ case ObjCRuntime::GNUstep:
+ case ObjCRuntime::GCC:
return EHPersonality::GNU_ObjC;
}
llvm_unreachable("bad runtime kind");
@@ -216,10 +216,11 @@
case ObjCRuntime::FragileMacOSX:
return getCXXPersonality(L);
- // The GNU runtime's personality function inherently doesn't support
+ // The GCC runtime's personality function inherently doesn't support
// mixed EH. Use the C++ personality just to avoid returning null.
- case ObjCRuntime::GNU:
- case ObjCRuntime::FragileGNU:
+ case ObjCRuntime::GCC:
+ return EHPersonality::GNU_ObjC;
+ case ObjCRuntime::GNUstep:
return EHPersonality::GNU_ObjCXX;
}
llvm_unreachable("bad runtime kind");
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Tue Jul 3 15:49:52 2012
@@ -2666,10 +2666,10 @@
CGObjCRuntime *
clang::CodeGen::CreateGNUObjCRuntime(CodeGenModule &CGM) {
switch (CGM.getLangOpts().ObjCRuntime.getKind()) {
- case ObjCRuntime::GNU:
+ case ObjCRuntime::GNUstep:
return new CGObjCGNUstep(CGM);
- case ObjCRuntime::FragileGNU:
+ case ObjCRuntime::GCC:
return new CGObjCGCC(CGM);
case ObjCRuntime::FragileMacOSX:
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Tue Jul 3 15:49:52 2012
@@ -6389,8 +6389,8 @@
case ObjCRuntime::iOS:
return new CGObjCNonFragileABIMac(CGM);
- case ObjCRuntime::GNU:
- case ObjCRuntime::FragileGNU:
+ case ObjCRuntime::GNUstep:
+ case ObjCRuntime::GCC:
llvm_unreachable("these runtimes are not Mac runtimes");
}
llvm_unreachable("bad runtime");
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Jul 3 15:49:52 2012
@@ -138,8 +138,8 @@
// This is just isGNUFamily(), but we want to force implementors of
// new ABIs to decide how best to do this.
switch (LangOpts.ObjCRuntime.getKind()) {
- case ObjCRuntime::GNU:
- case ObjCRuntime::FragileGNU:
+ case ObjCRuntime::GNUstep:
+ case ObjCRuntime::GCC:
ObjCRuntime = CreateGNUObjCRuntime(*this);
return;
@@ -546,7 +546,7 @@
// If ObjC exceptions are enabled, this depends on the ABI.
if (LangOpts.ObjCExceptions) {
- if (LangOpts.ObjCRuntime.isFragile()) return false;
+ return LangOpts.ObjCRuntime.hasUnwindExceptions();
}
return true;
Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Tue Jul 3 15:49:52 2012
@@ -50,7 +50,7 @@
}
ObjCRuntime ToolChain::getDefaultObjCRuntime(bool isNonFragile) const {
- return ObjCRuntime(isNonFragile ? ObjCRuntime::GNU : ObjCRuntime::FragileGNU,
+ return ObjCRuntime(isNonFragile ? ObjCRuntime::GNUstep : ObjCRuntime::GCC,
VersionTuple());
}
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Jul 3 15:49:52 2012
@@ -2934,7 +2934,7 @@
// -fgnu-runtime
} else {
assert(runtimeArg->getOption().matches(options::OPT_fgnu_runtime));
- runtime = ObjCRuntime(ObjCRuntime::GNU, VersionTuple());
+ runtime = ObjCRuntime(ObjCRuntime::GCC, VersionTuple());
}
cmdArgs.push_back(args.MakeArgString(
Modified: cfe/trunk/test/CodeGenObjC/bitfield-gnu.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/bitfield-gnu.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/bitfield-gnu.m (original)
+++ cfe/trunk/test/CodeGenObjC/bitfield-gnu.m Tue Jul 3 15:49:52 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -S -emit-llvm -fobjc-runtime=gnu -o %t %s
+// RUN: %clang -S -emit-llvm -fobjc-runtime=gcc -o %t %s
typedef enum { A1, A2 } A;
typedef struct { A a : 1; } B;
@interface Obj { B *b; } @end
Modified: cfe/trunk/test/CodeGenObjC/bitfield_encoding.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/bitfield_encoding.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/bitfield_encoding.m (original)
+++ cfe/trunk/test/CodeGenObjC/bitfield_encoding.m Tue Jul 3 15:49:52 2012
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
// RUN: grep "ib1b14" %t | count 1
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -fobjc-runtime=gnu -emit-llvm -o %t %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -fobjc-runtime=gcc -emit-llvm -o %t %s
// RUN: grep "ib32i1b33i14" %t | count 1
struct foo{
Modified: cfe/trunk/test/CodeGenObjC/constant-strings.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/constant-strings.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/constant-strings.m (original)
+++ cfe/trunk/test/CodeGenObjC/constant-strings.m Tue Jul 3 15:49:52 2012
@@ -5,11 +5,11 @@
//
// CHECK-NEXT: @.str = {{.*}}constant [13 x i8] c"Hello World!\00", align 1
-// RUN: %clang_cc1 -fobjc-runtime=gnu -emit-llvm -o %t %s
+// RUN: %clang_cc1 -fobjc-runtime=gcc -emit-llvm -o %t %s
// RUN: FileCheck --check-prefix=CHECK-GNU < %t %s
// CHECK-GNU: NXConstantString
-// RUN: %clang_cc1 -fobjc-runtime=gnu -fconstant-string-class NSConstantString -emit-llvm -o %t %s
+// RUN: %clang_cc1 -fobjc-runtime=gcc -fconstant-string-class NSConstantString -emit-llvm -o %t %s
// RUN: FileCheck --check-prefix=CHECK-GNU-WITH-CLASS < %t %s
// CHECK-GNU-WITH-CLASS: NSConstantString
id a = @"Hello World!";
Modified: cfe/trunk/test/CodeGenObjC/gnu-exceptions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/gnu-exceptions.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/gnu-exceptions.m (original)
+++ cfe/trunk/test/CodeGenObjC/gnu-exceptions.m Tue Jul 3 15:49:52 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gnu -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gcc -o - %s | FileCheck %s
void opaque(void);
void log(int i);
Modified: cfe/trunk/test/CodeGenObjC/messages.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/messages.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/messages.m (original)
+++ cfe/trunk/test/CodeGenObjC/messages.m Tue Jul 3 15:49:52 2012
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF
-// RUN: %clang_cc1 -fobjc-runtime=gnu-fragile -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU
-// RUN: %clang_cc1 -fobjc-runtime=gnu -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-GNU-NF
+// RUN: %clang_cc1 -fobjc-runtime=gcc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU
+// RUN: %clang_cc1 -fobjc-runtime=gnustep -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-GNU-NF
typedef struct {
int x;
Modified: cfe/trunk/test/CodeGenObjC/undefined-protocol.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/undefined-protocol.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/undefined-protocol.m (original)
+++ cfe/trunk/test/CodeGenObjC/undefined-protocol.m Tue Jul 3 15:49:52 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -fobjc-runtime=gnu %s
+// RUN: %clang_cc1 -emit-llvm-only -fobjc-runtime=gcc %s
@protocol MadeUpProtocol;
Modified: cfe/trunk/test/Coverage/codegen-gnu.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/codegen-gnu.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/Coverage/codegen-gnu.m (original)
+++ cfe/trunk/test/Coverage/codegen-gnu.m Tue Jul 3 15:49:52 2012
@@ -1,3 +1,3 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-exceptions -fobjc-runtime=gnu -emit-llvm -o %t %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-exceptions -fobjc-runtime=gcc -emit-llvm -o %t %s
#include "objc-language-features.inc"
Modified: cfe/trunk/test/Driver/gnu-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/gnu-runtime.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/Driver/gnu-runtime.m (original)
+++ cfe/trunk/test/Driver/gnu-runtime.m Tue Jul 3 15:49:52 2012
@@ -1,4 +1,4 @@
// RUN: %clang -target i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s
// RUN: %clang -target i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s
-// CHECK: -fobjc-runtime=gnu
+// CHECK: -fobjc-runtime=gcc
// CHECK-NOT: fragile
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Tue Jul 3 15:49:52 2012
@@ -85,7 +85,7 @@
// C94:#define __STDC_VERSION__ 199409L
//
//
-// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -fobjc-runtime=gnu-fragile -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s
+// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s
//
// MSEXT-NOT:#define __STDC__
// MSEXT:#define _INTEGRAL_MAX_BITS 64
@@ -1872,7 +1872,7 @@
// X86_64-LINUX:#define __x86_64 1
// X86_64-LINUX:#define __x86_64__ 1
//
-// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-runtime=gnu-fragile -E -dM < /dev/null | FileCheck -check-prefix GNUSOURCE %s
+// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -check-prefix GNUSOURCE %s
// GNUSOURCE:#define _GNU_SOURCE 1
//
// RUN: %clang_cc1 -x c++ -std=c++98 -fno-rtti -E -dM < /dev/null | FileCheck -check-prefix NORTTI %s
Modified: cfe/trunk/test/Preprocessor/non_fragile_feature1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/non_fragile_feature1.m?rev=159684&r1=159683&r2=159684&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/non_fragile_feature1.m (original)
+++ cfe/trunk/test/Preprocessor/non_fragile_feature1.m Tue Jul 3 15:49:52 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=gnu-fragile %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=gcc %s
#ifndef __has_feature
#error Should have __has_feature
#endif
More information about the cfe-commits
mailing list