diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 992e87319943..4ea707621b33 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2116,8 +2116,8 @@ void CodeGenModule::ConstructAttributeList( return false; }; - FuncAttrs.addAttribute("disable-tail-calls", - llvm::toStringRef(shouldDisableTailCalls())); + if (shouldDisableTailCalls()) + FuncAttrs.addAttribute("disable-tail-calls", "true"); // CPU/feature overrides. addDefaultFunctionDefinitionAttributes // handles these separately to set them based on the global defaults. diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index b393c88f7751..f552b27fee5e 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -859,8 +859,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, } // Add no-jump-tables value. - Fn->addFnAttr("no-jump-tables", - llvm::toStringRef(CGM.getCodeGenOpts().NoUseJumpTables)); + if (CGM.getCodeGenOpts().NoUseJumpTables) + Fn->addFnAttr("no-jump-tables", "true"); // Add no-inline-line-tables value. if (CGM.getCodeGenOpts().NoInlineLineTables) diff --git a/clang/test/CodeGen/attr-disable-tail-calls.c b/clang/test/CodeGen/attr-disable-tail-calls.c index cd44346037f9..7ae241922813 100644 --- a/clang/test/CodeGen/attr-disable-tail-calls.c +++ b/clang/test/CodeGen/attr-disable-tail-calls.c @@ -15,5 +15,5 @@ int f2() __attribute__((disable_tail_calls)) { } // DISABLE: attributes [[ATTRTRUE]] = { {{.*}}"disable-tail-calls"="true"{{.*}} } -// ENABLE: attributes [[ATTRFALSE]] = { {{.*}}"disable-tail-calls"="false"{{.*}} } +// ENABLE-NOT: attributes [[ATTRFALSE]] = { {{.*}}"disable-tail-calls"="false"{{.*}} } // ENABLE: attributes [[ATTRTRUE]] = { {{.*}}"disable-tail-calls"="true"{{.*}} } diff --git a/clang/test/CodeGenCXX/attr-disable-tail-calls.cpp b/clang/test/CodeGenCXX/attr-disable-tail-calls.cpp index abd1031848df..a7d28f2d0091 100644 --- a/clang/test/CodeGenCXX/attr-disable-tail-calls.cpp +++ b/clang/test/CodeGenCXX/attr-disable-tail-calls.cpp @@ -30,6 +30,6 @@ int foo1() { // CHECK: define linkonce_odr i32 @_ZN1D2m1Ev(%class.D* {{[^,]*}} %this) unnamed_addr [[ATTRFALSE:#[0-9]+]] // CHECK: define linkonce_odr i32 @_ZN1D2m2Ev(%class.D* {{[^,]*}} %this) unnamed_addr [[ATTRTRUE1:#[0-9]+]] -// CHECK: attributes [[ATTRFALSE]] = { {{.*}}"disable-tail-calls"="false"{{.*}} } +// CHECK-NOT: attributes [[ATTRFALSE]] = { {{.*}}"disable-tail-calls"="false"{{.*}} } // CHECK: attributes [[ATTRTRUE0]] = { {{.*}}"disable-tail-calls"="true"{{.*}} } // CHECK: attributes [[ATTRTRUE1]] = { {{.*}}"disable-tail-calls"="true"{{.*}} } diff --git a/clang/test/CodeGenCXX/union-tbaa2.cpp b/clang/test/CodeGenCXX/union-tbaa2.cpp index 65872d4a98ae..ba2a8a222a22 100644 --- a/clang/test/CodeGenCXX/union-tbaa2.cpp +++ b/clang/test/CodeGenCXX/union-tbaa2.cpp @@ -20,7 +20,6 @@ struct A { // CHECK: tbaa ![[OCPATH:[0-9]+]] // CHECK: store <4 x double> // CHECK: tbaa ![[OCPATH]] -// CHECK: call a = _mm256_setr_pd(0.0, 1.0, 2.0, 3.0); b = _mm256_setr_pd(4.0, 5.0, 6.0, 7.0); }