r244416 - [modules] PR22534: Load files specified by -fmodule-file= eagerly. In particular, this avoids the need to re-parse module map files when using such a module.

2015-08-09 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Sun Aug  9 03:48:41 2015
New Revision: 244416

URL: http://llvm.org/viewvc/llvm-project?rev=244416&view=rev
Log:
[modules] PR22534: Load files specified by -fmodule-file= eagerly. In 
particular, this avoids the need to re-parse module map files when using such a 
module.

Added:
cfe/trunk/test/Modules/explicit-build-missing-files.cpp
Modified:
cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/test/Index/pch-depending-on-deleted-module.c
cfe/trunk/test/Modules/dependency-gen.modulemap
cfe/trunk/test/Modules/explicit-build.cpp
cfe/trunk/test/Modules/fatal-module-loader-error.m
cfe/trunk/test/Modules/relative-dep-gen.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=244416&r1=244415&r2=244416&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Sun Aug  9 03:48:41 
2015
@@ -194,9 +194,8 @@ def err_unable_to_make_temp : Error<
   "unable to make temporary file: %0">;
   
 // Modules
-def err_module_file_conflict : Error<"module '%0' found in both '%1' and 
'%2'">;
 def err_module_format_unhandled : Error<
-  "no handler registered for module format '%0'">;
+  "no handler registered for module format '%0'">, DefaultFatal;
 
 // TransformActions
 // TODO: Use a custom category name to distinguish rewriter errors.

Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=244416&r1=244415&r2=244416&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Sun Aug  9 
03:48:41 2015
@@ -194,16 +194,6 @@ def remark_module_build_done : Remark<"f
 def err_conflicting_module_names : Error<
   "conflicting module names specified: '-fmodule-name=%0' and "
   "'-fmodule-implementation-of %1'">;
-def err_conflicting_module_files : Error<
-  "module '%0' is defined in both '%1' and '%2'">;
-def err_module_file_not_found : Error<
-  "module file '%0' not found">, DefaultFatal;
-def err_module_file_invalid : Error<
-  "file '%0' is not a valid precompiled module file">, DefaultFatal;
-def note_module_file_imported_by : Note<
-  "imported by %select{|module '%2' in }1'%0'">;
-def err_module_file_not_module : Error<
-  "AST file '%0' was not built as a module">, DefaultFatal;
 
 def err_missing_vfs_overlay_file : Error<
   "virtual filesystem overlay file '%0' not found">, DefaultFatal;

Modified: cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=244416&r1=244415&r2=244416&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Sun Aug  9 
03:48:41 2015
@@ -53,6 +53,20 @@ def err_pch_different_branch : Error<
 def err_pch_with_compiler_errors : Error<
 "PCH file contains compiler errors">;
 
+def err_module_file_conflict : Error<
+  "module '%0' is defined in both '%1' and '%2'">, DefaultFatal;
+def err_module_file_not_found : Error<
+  "%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal;
+def err_module_file_out_of_date : Error<
+  "%select{PCH|module|AST}0 file '%1' is out of date and "
+  "needs to be rebuilt%select{|: %3}2">, DefaultFatal;
+def err_module_file_invalid : Error<
+  "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file">, 
DefaultFatal;
+def note_module_file_imported_by : Note<
+  "imported by %select{|module '%2' in }1'%0'">;
+def err_module_file_not_module : Error<
+  "AST file '%0' was not built as a module">, DefaultFatal;
+
 def err_imported_module_not_found : Error<
 "module '%0' in AST file '%1' (imported by AST file '%2') "
 "is not defined in any loaded module map file; "
@@ -82,9 +96,6 @@ def err_pch_pp_detailed_record : Error<
 "'-detailed-preprocessing-record' but %select{precompiled header was not "
 "built with it|it is not present on the command line}0">;
 
-def err_not_a_pch_file : Error<
-"'%0' does not appear to be a precompiled header file">, DefaultFatal;
-
 def err_module_odr_violation_missing_decl : Error<
   "%q0 from module '%1' is not prese

Re: [PATCH] D7642: Introduce the idea of a minimum libc version

2015-08-09 Thread Saleem Abdulrasool via cfe-commits
compnerd added a comment.

