<div dir="ltr">Here is a sample test I just ran with fileA.cpp containing the following:<div><br><div><span class="">void</span> foo(<span class="">int</span>* i) {</div><div><span class="">  </span>delete<span class=""> i;</span></div><div>}</div></div><div><br class="">--------------------------------------------------------------------------------------------------------<br></div><div>With Clang 3.5:</div><div>----------------------------------------------</div><div>$ clang++ -std=c++1y -c fileA.cpp -fno-sized-deallocation<br>clang: error: unknown argument: '-fno-sized-deallocation'<br>$ clang++ -std=c++1y -c fileA.cpp -fsized-deallocation<br>clang: error: unknown argument: '-fsized-deallocation'</div><div><br></div>--------------------------------------------------------------------------------------------------------<div>With Clang 3.7 (current):<br class="">----------------------------------------------</div><div>$ clang++ -std=c++1y -c fileA.cpp -fsized-deallocation<br>clang: error: unknown argument: '-fsized-deallocation'</div>$ clang++ -std=c++1y -c fileA.cpp<br>$ nm fileA.o | c++filt<br>0000000000000000 T foo(int*)<br>                 U operator delete(void*, unsigned long)<div>$ clang++ -std=c++1y -c fileA.cpp -fno-sized-deallocation<br>$ nm fileA.o | c++filt<br>0000000000000000 T foo(int*)<br>                 U operator delete(void*)</div><div>--------------------------------------------------------------------------------------------------------</div><div><br></div><div>It actually looks like by not exposing -fsized-deallocation in the driver, sized deallocation is </div><div>enabled by default in C++14 mode, until one uses -fno-sized-deallocation.</div><div><br></div><div>What's missing? </div><div>The only other issue that has come to my attention is <span style="font-size:12.8000001907349px">PR22635, which is independent of the current</span></div><div><span style="font-size:12.8000001907349px">designs under discussion, and is apparently fixed b</span>y r229913.</div><div><br></div><div>If the issue is whether to switch -fdefine-sized-deallocation by default or not, I don't see how</div><div>that affects whether to add -fno-sized-deallocation (or to make -fsized-deallocation visible in the driver).</div><div><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 20, 2015 at 9:20 AM, Larisse Voufo <span dir="ltr"><<a href="mailto:lvoufo@google.com" target="_blank">lvoufo@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Feb 19, 2015 at 7:03 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br></span><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Feb 19, 2015 at 6:07 PM, Larisse Voufo <span dir="ltr"><<a href="mailto:lvoufo@google.com" target="_blank">lvoufo@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: lvoufo<br>
Date: Thu Feb 19 20:07:22 2015<br>
New Revision: 229950<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=229950&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=229950&view=rev</a><br>
Log:<br>
Add -fno-sized-deallocation option for completeness of fix in r229241 in documentation in r229818.<br></blockquote><div><br></div></span><div>This seems really strange; the driver now has a -fno-sized-deallocation but no -fsized-deallocation,</div></div></div></div></blockquote><div> </div></span><div>-fsized-deallocation was never exposed in the driver. I didn't want to mess with its design too much at all, except for using it as a reference to add -fdefine-sized-deallocation and -fno-sized-deallocation. I could expose it if you want.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>and the frontend now has both but they don't override each other in the usual way.</div></div></div></div></blockquote><div><br></div></span><div>They should. I specifically set Opts.SizedDeallocation to turn itself off if -fno-sized-deallocation is set. </div><div>If this doesn't work (which would be surprising), then there must be something else going on.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> I don't think this is the right design. Can you revert this for now until we finish discussing what command-line interface we want here?</div></div></div></div></blockquote><div><br></div></span><div>Well, aside from flag naming, we currently have all the pieces of the designs in place, except for turning off sized deallocation.</div><div>With this, switching over to whatever design we end up with, will be no beig deal.</div><div><br></div><div>Besides, reverting this means that I have to update the cxx_status page to remove the -fno-sized-deallocation option.</div><div>I really don't see why we should hold up when we have something that works for now.</div><div><div class="h5"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Modified:<br>
    cfe/trunk/include/clang/Driver/Options.td<br>
    cfe/trunk/lib/Driver/Tools.cpp<br>
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
    cfe/trunk/test/CodeGenCXX/cxx1y-sized-deallocation.cpp<br>
    cfe/trunk/test/CodeGenCXX/implicit-allocation-functions.cpp<br>
    cfe/trunk/test/CodeGenCXX/pr21754.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Driver/Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=229950&r1=229949&r2=229950&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=229950&r1=229949&r2=229950&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Driver/Options.td (original)<br>
+++ cfe/trunk/include/clang/Driver/Options.td Thu Feb 19 20:07:22 2015<br>
@@ -394,8 +394,10 @@ def fasm_blocks : Flag<["-"], "fasm-bloc<br>
 def fno_asm_blocks : Flag<["-"], "fno-asm-blocks">, Group<f_Group>;<br>
<br>
 def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>;<br>
