r176304 - Add more of the command line options as attribute flags.
Bill Wendling
isanbard at gmail.com
Thu Feb 28 14:49:57 PST 2013
Author: void
Date: Thu Feb 28 16:49:57 2013
New Revision: 176304
URL: http://llvm.org/viewvc/llvm-project?rev=176304&view=rev
Log:
Add more of the command line options as attribute flags.
These can be easily queried by the back-end.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c
cfe/trunk/test/CodeGen/address-safety-attr.cpp
cfe/trunk/test/CodeGen/function-attributes.c
cfe/trunk/test/CodeGen/sanitize-thread-attr.cpp
cfe/trunk/test/CodeGen/unwind-attr.c
cfe/trunk/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp
cfe/trunk/test/CodeGenCXX/attr.cpp
cfe/trunk/test/CodeGenCXX/cxx11-exception-spec.cpp
cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp
cfe/trunk/test/CodeGenCXX/derived-to-base.cpp
cfe/trunk/test/CodeGenCXX/exceptions.cpp
cfe/trunk/test/CodeGenCXX/global-dtor-no-atexit.cpp
cfe/trunk/test/CodeGenCXX/member-initializers.cpp
cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
cfe/trunk/test/CodeGenCXX/no-exceptions.cpp
cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp
cfe/trunk/test/CodeGenCXX/reference-cast.cpp
cfe/trunk/test/CodeGenCXX/threadsafe-statics.cpp
cfe/trunk/test/CodeGenObjC/arc.m
cfe/trunk/test/CodeGenObjC/gnu-exceptions.m
cfe/trunk/test/Driver/darwin-iphone-defaults.m
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Feb 28 16:49:57 2013
@@ -23,6 +23,7 @@
#include "clang/AST/DeclObjC.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Frontend/CodeGenOptions.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/InlineAsm.h"
@@ -1021,6 +1022,65 @@ void CodeGenModule::ConstructAttributeLi
// Attributes that should go on the call site only.
if (!CodeGenOpts.SimplifyLibCalls)
FuncAttrs.addAttribute(llvm::Attribute::NoBuiltin);
+ } else {
+ // Attributes that should go on the function, but not the call site.
+ if (!CodeGenOpts.CodeModel.empty())
+ FuncAttrs.addAttribute("code-model", CodeGenOpts.CodeModel);
+ if (!CodeGenOpts.RelocationModel.empty())
+ FuncAttrs.addAttribute("relocation-model", CodeGenOpts.RelocationModel);
+
+ if (CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp")
+ FuncAttrs.addAttribute("float-abi", "soft");
+ else if (CodeGenOpts.FloatABI == "hard")
+ FuncAttrs.addAttribute("float-abi", "hard");
+
+ if (!CodeGenOpts.DisableFPElim) {
+ /* ignore */ ;
+ } else if (CodeGenOpts.OmitLeafFramePointer) {
+ FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf");
+ } else {
+ FuncAttrs.addAttribute("no-frame-pointer-elim");
+ FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf");
+ }
+
+ switch (CodeGenOpts.getFPContractMode()) {
+ case CodeGenOptions::FPC_Off:
+ FuncAttrs.addAttribute("fp-contract-model", "strict");
+ break;
+ case CodeGenOptions::FPC_On:
+ FuncAttrs.addAttribute("fp-contract-model", "standard");
+ break;
+ case CodeGenOptions::FPC_Fast:
+ FuncAttrs.addAttribute("fp-contract-model", "fast");
+ break;
+ }
+
+ if (CodeGenOpts.LessPreciseFPMAD)
+ FuncAttrs.addAttribute("less-precise-fpmad");
+ if (CodeGenOpts.NoInfsFPMath)
+ FuncAttrs.addAttribute("no-infs-fp-math");
+ if (CodeGenOpts.NoNaNsFPMath)
+ FuncAttrs.addAttribute("no-nans-fp-math");
+ if (CodeGenOpts.NoZeroInitializedInBSS)
+ FuncAttrs.addAttribute("no-zero-init-in-bss");
+ if (CodeGenOpts.UnsafeFPMath)
+ FuncAttrs.addAttribute("unsafe-fp-math");
+ if (CodeGenOpts.SoftFloat)
+ FuncAttrs.addAttribute("use-soft-float");
+ if (CodeGenOpts.StackAlignment)
+ FuncAttrs.addAttribute("stack-align-override",
+ llvm::utostr(CodeGenOpts.StackAlignment));
+ if (CodeGenOpts.StackRealignment)
+ FuncAttrs.addAttribute("realign-stack");
+ if (CodeGenOpts.DisableTailCalls)
+ FuncAttrs.addAttribute("disable-tail-calls");
+ if (!CodeGenOpts.TrapFuncName.empty())
+ FuncAttrs.addAttribute("trap-func-name", CodeGenOpts.TrapFuncName);
+ if (LangOpts.PIELevel != 0)
+ FuncAttrs.addAttribute("pie");
+ if (CodeGenOpts.SSPBufferSize)
+ FuncAttrs.addAttribute("ssp-buffers-size",
+ llvm::utostr(CodeGenOpts.SSPBufferSize));
}
QualType RetTy = FI.getReturnType();
Modified: cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c (original)
+++ cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c Thu Feb 28 16:49:57 2013
@@ -2,11 +2,11 @@
void f(void);
void g(void) {
- // CHECK: define void @g() #0
+ // CHECK: define void @g() [[NUW:#[0-9]+]]
// CHECK-NOT: call void @f() nounwind
f();
}
-// CHECK-NOT: declare void @f() #0
+// CHECK-NOT: declare void @f() [[NUW]]
-// CHECK: attributes #0 = { nounwind{{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGen/address-safety-attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/address-safety-attr.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/address-safety-attr.cpp (original)
+++ cfe/trunk/test/CodeGen/address-safety-attr.cpp Thu Feb 28 16:49:57 2013
@@ -10,33 +10,33 @@
// when AddressSanitizer is enabled, unless no_sanitize_address attribute
// is present.
-// WITHOUT: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
-// BL: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
-// ASAN: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
+// WITHOUT: NoAddressSafety1{{.*}}) [[NOATTR:#[0-9]+]]
+// BL: NoAddressSafety1{{.*}}) [[NOATTR:#[0-9]+]]
+// ASAN: NoAddressSafety1{{.*}}) [[NOATTR:#[0-9]+]]
__attribute__((no_sanitize_address))
int NoAddressSafety1(int *a) { return *a; }
-// WITHOUT: NoAddressSafety2{{.*}}) #[[NOATTR]]
-// BL: NoAddressSafety2{{.*}}) #[[NOATTR]]
-// ASAN: NoAddressSafety2{{.*}}) #[[NOATTR]]
+// WITHOUT: NoAddressSafety2{{.*}}) [[NOATTR]]
+// BL: NoAddressSafety2{{.*}}) [[NOATTR]]
+// ASAN: NoAddressSafety2{{.*}}) [[NOATTR]]
__attribute__((no_sanitize_address))
int NoAddressSafety2(int *a);
int NoAddressSafety2(int *a) { return *a; }
-// WITHOUT: AddressSafetyOk{{.*}}) #[[NOATTR]]
-// BL: AddressSafetyOk{{.*}}) #[[NOATTR]]
-// ASAN: AddressSafetyOk{{.*}}) #[[WITH:[0-9]+]]
+// WITHOUT: AddressSafetyOk{{.*}}) [[NOATTR]]
+// BL: AddressSafetyOk{{.*}}) [[NOATTR]]
+// ASAN: AddressSafetyOk{{.*}}) [[WITH:#[0-9]+]]
int AddressSafetyOk(int *a) { return *a; }
-// WITHOUT: TemplateAddressSafetyOk{{.*}}) #[[NOATTR]]
-// BL: TemplateAddressSafetyOk{{.*}}) #[[NOATTR]]
-// ASAN: TemplateAddressSafetyOk{{.*}}) #[[WITH]]
+// WITHOUT: TemplateAddressSafetyOk{{.*}}) [[NOATTR]]
+// BL: TemplateAddressSafetyOk{{.*}}) [[NOATTR]]
+// ASAN: TemplateAddressSafetyOk{{.*}}) [[WITH]]
template<int i>
int TemplateAddressSafetyOk() { return i; }
-// WITHOUT: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
-// BL: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
-// ASAN: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
+// WITHOUT: TemplateNoAddressSafety{{.*}}) [[NOATTR]]
+// BL: TemplateNoAddressSafety{{.*}}) [[NOATTR]]
+// ASAN: TemplateNoAddressSafety{{.*}}) [[NOATTR]]
template<int i>
__attribute__((no_sanitize_address))
int TemplateNoAddressSafety() { return i; }
@@ -47,12 +47,16 @@ int force_instance = TemplateAddressSafe
// Check that __cxx_global_var_init* get the sanitize_address attribute.
int global1 = 0;
int global2 = *(int*)((char*)&global1+1);
-// WITHOUT: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// BL: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// ASAN: @__cxx_global_var_init{{.*}}#[[WITH]]
-
-// WITHOUT: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// BL: attributes #[[NOATTR]] = { nounwind{{.*}} }
-
-// ASAN: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// ASAN: attributes #[[WITH]] = {{.*}}sanitize_address
+// WITHOUT: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// BL: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// ASAN: @__cxx_global_var_init{{.*}}[[WITH_NO_TF:#[0-9]+]]
+
+// WITHOUT: attributes [[NOATTR]] = { nounwind{{.*}} }
+// WITHOUT: attributes [[NOATTR_NO_TF]] = { nounwind }
+
+// BL: attributes [[NOATTR]] = { nounwind{{.*}} }
+// BL: attributes [[NOATTR_NO_TF]] = { nounwind }
+
+// ASAN: attributes [[NOATTR]] = { nounwind{{.*}} }
+// ASAN: attributes [[WITH]] = { nounwind sanitize_address{{.*}} }
+// ASAN: attributes [[WITH_NO_TF]] = { nounwind sanitize_address }
Modified: cfe/trunk/test/CodeGen/function-attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/function-attributes.c?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/function-attributes.c (original)
+++ cfe/trunk/test/CodeGen/function-attributes.c Thu Feb 28 16:49:57 2013
@@ -43,7 +43,7 @@ void f9b(void) { f9a(); }
// FIXME: We should be setting nounwind on calls.
// CHECK: call i32 @f10_t()
-// CHECK: [[NUW]]
+// CHECK: [[NUW_RN:#[0-9]+]]
// CHECK: {
int __attribute__((const)) f10_t(void);
int f10(void) { return f10_t(); }
@@ -119,6 +119,8 @@ void f19(void) {
// CHECK: attributes [[NUW]] = { nounwind optsize readnone{{.*}} }
// CHECK: attributes [[AI]] = { alwaysinline nounwind optsize readnone{{.*}} }
-// CHECK: attributes [[NR]] = { noreturn nounwind optsize }
// CHECK: attributes [[ALIGN]] = { nounwind optsize readnone alignstack=16{{.*}} }
-// CHECK: attributes [[RT]] = { nounwind optsize returns_twice }
+// CHECK: attributes [[RT]] = { nounwind optsize returns_twice{{.*}} }
+// CHECK: attributes [[NR]] = { noreturn nounwind optsize }
+// CHECK: attributes [[NUW_RN]] = { nounwind optsize readnone }
+// CHECK: attributes [[RT_CALL]] = { nounwind optsize returns_twice }
Modified: cfe/trunk/test/CodeGen/sanitize-thread-attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sanitize-thread-attr.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/sanitize-thread-attr.cpp (original)
+++ cfe/trunk/test/CodeGen/sanitize-thread-attr.cpp Thu Feb 28 16:49:57 2013
@@ -9,33 +9,33 @@
// when ThreadSanitizer is enabled, unless no_sanitize_thread attribute
// is present.
-// WITHOUT: NoTSAN1{{.*}}) #[[NOATTR:[0-9]+]]
-// BL: NoTSAN1{{.*}}) #[[NOATTR:[0-9]+]]
-// TSAN: NoTSAN1{{.*}}) #[[NOATTR:[0-9]+]]
+// WITHOUT: NoTSAN1{{.*}}) [[NOATTR:#[0-9]+]]
+// BL: NoTSAN1{{.*}}) [[NOATTR:#[0-9]+]]
+// TSAN: NoTSAN1{{.*}}) [[NOATTR:#[0-9]+]]
__attribute__((no_sanitize_thread))
int NoTSAN1(int *a) { return *a; }
-// WITHOUT: NoTSAN2{{.*}}) #[[NOATTR]]
-// BL: NoTSAN2{{.*}}) #[[NOATTR]]
-// TSAN: NoTSAN2{{.*}}) #[[NOATTR]]
+// WITHOUT: NoTSAN2{{.*}}) [[NOATTR]]
+// BL: NoTSAN2{{.*}}) [[NOATTR]]
+// TSAN: NoTSAN2{{.*}}) [[NOATTR]]
__attribute__((no_sanitize_thread))
int NoTSAN2(int *a);
int NoTSAN2(int *a) { return *a; }
-// WITHOUT: TSANOk{{.*}}) #[[NOATTR]]
-// BL: TSANOk{{.*}}) #[[NOATTR]]
-// TSAN: TSANOk{{.*}}) #[[WITH:[0-9]+]]
+// WITHOUT: TSANOk{{.*}}) [[NOATTR]]
+// BL: TSANOk{{.*}}) [[NOATTR]]
+// TSAN: TSANOk{{.*}}) [[WITH:#[0-9]+]]
int TSANOk(int *a) { return *a; }
-// WITHOUT: TemplateTSANOk{{.*}}) #[[NOATTR]]
-// BL: TemplateTSANOk{{.*}}) #[[NOATTR]]
-// TSAN: TemplateTSANOk{{.*}}) #[[WITH]]
+// WITHOUT: TemplateTSANOk{{.*}}) [[NOATTR]]
+// BL: TemplateTSANOk{{.*}}) [[NOATTR]]
+// TSAN: TemplateTSANOk{{.*}}) [[WITH]]
template<int i>
int TemplateTSANOk() { return i; }
-// WITHOUT: TemplateNoTSAN{{.*}}) #[[NOATTR]]
-// BL: TemplateNoTSAN{{.*}}) #[[NOATTR]]
-// TSAN: TemplateNoTSAN{{.*}}) #[[NOATTR]]
+// WITHOUT: TemplateNoTSAN{{.*}}) [[NOATTR]]
+// BL: TemplateNoTSAN{{.*}}) [[NOATTR]]
+// TSAN: TemplateNoTSAN{{.*}}) [[NOATTR]]
template<int i>
__attribute__((no_sanitize_thread))
int TemplateNoTSAN() { return i; }
@@ -46,12 +46,16 @@ int force_instance = TemplateTSANOk<42>(
// Check that __cxx_global_var_init* get the sanitize_thread attribute.
int global1 = 0;
int global2 = *(int*)((char*)&global1+1);
-// WITHOUT: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// BL: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// TSAN: @__cxx_global_var_init{{.*}}#[[WITH]]
-
-// WITHOUT: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// BL: attributes #[[NOATTR]] = { nounwind{{.*}} }
-
-// TSAN: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// TSAN: attributes #[[WITH]] = { nounwind{{.*}} sanitize_thread
+// WITHOUT: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// BL: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// TSAN: @__cxx_global_var_init{{.*}}[[WITH_NO_TF:#[0-9]+]]
+
+// WITHOUT: attributes [[NOATTR]] = { nounwind{{.*}} }
+// WITHOUT: attributes [[NOATTR_NO_TF]] = { nounwind }
+
+// BL: attributes [[NOATTR]] = { nounwind{{.*}} }
+// BL: attributes [[NOATTR_NO_TF]] = { nounwind{{.*}} }
+
+// TSAN: attributes [[NOATTR]] = { nounwind{{.*}} }
+// TSAN: attributes [[WITH]] = { nounwind sanitize_thread{{.*}} }
+// TSAN: attributes [[WITH_NO_TF]] = { nounwind sanitize_thread }
Modified: cfe/trunk/test/CodeGen/unwind-attr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/unwind-attr.c?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/unwind-attr.c (original)
+++ cfe/trunk/test/CodeGen/unwind-attr.c Thu Feb 28 16:49:57 2013
@@ -3,7 +3,7 @@
int opaque();
-// CHECK: define [[INT:i.*]] @test0() {
+// CHECK: define [[INT:i.*]] @test0() [[TF:#[0-9]+]] {
// CHECK-NOEXC: define [[INT:i.*]] @test0() [[NUW:#[0-9]+]] {
int test0(void) {
return opaque();
@@ -17,12 +17,13 @@ int test1(void) {
}
// <rdar://problem/8283071>: not for weak functions
-// CHECK: define weak [[INT:i.*]] @test2() {
+// CHECK: define weak [[INT:i.*]] @test2() [[TF]] {
// CHECK-NOEXC: define weak [[INT:i.*]] @test2() [[NUW]] {
__attribute__((weak)) int test2(void) {
return 0;
}
+// CHECK: attributes [[TF]] = { "{{.*}} }
// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
// CHECK-NOEXC: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp Thu Feb 28 16:49:57 2013
@@ -3,16 +3,19 @@ int c(void) __attribute__((const));
int p(void) __attribute__((pure));
int t(void);
-// CHECK: define i32 @_Z1fv() {
+// CHECK: define i32 @_Z1fv() [[TF:#[0-9]+]] {
int f(void) {
- // CHECK: call i32 @_Z1cv() [[NUW_RN:#[0-9]+]]
- // CHECK: call i32 @_Z1pv() [[NUW_RO:#[0-9]+]]
+ // CHECK: call i32 @_Z1cv() [[NUW_RN_CALL:#[0-9]+]]
+ // CHECK: call i32 @_Z1pv() [[NUW_RO_CALL:#[0-9]+]]
return c() + p() + t();
}
-// CHECK: declare i32 @_Z1cv() #0
-// CHECK: declare i32 @_Z1pv() #1
-// CHECK: declare i32 @_Z1tv()
+// CHECK: declare i32 @_Z1cv() [[NUW_RN:#[0-9]+]]
+// CHECK: declare i32 @_Z1pv() [[NUW_RO:#[0-9]+]]
+// CHECK: declare i32 @_Z1tv() [[TF]]
-// CHECK: attributes [[NUW_RN]] = { nounwind readnone }
-// CHECK: attributes [[NUW_RO]] = { nounwind readonly }
+// CHECK: attributes [[TF]] = { {{.*}} }
+// CHECK: attributes [[NUW_RN]] = { nounwind readnone{{.*}} }
+// CHECK: attributes [[NUW_RO]] = { nounwind readonly{{.*}} }
+// CHECK: attributes [[NUW_RN_CALL]] = { nounwind readnone }
+// CHECK: attributes [[NUW_RO_CALL]] = { nounwind readonly }
Modified: cfe/trunk/test/CodeGenCXX/attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/attr.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/attr.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/attr.cpp Thu Feb 28 16:49:57 2013
@@ -31,4 +31,4 @@ int test1() { return 10; }
// CHECK at top of file
extern "C" int test2() __attribute__((alias("_Z5test1v")));
-// CHECK: attributes [[NUW]] = { nounwind }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/cxx11-exception-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx11-exception-spec.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/cxx11-exception-spec.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/cxx11-exception-spec.cpp Thu Feb 28 16:49:57 2013
@@ -10,7 +10,7 @@ template<typename T> struct S {
static void g() noexcept(sizeof(T) == 4);
};
-// CHECK: define {{.*}} @_Z1fIsEvv() {
+// CHECK: define {{.*}} @_Z1fIsEvv() [[NONE:#[0-9]+]] {
template<> void f<short>() { h(); }
// CHECK: define {{.*}} @_Z1fIA2_sEvv() [[NUW:#[0-9]+]] {
template<> void f<short[2]>() noexcept { h(); }
@@ -21,7 +21,7 @@ template<> void S<short>::f() { h(); }
// CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() [[NUW]]
template<> void S<short[2]>::f() noexcept { h(); }
-// CHECK: define {{.*}} @_Z1fIDsEvv() {
+// CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] {
template void f<char16_t>();
// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] {
template void f<char16_t[2]>();
@@ -35,7 +35,7 @@ template void S<char16_t[2]>::f();
void h() {
// CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] {
f<int>();
- // CHECK: define {{.*}} @_Z1fIA2_iEvv() {
+ // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] {
f<int[2]>();
// CHECK: define {{.*}} @_ZN1SIiE1fEv() [[NUW]]
@@ -46,7 +46,7 @@ void h() {
// CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] {
void (*f1)() = &f<float>;
- // CHECK: define {{.*}} @_Z1fIdEvv() {
+ // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] {
void (*f2)() = &f<double>;
// CHECK: define {{.*}} @_ZN1SIfE1fEv() [[NUW]]
@@ -57,7 +57,7 @@ void h() {
// CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] {
(void)&f<char[4]>;
- // CHECK: define {{.*}} @_Z1fIcEvv() {
+ // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] {
(void)&f<char>;
// CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() [[NUW]]
@@ -119,4 +119,5 @@ void j() {
Nested<long>().f<false, long>();
}
-// CHECK: attributes [[NUW]] = { nounwind }
+// CHECK: attributes [[NONE]] = { {{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp Thu Feb 28 16:49:57 2013
@@ -24,7 +24,7 @@ struct M : Q, P {
Q q_arr[2][3];
};
-// CHECK: define i32 @_Z1fv() #0
+// CHECK: define i32 @_Z1fv() [[NUW:#[0-9]+]]
int f() {
{
count = 1;
@@ -35,4 +35,4 @@ int f() {
return count;
}
-// CHECK: attributes #0 = { nounwind{{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/derived-to-base.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/derived-to-base.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/derived-to-base.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/derived-to-base.cpp Thu Feb 28 16:49:57 2013
@@ -15,7 +15,7 @@ void f() {
b.f();
}
-// CHECK: define %struct.B* @_Z1fP1A(%struct.A* %a) #0
+// CHECK: define %struct.B* @_Z1fP1A(%struct.A* %a) [[NUW:#[0-9]+]]
B *f(A *a) {
// CHECK-NOT: br label
// CHECK: ret %struct.B*
@@ -25,7 +25,7 @@ B *f(A *a) {
// PR5965
namespace PR5965 {
-// CHECK: define %struct.A* @_ZN6PR59651fEP1B(%struct.B* %b) #0
+// CHECK: define %struct.A* @_ZN6PR59651fEP1B(%struct.B* %b) [[NUW]]
A *f(B* b) {
// CHECK-NOT: br label
// CHECK: ret %struct.A*
@@ -46,4 +46,4 @@ namespace test3 {
}
}
-// CHECK: attributes #0 = { nounwind{{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions.cpp Thu Feb 28 16:49:57 2013
@@ -526,6 +526,4 @@ namespace test11 {
// (After this is a terminate landingpad.)
}
-// CHECK: attributes [[NUW]] = { nounwind }
// CHECK: attributes [[NI_NR_NUW]] = { noinline noreturn nounwind }
-// CHECK: attributes [[NR_NUW]] = { noreturn nounwind }
Modified: cfe/trunk/test/CodeGenCXX/global-dtor-no-atexit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/global-dtor-no-atexit.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/global-dtor-no-atexit.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/global-dtor-no-atexit.cpp Thu Feb 28 16:49:57 2013
@@ -5,12 +5,12 @@
// CHECK: call void @_ZN1AC1Ev([[A:%.*]]* @a)
// CHECK-NEXT: call i32 @atexit(void ()* @__dtor_a)
-// CHECK: define internal void @__dtor_a() #0
+// CHECK: define internal void @__dtor_a() [[NUW:#[0-9]+]]
// CHECK: call void @_ZN1AD1Ev([[A]]* @a)
// CHECK: call void @_ZN1AC1Ev([[A]]* @b)
// CHECK-NEXT: call i32 @atexit(void ()* @__dtor_b)
-// CHECK: define internal void @__dtor_b() #0
+// CHECK: define internal void @__dtor_b() [[NUW]]
// CHECK: call void @_ZN1AD1Ev([[A]]* @b)
class A {
@@ -33,14 +33,14 @@ A a, b;
// CHECK-NEXT: call i32 @atexit(void ()* @__dtor__ZZ4funcvE2a2)
// CHECK-NEXT: call void @__cxa_guard_release(i64* @_ZGVZ4funcvE2a2)
-// CHECK: define internal void @__dtor__ZZ4funcvE2a1() #0
+// CHECK: define internal void @__dtor__ZZ4funcvE2a1() [[NUW]]
// CHECK: call void @_ZN1AD1Ev([[A]]* @_ZZ4funcvE2a1)
-// CHECK: define internal void @__dtor__ZZ4funcvE2a2() #0
+// CHECK: define internal void @__dtor__ZZ4funcvE2a2() [[NUW]]
// CHECK: call void @_ZN1AD1Ev([[A]]* @_ZZ4funcvE2a2)
void func() {
static A a1, a2;
}
-// CHECK: attributes #0 = { nounwind }
+// CHECK: attributes [[NUW]] = { nounwind }
Modified: cfe/trunk/test/CodeGenCXX/member-initializers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/member-initializers.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/member-initializers.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/member-initializers.cpp Thu Feb 28 16:49:57 2013
@@ -21,7 +21,7 @@ int f() {
}
// Test that we don't try to fold the default value of j when initializing i.
-// CHECK: define i32 @_Z9test_foldv() #0
+// CHECK: define i32 @_Z9test_foldv() [[NUW_RN:#[0-9]+]]
int test_fold() {
struct A {
A(const int j = 1) : i(j) { }
@@ -32,4 +32,4 @@ int test_fold() {
return A(2).i;
}
-// CHECK: attributes #0 = { nounwind readnone{{.*}} }
+// CHECK: attributes [[NUW_RN]] = { nounwind readnone{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp Thu Feb 28 16:49:57 2013
@@ -5,7 +5,7 @@ struct ClassWithoutDtor {
};
void check_array_no_cookies() {
-// CHECK: define void @"\01?check_array_no_cookies@@YAXXZ"() #0
+// CHECK: define void @"\01?check_array_no_cookies@@YAXXZ"() [[NUW:#[0-9]+]]
// CHECK: call noalias i8* @"\01??_U at YAPAXI@Z"(i32 42)
ClassWithoutDtor *array = new ClassWithoutDtor[42];
@@ -58,4 +58,4 @@ void check_array_cookies_aligned() {
// CHECK: getelementptr inbounds i8* [[ARRAY_AS_CHAR]], i64 -8
}
-// CHECK: attributes #0 = { nounwind{{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/no-exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/no-exceptions.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/no-exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/no-exceptions.cpp Thu Feb 28 16:49:57 2013
@@ -11,4 +11,4 @@ void f() throw (int) {
// CHECK: ret void
}
-// CHECK: attributes [[NUW]] = { nounwind }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp Thu Feb 28 16:49:57 2013
@@ -151,13 +151,13 @@ struct A {
A() : a() {}
};
-// CHECK-O3: define zeroext i1 @_ZN6PR71395checkEv() [[NUW_RO:#[0-9]+]]
+// CHECK-O3: define zeroext i1 @_ZN6PR71395checkEv() [[NUW:#[0-9]+]]
bool check() {
// CHECK-O3: ret i1 true
return A().a.data == 0;
}
-// CHECK-O3: define zeroext i1 @_ZN6PR71396check2Ev() [[NUW_RO]]
+// CHECK-O3: define zeroext i1 @_ZN6PR71396check2Ev() [[NUW]]
bool check2() {
// CHECK-O3: ret i1 true
return ptr_to_member_type() == 0;
@@ -255,4 +255,4 @@ namespace PR13097 {
// CHECK: call void @_ZN7PR130971XC1ERKS0_
}
-// CHECK-O3: attributes [[NUW_RO]] = { nounwind readnone{{.*}} }
+// CHECK-O3: attributes [[NUW]] = { nounwind readnone{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/reference-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/reference-cast.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/reference-cast.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/reference-cast.cpp Thu Feb 28 16:49:57 2013
@@ -193,4 +193,4 @@ namespace PR10650 {
// CHECK: store i64
}
-// CHECK: attributes [[NUW]] = { nounwind }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/threadsafe-statics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/threadsafe-statics.cpp?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/threadsafe-statics.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/threadsafe-statics.cpp Thu Feb 28 16:49:57 2013
@@ -22,6 +22,6 @@ void g() {
// NO-TSS-NOT: call void @__cxa_guard_release
// NO-TSS: ret void
-// WITH-TSS: attributes [[NUW]] = { nounwind }
+// WITH-TSS: attributes [[NUW]] = { nounwind{{.*}} }
-// NO-TSS: attributes [[NUW]] = { nounwind }
+// NO-TSS: attributes [[NUW]] = { nounwind{{.*}} }
Modified: cfe/trunk/test/CodeGenObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc.m?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc.m Thu Feb 28 16:49:57 2013
@@ -1486,3 +1486,4 @@ void test70(id i) {
// ARC-ALIEN: attributes [[NLB]] = { nonlazybind }
// ARC-NATIVE: attributes [[NLB]] = { nonlazybind }
+// CHECK: attributes [[NUW]] = { nounwind }
Modified: cfe/trunk/test/CodeGenObjC/gnu-exceptions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/gnu-exceptions.m?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/gnu-exceptions.m (original)
+++ cfe/trunk/test/CodeGenObjC/gnu-exceptions.m Thu Feb 28 16:49:57 2013
@@ -6,7 +6,7 @@ void log(int i);
@class C;
-// CHECK: define void @test0() {
+// CHECK: define void @test0() [[TF:#[0-9]+]] {
void test0() {
@try {
// CHECK: invoke void @opaque()
@@ -30,3 +30,5 @@ void test0() {
log(1);
}
+
+// CHECK: attributes [[TF]] = { "{{.*}} }
Modified: cfe/trunk/test/Driver/darwin-iphone-defaults.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-iphone-defaults.m?rev=176304&r1=176303&r2=176304&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-iphone-defaults.m (original)
+++ cfe/trunk/test/Driver/darwin-iphone-defaults.m Thu Feb 28 16:49:57 2013
@@ -1,6 +1,6 @@
// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s
-// CHECK: @f0() #0
+// CHECK: @f0() [[F0:#[0-9]+]]
// CHECK: @__f0_block_invoke
// CHECK: void @f1
// CHECK-NOT: msgSend_fixup_alloc
@@ -26,5 +26,4 @@ void f1() {
[I1 alloc];
}
-// CHECK: attributes #0 = { ssp{{.*}} }
-// CHECK: attributes #1 = { nonlazybind }
+// CHECK: attributes [[F0]] = { ssp{{.*}} }
More information about the cfe-commits
mailing list