-gnu implies GLIBC.  Traditionally, -uclibc is used instead of -gnu for uclibc 
environments, and many (most?) Linux distros use -musl to indicate a MUSL 
environment.  For Android, the environment is -android, and thus, assumed to be 
bionic.  If the OS is BSD, usually, the assumption is that it is using the BSD 
libc.  I guess that we can disable this for Linux, but I think that this would 
be useful to have for non-Windows environments, particularly Android, where you 
do have differences between versions (IIRC L fixed issues with PIC).


Repository:
  rL LLVM

http://reviews.llvm.org/D7642



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r244427 - clang/test/Modules: Satisfy win32 hosts due to dospath issue.

2015-08-09 Thread NAKAMURA Takumi via cfe-commits
Author: chapuni
Date: Sun Aug  9 17:55:50 2015
New Revision: 244427

URL: http://llvm.org/viewvc/llvm-project?rev=244427&view=rev
Log:
clang/test/Modules: Satisfy win32 hosts due to dospath issue.

Modified:
cfe/trunk/test/Modules/dependency-gen.modulemap
cfe/trunk/test/Modules/explicit-build.cpp
cfe/trunk/test/Modules/relative-dep-gen.cpp

Modified: cfe/trunk/test/Modules/dependency-gen.modulemap
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/dependency-gen.modulemap?rev=244427&r1=244426&r2=244427&view=diff
==
--- cfe/trunk/test/Modules/dependency-gen.modulemap (original)
+++ cfe/trunk/test/Modules/dependency-gen.modulemap Sun Aug  9 17:55:50 2015
@@ -39,5 +39,5 @@ extern module "test-base" "Inputs/depend
 // EXPLICIT-FIXME: {{.*}}/base.pcm
 //
 // EXPLICIT: {{^}}explicit.pcm:
-// EXPLICIT: {{.*}}/dependency-gen.modulemap
+// EXPLICIT: {{.*[/\\]}}dependency-gen.modulemap
 // EXPLICIT: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h

Modified: cfe/trunk/test/Modules/explicit-build.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/explicit-build.cpp?rev=244427&r1=244426&r2=244427&view=diff
==
--- cfe/trunk/test/Modules/explicit-build.cpp (original)
+++ cfe/trunk/test/Modules/explicit-build.cpp Sun Aug  9 17:55:50 2015
@@ -138,7 +138,7 @@
 // RUN:-fmodule-map-file=%S/Inputs/explicit-build/module.modulemap 
\
 // RUN:%s 2>&1 | FileCheck --check-prefix=CHECK-MULTIPLE-AS %s
 //
-// CHECK-MULTIPLE-AS: error: module 'a' is defined in both 
'{{.*}}/a{{.*}}.pcm' and '{{.*[/\\]}}a{{.*}}.pcm'
+// CHECK-MULTIPLE-AS: error: module 'a' is defined in both 
'{{.*[/\\]}}a{{.*}}.pcm' and '{{.*[/\\]}}a{{.*}}.pcm'
 
 // ---
 // Try to import a PCH with -fmodule-file=

Modified: cfe/trunk/test/Modules/relative-dep-gen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/relative-dep-gen.cpp?rev=244427&r1=244426&r2=244427&view=diff
==
--- cfe/trunk/test/Modules/relative-dep-gen.cpp (original)
+++ cfe/trunk/test/Modules/relative-dep-gen.cpp Sun Aug  9 17:55:50 2015
@@ -27,4 +27,4 @@
 // CHECK-USE: use.o:
 // CHECK-USE-DAG:   Inputs/relative-dep-gen{{(-cwd)?}}.modulemap
 // CHECK-USE-DAG:   relative-dep-gen.cpp
-// CHECK-USE-DAG:   Inputs/relative-dep-gen-1.h
+// CHECK-USE-DAG:   Inputs{{[/\\]}}relative-dep-gen-1.h


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D7642: Introduce the idea of a minimum libc version

2015-08-09 Thread David Majnemer via cfe-commits
majnemer added a comment.

We already support a version for the environment in the triple, can we just use 
that?


Repository:
  rL LLVM

http://reviews.llvm.org/D7642



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D7642: Introduce the idea of a minimum libc version

2015-08-09 Thread Saleem Abdulrasool via cfe-commits
compnerd added a comment.

