[PATCH] D16539: [FIX] 26194 - LLVM crash in CXXNameMangler::mangleType

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 9 10:04:12 PST 2016


Anastasia added inline comments.

================
Comment at: lib/AST/MicrosoftMangle.cpp:1386
@@ -1385,1 +1385,3 @@
 
+  if (Quals.hasAddressSpace()) {
+    // Address space extension:
----------------
I was just wondering since this code appears to be a repetition from ItaniumMangler.cpp, could we just factor it out to a common function.

I think Mangler.cpp could be a good place for having its definition then next to ObjC specific functions (see for example mangleObjCMethodName()). We would just have to update  comments in this file accordingly to reflect that it now contains OpenCL and CUDA functionality as well.

================
Comment at: test/CodeGenOpenCL/generic-mangling-itanium.cl:1
@@ +1,2 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -x cl -cl-std=CL2.0 -o - %s | FileCheck %s
+
----------------
Could we extend test/CodeGenOpenCL/address-spaces-mangling.cl instead of adding another file?

================
Comment at: test/CodeGenOpenCL/generic-mangling-itanium.cl:5
@@ +4,3 @@
+bool __attribute__((__overloadable__)) atomic_compare_exchange_strong(
+	volatile  __global atomic_int *object,
+  int  *expected,
----------------
Did you mean to test generic not global?

================
Comment at: test/CodeGenOpenCL/generic-mangling-microsoft.cl:1
@@ +1,2 @@
+// RUN: %clang_cc1 -triple i686-pc-windows-msvc -emit-llvm -x cl -cl-std=CL2.0 -o - %s | FileCheck %s
+
----------------
I would very much like to have test/CodeGenOpenCL/address-spaces-mangling.cl extended here too. You can just add a new RUN line along with a new -check-prefix option.


http://reviews.llvm.org/D16539





More information about the cfe-commits mailing list