+def fno_sized_deallocation: Flag<["-"], "fno-sized-deallocation">, Group<f_Group>,<br>
+  HelpText<"Disable sized deallocation functions">, Flags<[CC1Option]>;<br>
 def fdefine_sized_deallocation: Flag<["-"], "fdefine-sized-deallocation">, Group<f_Group>,<br>
-  HelpText<"Allow compiler-generated definition of sized deallocation function">, Flags<[CC1Option]>;<br>
+  HelpText<"Allow compiler-generated definition of sized deallocation functions">, Flags<[CC1Option]>;<br>
 def fastcp : Flag<["-"], "fastcp">, Group<f_Group>;<br>
 def fastf : Flag<["-"], "fastf">, Group<f_Group>;<br>
 def fast : Flag<["-"], "fast">, Group<f_Group>;<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=229950&r1=229949&r2=229950&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=229950&r1=229949&r2=229950&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Feb 19 20:07:22 2015<br>
@@ -4213,6 +4213,10 @@ void Clang::ConstructJob(Compilation &C,<br>
                     options::OPT_fno_assume_sane_operator_new))<br>
     CmdArgs.push_back("-fno-assume-sane-operator-new");<br>
<br>
+  // -fno-sized-deallocation: disable sized delete.<br>
+  if (Args.hasArg(options::OPT_fno_sized_deallocation))<br>
+    CmdArgs.push_back("-fno-sized-deallocation");<br>
+<br>
   // -fdefine-sized-deallocation: default implementation of sized delete as a<br>
   // weak definition.<br>
   if (Args.hasArg(options::OPT_fdefine_sized_deallocation))<br>
<br>
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=229950&r1=229949&r2=229950&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=229950&r1=229949&r2=229950&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu Feb 19 20:07:22 2015<br>
@@ -1522,6 +1522,7 @@ static void ParseLangArgs(LangOptions &O<br>
   Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin);<br>
   Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new);<br>
   Opts.SizedDeallocation |= Args.hasArg(OPT_fsized_deallocation);<br>
+  Opts.SizedDeallocation &= !Args.hasArg(OPT_fno_sized_deallocation);<br>
   Opts.DefineSizedDeallocation = Opts.SizedDeallocation &&<br>
       Args.hasArg(OPT_fdefine_sized_deallocation);<br>
   Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions);<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/cxx1y-sized-deallocation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx1y-sized-deallocation.cpp?rev=229950&r1=229949&r2=229950&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx1y-sized-deallocation.cpp?rev=229950&r1=229949&r2=229950&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/cxx1y-sized-deallocation.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/cxx1y-sized-deallocation.cpp Thu Feb 19 20:07:22 2015<br>
@@ -3,6 +3,7 @@<br>
 // RUN: %clang_cc1 -std=c++11 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKUND<br>
 // RUN: %clang_cc1 -std=c++11 -fsized-deallocation -fdefine-sized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKDEF<br>
 // RUN: %clang_cc1 -std=c++11 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED<br>
+// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -fno-sized-deallocation -o - | FileCheck %s --check-prefix=CHECK-UNSIZED<br>
<br>
 // CHECK-UNSIZED-NOT: _ZdlPvm<br>
 // CHECK-UNSIZED-NOT: _ZdaPvm<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/implicit-allocation-functions.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/implicit-allocation-functions.cpp?rev=229950&r1=229949&r2=229950&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/implicit-allocation-functions.cpp?rev=229950&r1=229949&r2=229950&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/implicit-allocation-functions.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/implicit-allocation-functions.cpp Thu Feb 19 20:07:22 2015<br>
@@ -1,5 +1,6 @@<br>
 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++11 %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11<br>
 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++11 -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK11<br>
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fno-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11<br>
 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14UND<br>
 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14UND<br>
 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fdefine-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/pr21754.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr21754.cpp?rev=229950&r1=229949&r2=229950&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr21754.cpp?rev=229950&r1=229949&r2=229950&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/pr21754.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/pr21754.cpp Thu Feb 19 20:07:22 2015<br>
@@ -1,12 +1,10 @@<br>
 // RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++1y -o - %s 2>&1 | FileCheck %s<br>
 // RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++1y -fdefine-sized-deallocation -o - %s 2>&1 | FileCheck %s<br>
+// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++1y -fno-sized-deallocation -o - %s 2>&1 | FileCheck %s<br>
 // RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++11 -fsized-deallocation -o - %s 2>&1 | FileCheck %s<br>
 // RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++11 -fsized-deallocation -fdefine-sized-deallocation -o - %s 2>&1 | FileCheck %s<br>
 // RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++11 -o - %s 2>&1 | FileCheck %s<br>
<br>
-// CHECK-UNSIZED-NOT: _ZdlPvm<br>
-// CHECK-UNSIZED-NOT: _ZdaPvm<br>
-<br>
 void operator delete(void*, unsigned long) throw() __attribute__((alias("foo")));<br>
 extern "C" void foo(void*, unsigned long) {}<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>