Yes, we *could*.  Its just a matter of how it is being specified.  I find that 
having the separate option is potentially cleaner than stuffing it in the 
triple (which does get pushed into the metadata), and then parsing it back out 
as a value.  I think that this is something that longer term could be more 
easily merged into some of the ideas floated about on the thread regarding the 
future of triples.  Is there a strong reason to stuff this into the triple and 
parse it back out?


Repository:
  rL LLVM

http://reviews.llvm.org/D7642



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D7642: Introduce the idea of a minimum libc version

2015-08-09 Thread David Majnemer via cfe-commits
majnemer added a comment.

I think it would be inconsistent with the other platforms which have this 
version information.  The platforms which have an environment version stick it 
in the triple (Android, MSVC) and the platforms which have an OS version also 
stick it in the triple (Darwin, iOS, OS X).

Furthermore, it is possible to specify the MSVC version and the Darwin OS 
version in clang without specifying the entire triple.  The 
-fms-compatibility-version flag (and the corresponding flags for Darwin-based 
operating systems) update the version.


Repository:
  rL LLVM

http://reviews.llvm.org/D7642



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r244427 - clang/test/Modules: Satisfy win32 hosts due to dospath issue.

2015-08-09 Thread Richard Smith via cfe-commits
On Aug 9, 2015 3:56 PM, "NAKAMURA Takumi via cfe-commits" <
cfe-commits@lists.llvm.org> wrote:
>
> Author: chapuni
> Date: Sun Aug  9 17:55:50 2015
> New Revision: 244427
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244427&view=rev
> Log:
> clang/test/Modules: Satisfy win32 hosts due to dospath issue.

Thanks!

> Modified:
> cfe/trunk/test/Modules/dependency-gen.modulemap
> cfe/trunk/test/Modules/explicit-build.cpp
> cfe/trunk/test/Modules/relative-dep-gen.cpp
>
> Modified: cfe/trunk/test/Modules/dependency-gen.modulemap
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/dependency-gen.modulemap?rev=244427&r1=244426&r2=244427&view=diff
>
==
> --- cfe/trunk/test/Modules/dependency-gen.modulemap (original)
> +++ cfe/trunk/test/Modules/dependency-gen.modulemap Sun Aug  9 17:55:50
2015
> @@ -39,5 +39,5 @@ extern module "test-base" "Inputs/depend
>  // EXPLICIT-FIXME: {{.*}}/base.pcm
>  //
>  // EXPLICIT: {{^}}explicit.pcm:
> -// EXPLICIT: {{.*}}/dependency-gen.modulemap
> +// EXPLICIT: {{.*[/\\]}}dependency-gen.modulemap
>  // EXPLICIT: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h
>
> Modified: cfe/trunk/test/Modules/explicit-build.cpp
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/explicit-build.cpp?rev=244427&r1=244426&r2=244427&view=diff
>
==
> --- cfe/trunk/test/Modules/explicit-build.cpp (original)
> +++ cfe/trunk/test/Modules/explicit-build.cpp Sun Aug  9 17:55:50 2015
> @@ -138,7 +138,7 @@
>  // RUN:
-fmodule-map-file=%S/Inputs/explicit-build/module.modulemap \
>  // RUN:%s 2>&1 | FileCheck --check-prefix=CHECK-MULTIPLE-AS
%s
>  //
> -// CHECK-MULTIPLE-AS: error: module 'a' is defined in both
'{{.*}}/a{{.*}}.pcm' and '{{.*[/\\]}}a{{.*}}.pcm'
> +// CHECK-MULTIPLE-AS: error: module 'a' is defined in both
'{{.*[/\\]}}a{{.*}}.pcm' and '{{.*[/\\]}}a{{.*}}.pcm'
>
>  // ---
>  // Try to import a PCH with -fmodule-file=
>
> Modified: cfe/trunk/test/Modules/relative-dep-gen.cpp
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/relative-dep-gen.cpp?rev=244427&r1=244426&r2=244427&view=diff
>
==
> --- cfe/trunk/test/Modules/relative-dep-gen.cpp (original)
> +++ cfe/trunk/test/Modules/relative-dep-gen.cpp Sun Aug  9 17:55:50 2015
> @@ -27,4 +27,4 @@
>  // CHECK-USE: use.o:
>  // CHECK-USE-DAG:   Inputs/relative-dep-gen{{(-cwd)?}}.modulemap

Is this one OK?

>  // CHECK-USE-DAG:   relative-dep-gen.cpp
> -// CHECK-USE-DAG:   Inputs/relative-dep-gen-1.h
> +// CHECK-USE-DAG:   Inputs{{[/\\]}}relative-dep-gen-1.h
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


RE: [PATCH] D6551: Improvements to scan-build.

2015-08-09 Thread Honggyu Kim via cfe-commits
Hi Anton,

Since D10356 is committed first, your patch(D6551) has to be modified based on 
it.
So I just did some modification to resolve a conflict.

I was trying to upload the patch in phabricator, but I don't have a permission 
to update your patch.
I just attached the modified version so that you can easily upload it.

Thanks,
Honggyu


> -Original Message-
> From: Honggyu Kim [mailto:hong.gyu@lge.com]
> Sent: Saturday, August 08, 2015 11:38 PM
> To: anton.yart...@gmail.com; jordan_r...@apple.com; sylves...@debian.org
> Cc: hong.gyu@lge.com; cfe-commits@lists.llvm.org; kreme...@apple.com; 
> zaks.a...@gmail.com
> Subject: Re: [PATCH] D6551: Improvements to scan-build.
> 
> honggyu.kim added a comment.
> 
> Hi all,
> 
> I have also tested this patch by analyzing ARM version of Linux kernel with 
> my patch
> http://reviews.llvm.org/D10356.
> I successfully got the result after resolving a simple indentation conflict 
> by modifying my patch.
> If this patch is committed first then I will update 
> http://reviews.llvm.org/D10356 based on it.
> 
> Honggyu
> 
> 
> http://reviews.llvm.org/D6551
> 



D6551_v5.patch
Description: Binary data
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11828: [MSVC] Crash fix: assigning of overloaded member function pointer caused assertion

2015-08-09 Thread Alexey Bataev via cfe-commits
ABataev updated the summary for this revision.
ABataev updated this revision to Diff 31631.
ABataev added a comment.

Update after review


http://reviews.llvm.org/D11828

Files:
  lib/Sema/SemaCast.cpp
  test/CodeGenCXX/microsoft-abi-member-pointers.cpp

Index: lib/Sema/SemaCast.cpp
===
--- lib/Sema/SemaCast.cpp
+++ lib/Sema/SemaCast.cpp
@@ -1397,6 +1397,8 @@
 msg = diag::err_bad_static_cast_member_pointer_nonmp;
 return TC_NotApplicable;
   }
+  if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft())
+Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
 
   // T == T, modulo cv
   if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(),
Index: test/CodeGenCXX/microsoft-abi-member-pointers.cpp
===
--- test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -729,3 +729,20 @@
 // CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4
 DMemPtrTy get_memptr() { return &D::f; }
 }
+
+class C {};
+
+typedef void (C::*f)();
+
+class CA : public C {
+public:
+  void OnHelp(void);
+  int OnHelp(int);
+};
+
+// CHECK-LABEL: foo_fun
+void foo_fun() {
+  // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to 
i8*), i8**
+  f func = (f)&CA::OnHelp;
+}
+


Index: lib/Sema/SemaCast.cpp
===
--- lib/Sema/SemaCast.cpp
+++ lib/Sema/SemaCast.cpp
@@ -1397,6 +1397,8 @@
 msg = diag::err_bad_static_cast_member_pointer_nonmp;
 return TC_NotApplicable;
   }
+  if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft())
+Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
 
   // T == T, modulo cv
   if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(),
Index: test/CodeGenCXX/microsoft-abi-member-pointers.cpp
===
--- test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -729,3 +729,20 @@
 // CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4
 DMemPtrTy get_memptr() { return &D::f; }
 }
+
+class C {};
+
+typedef void (C::*f)();
+
+class CA : public C {
+public:
+  void OnHelp(void);
+  int OnHelp(int);
+};
+
+// CHECK-LABEL: foo_fun
+void foo_fun() {
+  // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to i8*), i8**
+  f func = (f)&CA::OnHelp;
+}
+
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11828: [MSVC] Crash fix: assigning of overloaded member function pointer caused assertion

2015-08-09 Thread David Majnemer via cfe-commits
majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D11828



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r244428 - [MSVC] Crash fix: assigning of overloaded member function pointer caused assertion

2015-08-09 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Sun Aug  9 23:07:49 2015
New Revision: 244428

URL: http://llvm.org/viewvc/llvm-project?rev=244428&view=rev
Log:
[MSVC] Crash fix: assigning of overloaded member function pointer caused 
assertion

Original class was not marked with inheritance attribute and it causes a crash 
on codegen.
Differential Revision: http://reviews.llvm.org/D11828

Modified:
cfe/trunk/lib/Sema/SemaCast.cpp
cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp

Modified: cfe/trunk/lib/Sema/SemaCast.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCast.cpp?rev=244428&r1=244427&r2=244428&view=diff
==
--- cfe/trunk/lib/Sema/SemaCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCast.cpp Sun Aug  9 23:07:49 2015
@@ -1397,6 +1397,8 @@ TryStaticMemberPointerUpcast(Sema &Self,
 msg = diag::err_bad_static_cast_member_pointer_nonmp;
 return TC_NotApplicable;
   }
+  if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft())
+Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
 
   // T == T, modulo cv
   if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(),

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp?rev=244428&r1=244427&r2=244428&view=diff
==
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp Sun Aug  9 
23:07:49 2015
@@ -729,3 +729,20 @@ typedef void (D::*DMemPtrTy)();
 // CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4
 DMemPtrTy get_memptr() { return &D::f; }
 }
+
+class C {};
+
+typedef void (C::*f)();
+
+class CA : public C {
+public:
+  void OnHelp(void);
+  int OnHelp(int);
+};
+
+// CHECK-LABEL: foo_fun
+void foo_fun() {
+  // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to 
i8*), i8**
+  f func = (f)&CA::OnHelp;
+}
+


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11828: [MSVC] Crash fix: assigning of overloaded member function pointer caused assertion

2015-08-09 Thread Alexey Bataev via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL244428: [MSVC] Crash fix: assigning of overloaded member 
function pointer caused… (authored by ABataev).

Changed prior to commit:
  http://reviews.llvm.org/D11828?vs=31631&id=31632#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11828

Files:
  cfe/trunk/lib/Sema/SemaCast.cpp
  cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp

Index: cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
===
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -729,3 +729,20 @@
 // CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4
 DMemPtrTy get_memptr() { return &D::f; }
 }
+
+class C {};
+
+typedef void (C::*f)();
+
+class CA : public C {
+public:
+  void OnHelp(void);
+  int OnHelp(int);
+};
+
+// CHECK-LABEL: foo_fun
+void foo_fun() {
+  // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to 
i8*), i8**
+  f func = (f)&CA::OnHelp;
+}
+
Index: cfe/trunk/lib/Sema/SemaCast.cpp
===
--- cfe/trunk/lib/Sema/SemaCast.cpp
+++ cfe/trunk/lib/Sema/SemaCast.cpp
@@ -1397,6 +1397,8 @@
 msg = diag::err_bad_static_cast_member_pointer_nonmp;
 return TC_NotApplicable;
   }
+  if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft())
+Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
 
   // T == T, modulo cv
   if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(),


Index: cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
===
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -729,3 +729,20 @@
 // CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4
 DMemPtrTy get_memptr() { return &D::f; }
 }
+
+class C {};
+
+typedef void (C::*f)();
+
+class CA : public C {
+public:
+  void OnHelp(void);
+  int OnHelp(int);
+};
+
+// CHECK-LABEL: foo_fun
+void foo_fun() {
+  // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to i8*), i8**
+  f func = (f)&CA::OnHelp;
+}
+
Index: cfe/trunk/lib/Sema/SemaCast.cpp
===
--- cfe/trunk/lib/Sema/SemaCast.cpp
+++ cfe/trunk/lib/Sema/SemaCast.cpp
@@ -1397,6 +1397,8 @@
 msg = diag::err_bad_static_cast_member_pointer_nonmp;
 return TC_NotApplicable;
   }
+  if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft())
+Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
 
   // T == T, modulo cv
   if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(),
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11738: Add new llvm.loop.unroll.enable metadata which is now generated by "#pragma unroll" directive

2015-08-09 Thread hfin...@anl.gov via cfe-commits
hfinkel accepted this revision.
hfinkel added a comment.
This revision is now accepted and ready to land.

LGTM, but obviously any necessary CodeGen changes must be done first (or at the 
same time).


http://reviews.llvm.org/D11738



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11797: [libclang] Expose the ElaboratedType

2015-08-09 Thread Brian Gesiak via cfe-commits
modocache accepted this revision.
modocache added a reviewer: modocache.
modocache added a comment.
This revision is now accepted and ready to land.

Looks good to me! I don't have commit access, though, so you'll probably have 
to find a committer to review/commit for you, @skalinichev.


http://reviews.llvm.org/D11797



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [Patch][LoopVectorize]Late evaluation of vectorization requirements

2015-08-09 Thread Hal Finkel via cfe-commits
Hi Tyler,

These LGTM, thanks!

 -Hal

- Original Message -
> From: "Tyler Nowicki" 
> To: "Hal J. Finkel" , "Gerolf Hoflehner" 
> 
> Cc: "Commit Messages and Patches for LLVM" , 
> "llvm cfe" 
> Sent: Thursday, August 6, 2015 3:12:29 PM
> Subject: Re: [Patch][LoopVectorize]Late evaluation of vectorization   
> requirements
> 
> 
> I’ve updated the patches a bit. I am going post another pair of
> patches to add another late diagnostic soon as well.
> 
> 
> Please review,
> 
> 
> Tyler
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On Aug 5, 2015, at 1:57 PM, Tyler Nowicki < tnowi...@apple.com >
> wrote:
> 
> 
> Hi,
> 
> 
> Could I get a review of these patches?
> 
> 
> Thanks,
> 
> 
> Tyler
> 
> 
> 
> 
> 
> 
> 
> On Jul 27, 2015, at 4:45 PM, Tyler Nowicki < tnowi...@apple.com >
> wrote:
> 
> Please ignore the debug line in the LLVM late-evaluation patch. It
> won’t be part of the commit.
> 
> 
> + DEBUG(dbgs() << "LV: Emitting analysis message.\n”);
> 
> 
> Tyler
> 
> 
> 
> 
> 
> On Jul 27, 2015, at 3:23 PM, Tyler Nowicki < tnowi...@apple.com >
> wrote:
> 
> 
> 
> Hi Hal,
> 
> 
> Thanks for the review! No worries about the delay.
> 
> 
> 
> 
> 
> 
> Could I get a review of these patches for cfe and llvm?
> 
> Hi Tyler,
> 
> I'm apologize for the delay. I think this generally looks good, but I
> don't understand the motivation for introducing the additional
> FrontendOptions member. Why not just make a subclass of
> DiagnosticInfoOptimizationRemarkAnalysis that the frontend can
> handle specially (and detect using the normal isa/dyn_cast
> mechanism?\
> 
> 
> 
> The diagnostic handling code doesn’t use isa or dyn_cast, rather it
> uses switches to select between different types. I modified the
> patch to use a subclass rather than a member variable. Let me know
> what patch you think would work out better?
> 
> 
> 
> 
> 
> 
> 
> 
> I should have also said in my previous email that I am not thrilled
> by the need to use O3 in the clang-side test.
> 
> So using -O2 or using -fvectorize does not help?
> 
> 
> 
> Using -O1 with -fvectorize seems to work, at least it is a smaller
> set of passes than O3.
> 
> 
> I attached the updated patches. I also noticed that
> DiagnosticInfoOptimizationBase::classof() was incorrectly
> implemented. It would need its own diagnostic kind, but that doesn’t
> make sense because you would never instantiate the base class. I
> thought it was best just to remove it. See the third patch.
> 
> 
> Tyler
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> cfe-commits mailing list
> cfe-comm...@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [Patch][LoopVectorize] Late evaluate of runtime pointer check's threshold

2015-08-09 Thread Hal Finkel via cfe-commits
Hi Tyler,

This looks very useful.

Please don't mention '-mllvm -runtime-memory-check-threshold=' in the error 
message. We should add some clause to #pragma clang loop to control this 
feature with some associated metadata. '-mllvm' things should not be part of 
the advertised interface to end users (but that should be a separate set of 
patches regardless).

Otherwise, LGTM.

Thanks again,
Hal

- Original Message -
> From: "Tyler Nowicki" 
> To: "Hal J. Finkel" , "Commit Messages and Patches for LLVM" 
> , "llvm
> cfe" 
> Cc: "Gerolf Hoflehner" 
> Sent: Thursday, August 6, 2015 3:25:26 PM
> Subject: [Patch][LoopVectorize] Late evaluate of runtime pointer check's 
> threshold
> 
> 
> Hi,
> 
> 
> This patch extends the patches in ' Late evaluation of vectorization
> requirements’ (still in review). This makes the num runtime pointer
> checks test into a late diagnostic so we can give the user a better
> diagnostic message. Clang appends the diagnostic with options for
> getting the loop vectorized. Here is an example of the diagnostic
> the user will see:
> 
> 
> "remark: loop not vectorized: cannot prove pointers refer to
> independent arrays in memory. The loop requires 9 runtime
> independence checks to safely vectorize the loop, but that would
> exceed the limit of 8 checks; increase the number of runtime pointer
> checks with the compiler option ‘-mllvm
> -runtime-memory-check-threshold=’. To avoid runtime pointer checking
> when you know the arrays will always be independent specify ‘#pragma
> clang loop vectorize(assume_safety)’ before the loop or specify
> ‘restrict’ on the array arguments. Erroneous results will occur if
> these options are incorrectly applied."
> 
> 
> The diagnostic is produced when the command line option
> -Rpass-analysis=loop-vectorize is provided.
> 
> 
> Reviews/comments are much appreciated!
> 
> 
> Tyler
> 
> 
> 
> 
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [Patch][LoopVectorize] Print vectorization analysis when loop hint pragma is specified

2015-08-09 Thread Hal Finkel via cfe-commits
Hi Tyler,

Thanks for working on this!

+// If a loop hint is provided the diagnostic is always produced.
+const char *name = Hints.isForced() ? DiagnosticInfo::AlwaysPrint : 
LV_NAME;

name -> Name

These LGTM.

P.S. I assume we should add similar logic to the loop unroller (please add a 
FIXME if you're not going to do this yourself). Another place where this would 
be useful is to warn the user when a function marked always_inline is not 
actually inlined.

 -Hal

- Original Message -
> From: "Tyler Nowicki" 
> To: "Gonzalo BG" , "Hal J. Finkel" , 
> "Commit Messages and Patches for LLVM"
> , "llvm cfe" 
> Cc: "Gerolf Hoflehner" 
> Sent: Friday, August 7, 2015 4:15:51 PM
> Subject: [Patch][LoopVectorize] Print vectorization analysis when loop hint 
> pragma is specified
> 
> 
> Hi,
> 
> 
> 
> 
> 
> Currently, when loop hint is used but vectorization fails we generate
> a warning. To get the analysis the user needs to provide the command
> line option -Rpass-analysis= with the correct pass name.
> BUT we don’t tell the user which pass name they will need to get the
> analysis message. We should be displaying the analysis without
> having to request it.
> 
> 
> These patches print the analysis information when vectorization fails
> on loops with hints when the compiler option ‘-Rpass-analysis’ is
> provided without ‘='. Users of loop hints can provide the
> compiler option with their regular debug builds to ensure they
> always get the analysis when vectorization fails. This approach is
> preferred because diagnostic printing needs line number tracking
> which is not enabled by normally. Specifying the option without a
> pass-target enables line number tracking and makes viewing the
> messages optional.
> 
> 
> The LLVM patches modify the pass-name of the diagnostic to
> DiagnosticInfo::AlwaysPrint, which is an empty const char*. The use
> of DiagnosticInfo::AlwaysPrint is recognized when filtering the
> diagnostics allowing the message to be printed even if the filter
> doesn’t match. Note that the analysis of loops with hints will
> always be printed whenever the compiler option is provided even if
> ‘=' is specified. This allows both types of analyses to
> be printed at the same time rather than hiding the analysis on loops
> with hints with an pass-target is given.
> 
> 
> *These patches build on several previous patches still in review to
> add late-diagnostics for fp-commut and aliasing. See threads ' Late
> evaluation of vectorization r equirements’ and ' Late evaluate of
> runtime pointer check's threshold' .
> 
> 
> Comments and reviews are much appreciated!
> 
> 
> Tyler
> 
> 
> (sorry if you received this twice. I used the wrong mailing list
> addresses)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r244427 - clang/test/Modules: Satisfy win32 hosts due to dospath issue.

2015-08-09 Thread Yaron Keren via cfe-commits
This issue is surfacing regulary. In cases where clang prints the escaped
path we have to use {{/} which is not very readable, for example in
mingw driver case:

// CHECK_MINGW_ORG_TREE:
"{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}lib{{/|}}gcc{{/|}}mingw32{{/|}}4.8.1{{/|}}include{{/|}}c++"

Could we allow FileCheck to always accept \  and \\ as matches for / or
would that too sloppy?


2015-08-10 5:56 GMT+03:00 Richard Smith via cfe-commits <
cfe-commits@lists.llvm.org>:

> On Aug 9, 2015 3:56 PM, "NAKAMURA Takumi via cfe-commits" <
> cfe-commits@lists.llvm.org> wrote:
> >
> > Author: chapuni
> > Date: Sun Aug  9 17:55:50 2015
> > New Revision: 244427
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=244427&view=rev
> > Log:
> > clang/test/Modules: Satisfy win32 hosts due to dospath issue.
>
> Thanks!
>
> > Modified:
> > cfe/trunk/test/Modules/dependency-gen.modulemap
> > cfe/trunk/test/Modules/explicit-build.cpp
> > cfe/trunk/test/Modules/relative-dep-gen.cpp
> >
> > Modified: cfe/trunk/test/Modules/dependency-gen.modulemap
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/dependency-gen.modulemap?rev=244427&r1=244426&r2=244427&view=diff
> >
> ==
> > --- cfe/trunk/test/Modules/dependency-gen.modulemap (original)
> > +++ cfe/trunk/test/Modules/dependency-gen.modulemap Sun Aug  9 17:55:50
> 2015
> > @@ -39,5 +39,5 @@ extern module "test-base" "Inputs/depend
> >  // EXPLICIT-FIXME: {{.*}}/base.pcm
> >  //
> >  // EXPLICIT: {{^}}explicit.pcm:
> > -// EXPLICIT: {{.*}}/dependency-gen.modulemap
> > +// EXPLICIT: {{.*[/\\]}}dependency-gen.modulemap
> >  // EXPLICIT: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h
> >
> > Modified: cfe/trunk/test/Modules/explicit-build.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/explicit-build.cpp?rev=244427&r1=244426&r2=244427&view=diff
> >
> ==
> > --- cfe/trunk/test/Modules/explicit-build.cpp (original)
> > +++ cfe/trunk/test/Modules/explicit-build.cpp Sun Aug  9 17:55:50 2015
> > @@ -138,7 +138,7 @@
> >  // RUN:
> -fmodule-map-file=%S/Inputs/explicit-build/module.modulemap \
> >  // RUN:%s 2>&1 | FileCheck --check-prefix=CHECK-MULTIPLE-AS
> %s
> >  //
> > -// CHECK-MULTIPLE-AS: error: module 'a' is defined in both
> '{{.*}}/a{{.*}}.pcm' and '{{.*[/\\]}}a{{.*}}.pcm'
> > +// CHECK-MULTIPLE-AS: error: module 'a' is defined in both
> '{{.*[/\\]}}a{{.*}}.pcm' and '{{.*[/\\]}}a{{.*}}.pcm'
> >
> >  // ---
> >  // Try to import a PCH with -fmodule-file=
> >
> > Modified: cfe/trunk/test/Modules/relative-dep-gen.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/relative-dep-gen.cpp?rev=244427&r1=244426&r2=244427&view=diff
> >
> ==
> > --- cfe/trunk/test/Modules/relative-dep-gen.cpp (original)
> > +++ cfe/trunk/test/Modules/relative-dep-gen.cpp Sun Aug  9 17:55:50 2015
> > @@ -27,4 +27,4 @@
> >  // CHECK-USE: use.o:
> >  // CHECK-USE-DAG:   Inputs/relative-dep-gen{{(-cwd)?}}.modulemap
>
> Is this one OK?
>
> >  // CHECK-USE-DAG:   relative-dep-gen.cpp
> > -// CHECK-USE-DAG:   Inputs/relative-dep-gen-1.h
> > +// CHECK-USE-DAG:   Inputs{{[/\\]}}relative-dep-gen-1.h
> >
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits