r284033 - [NFC] Trial change to remove a redundant blank line.

2016-10-12 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Wed Oct 12 14:33:33 2016
New Revision: 284033

URL: http://llvm.org/viewvc/llvm-project?rev=284033&view=rev
Log:
[NFC] Trial change to remove a redundant blank line.

Modified:
cfe/trunk/lib/Headers/xmmintrin.h

Modified: cfe/trunk/lib/Headers/xmmintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=284033&r1=284032&r2=284033&view=diff
==
--- cfe/trunk/lib/Headers/xmmintrin.h (original)
+++ cfe/trunk/lib/Headers/xmmintrin.h Wed Oct 12 14:33:33 2016
@@ -1727,7 +1727,6 @@ _mm_loadr_ps(const float *__p)
 /// This intrinsic has no corresponding instruction.
 ///
 /// \returns A 128-bit vector of [4 x float] containing undefined values.
-
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_undefined_ps(void)
 {


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


r284080 - [NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.

2016-10-12 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Wed Oct 12 18:27:27 2016
New Revision: 284080

URL: http://llvm.org/viewvc/llvm-project?rev=284080&view=rev
Log:
[NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.

It seems that the doxygen description of these two intrinsics were swapped by
mistake.


Modified:
cfe/trunk/lib/Headers/xmmintrin.h

Modified: cfe/trunk/lib/Headers/xmmintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=284080&r1=284079&r2=284080&view=diff
==
--- cfe/trunk/lib/Headers/xmmintrin.h (original)
+++ cfe/trunk/lib/Headers/xmmintrin.h Wed Oct 12 18:27:27 2016
@@ -1914,8 +1914,8 @@ _mm_store_ss(float *__p, __m128 __a)
   ((struct __mm_store_ss_struct*)__p)->__u = __a[0];
 }
 
-/// \brief Stores float values from a 128-bit vector of [4 x float] to an
-///unaligned memory location.
+/// \brief Stores a 128-bit vector of [4 x float] to an unaligned memory
+///location.
 ///
 /// \headerfile 
 ///
@@ -1935,19 +1935,18 @@ _mm_storeu_ps(float *__p, __m128 __a)
   ((struct __storeu_ps*)__p)->__v = __a;
 }
 
-/// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into
-///four contiguous elements in an aligned memory location.
+/// \brief Stores a 128-bit vector of [4 x float] into an aligned memory
+///location.
 ///
 /// \headerfile 
 ///
-/// This intrinsic corresponds to \c VMOVAPS / MOVAPS + \c shuffling
-///instruction.
+/// This intrinsic corresponds to the \c VMOVAPS / MOVAPS instruction.
 ///
 /// \param __p
-///A pointer to a 128-bit memory location.
+///A pointer to a 128-bit memory location. The address of the memory
+///location has to be 16-byte aligned.
 /// \param __a
-///A 128-bit vector of [4 x float] whose lower 32 bits are stored to each
-///of the four contiguous elements pointed by __p.
+///A 128-bit vector of [4 x float] containing the values to be stored.
 static __inline__ void __DEFAULT_FN_ATTRS
 _mm_store_ps(float *__p, __m128 __a)
 {
@@ -1974,18 +1973,19 @@ _mm_store1_ps(float *__p, __m128 __a)
   _mm_store_ps(__p, __a);
 }
 
-/// \brief Stores float values from a 128-bit vector of [4 x float] to an
-///aligned memory location.
+/// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into
+///four contiguous elements in an aligned memory location.
 ///
 /// \headerfile 
 ///
-/// This intrinsic corresponds to the \c VMOVAPS / MOVAPS instruction.
+/// This intrinsic corresponds to \c VMOVAPS / MOVAPS + \c shuffling
+///instruction.
 ///
 /// \param __p
-///A pointer to a 128-bit memory location. The address of the memory
-///location has to be 128-bit aligned.
+///A pointer to a 128-bit memory location.
 /// \param __a
-///A 128-bit vector of [4 x float] containing the values to be stored.
+///A 128-bit vector of [4 x float] whose lower 32 bits are stored to each
+///of the four contiguous elements pointed by __p.
 static __inline__ void __DEFAULT_FN_ATTRS
 _mm_store_ps1(float *__p, __m128 __a)
 {


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


Re: [PATCH] D23761: clang-format: [JS] supports casts to types starting with punctuation ("{[(").

2016-08-21 Thread Yunzhong Gao via cfe-commits
ygao added a subscriber: ygao.


Comment at: lib/Format/FormatTokenLexer.cpp:245
@@ -241,1 +244,3 @@
   ++Offset; // Skip the escaped character.
+if (Offset + 1 < Lex->getBuffer().end() && *Offset == '$' &&
+*(Offset + 1) == '{') {

What happens if the '${' is immediately after a backslash (the if statement 
above), should the '${' get escaped?


https://reviews.llvm.org/D23761



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


r280556 - (clang part) Implement MASM-flavor intel syntax behavior for inline MS asm block.

2016-09-02 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Fri Sep  2 18:16:06 2016
New Revision: 280556

URL: http://llvm.org/viewvc/llvm-project?rev=280556&view=rev
Log:
(clang part) Implement MASM-flavor intel syntax behavior for inline MS asm 
block.
Clang tests for verifying the following syntaxes:
1. 0xNN and NNh are accepted as valid hexadecimal numbers, but 0xNNh is not.
 
   0xNN and NNh may come with optional U or L suffix.   
 
2. NNb is accepted as a valid binary (base-2) number, but 0bNN is not.  
 
   NNb may come with optional U or L suffix.
 

 
Differential Revision: https://reviews.llvm.org/D22112


Modified:
cfe/trunk/test/CodeGen/ms-inline-asm.c
cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp
cfe/trunk/test/Parser/ms-inline-asm.c

Modified: cfe/trunk/test/CodeGen/ms-inline-asm.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=280556&r1=280555&r2=280556&view=diff
==
--- cfe/trunk/test/CodeGen/ms-inline-asm.c (original)
+++ cfe/trunk/test/CodeGen/ms-inline-asm.c Fri Sep  2 18:16:06 2016
@@ -47,7 +47,7 @@ void t6(void) {
 
 void t7() {
   __asm {
-int 0x2c ; } asm comments are fun! }{
+int 0x2cU ; } asm comments are fun! }{
   }
   __asm {
 {
@@ -56,7 +56,7 @@ void t7() {
   }
   __asm {}
 // CHECK: t7
-// CHECK: call void asm sideeffect inteldialect "int $$0x2c", 
"~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "int $$0x2cU", 
"~{dirflag},~{fpsr},~{flags}"()
 // CHECK: call void asm sideeffect inteldialect "", 
"~{dirflag},~{fpsr},~{flags}"()
 }
 
@@ -171,8 +171,8 @@ void t17() {
 // CHECK: t17
   __asm _emit 0x4A
 // CHECK: .byte 0x4A
-  __asm _emit 0x43
-// CHECK: .byte 0x43
+  __asm _emit 0x43L
+// CHECK: .byte 0x43L
   __asm _emit 0x4B
 // CHECK: .byte 0x4B
   __asm _EMIT 0x4B
@@ -219,11 +219,11 @@ void t20() {
 void t21() {
   __asm {
 __asm push ebx
-__asm mov ebx, 0x07
+__asm mov ebx, 07H
 __asm pop ebx
   }
 // CHECK: t21
-// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, 
$$0x07\0A\09pop ebx", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, 
$$07H\0A\09pop ebx", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
 }
 
 extern void t22_helper(int x);
@@ -262,15 +262,15 @@ void t24() {
 void t25() {
 // CHECK: t25
   __asm mov eax, 0h
-// CHECK: mov eax, $$4294967295
-  __asm mov eax, 0fh
+// CHECK: mov eax, $$0h
+  __asm mov eax, 0fhU
 // CHECK: mov eax, $$15
   __asm mov eax, 0a2h
+// CHECK: mov eax, $$0a2h
+  __asm mov eax, 10100010b
+// CHECK: mov eax, $$10100010b
+  __asm mov eax, 10100010BU
 // CHECK: mov eax, $$162
-  __asm mov eax, 0xa2h
-// CHECK: mov eax, $$0xa2h
-  __asm mov eax, 0xa2
-// CHECK: mov eax, $$0xa2
 // CHECK: "~{eax},~{dirflag},~{fpsr},~{flags}"()
 }
 

Modified: cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp?rev=280556&r1=280555&r2=280556&view=diff
==
--- cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp Fri Sep  2 18:16:06 2016
@@ -50,8 +50,8 @@ char f_i8() {
 
 bool f_i1() {
   __asm {
-mov eax, 1
-mov edx, 1
+mov eax, 1L
+mov edx, 1U
   }
 }
 // CHECK-LABEL: define zeroext i1 @f_i1()
@@ -80,12 +80,12 @@ struct EightChars {
 };
 EightChars f_s8() {
   __asm {
-mov eax, 0x01010101
-mov edx, 0x01010101
+mov eax, 01010101h
+mov edx, 01010101b
   }
 }
 // CHECK-LABEL: define i64 @f_s8()
-// CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, 
$$0x01010101\0A\09mov edx, $$0x01010101", "=A,~{eax},{{.*}}"
+// CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, 
$$01010101h\0A\09mov edx, $$01010101b", "=A,~{eax},{{.*}}"
 // CHECK: store i64 %[[r]], i64* %{{.*}}
 // CHECK: %[[r_i64:[^ ]*]] = load i64, i64* %{{.*}}
 // CHECK: ret i64 %[[r_i64]]

Modified: cfe/trunk/test/Parser/ms-inline-asm.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/ms-inline-asm.c?rev=280556&r1=280555&r2=280556&view=diff
==
--- cfe/trunk/test/Parser/ms-inline-asm.c (original)
+++ cfe/trunk/test/Parser/ms-inline-asm.c Fri Sep  2 18:16:06 2016
@@ -7,9 +7,9 @@
 #define M2 int
 
 void t1(void) { M }
-void t2(void) { __asm int 0x2c }
-void t3(void) { __asm M2 0x2c }
-void t4(void) { __asm mov eax, fs:[0x10] }
+void t2(void) { __asm int 2ch }
+void t3(void) { __asm M2 2ch }
+void t4(void) { __asm mov eax, fs:[10h] }
 void t5() {
   __asm {
 int 0x2c ; } asm comments are fun! }{
@@ -26,7 +26,7 @@ int t6() {

r275877 - Support -masm= flag for x86 assembly targets.

2016-07-18 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Mon Jul 18 13:44:51 2016
New Revision: 275877

URL: http://llvm.org/viewvc/llvm-project?rev=275877&view=rev
Log:
Support -masm= flag for x86 assembly targets.

For assembly files without .intel_syntax or .att_syntax directives, allow the
-masm= flag to supply a default assembly dialect. For example,

C:\TMP> type intel.s
.text
mov al,0

C:\TMP> clang -masm=intel -c intel.s

Without this patch, one would need to pass an "-mllvm -x86-asm-syntax=" flag
directly to the backend.
C:\TMP> clang -mllvm --x86-asm-syntax=intel -c intel.s

Differentials Review: http://reviews.llvm.org/D22285


Added:
cfe/trunk/test/Driver/masm.s
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Driver/Tools.h

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=275877&r1=275876&r2=275877&view=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jul 18 13:44:51 2016
@@ -6460,6 +6460,20 @@ void ClangAs::AddMIPSTargetArgs(const Ar
   CmdArgs.push_back(ABIName.data());
 }
 
+void ClangAs::AddX86TargetArgs(const ArgList &Args,
+   ArgStringList &CmdArgs) const {
+  if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) {
+StringRef Value = A->getValue();
+if (Value == "intel" || Value == "att") {
+  CmdArgs.push_back("-mllvm");
+  CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value));
+} else {
+  
getToolChain().getDriver().Diag(diag::err_drv_unsupported_option_argument)
+  << A->getOption().getName() << Value;
+}
+  }
+}
+
 void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList 
&Inputs,
const ArgList &Args,
@@ -6607,6 +6621,11 @@ void ClangAs::ConstructJob(Compilation &
   case llvm::Triple::mips64el:
 AddMIPSTargetArgs(Args, CmdArgs);
 break;
+
+  case llvm::Triple::x86:
+  case llvm::Triple::x86_64:
+AddX86TargetArgs(Args, CmdArgs);
+break;
   }
 
   // Consume all the warning flags. Usually this would be handled more

Modified: cfe/trunk/lib/Driver/Tools.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=275877&r1=275876&r2=275877&view=diff
==
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Mon Jul 18 13:44:51 2016
@@ -125,6 +125,8 @@ public:
   : Tool("clang::as", "clang integrated assembler", TC, RF_Full) {}
   void AddMIPSTargetArgs(const llvm::opt::ArgList &Args,
  llvm::opt::ArgStringList &CmdArgs) const;
+  void AddX86TargetArgs(const llvm::opt::ArgList &Args,
+llvm::opt::ArgStringList &CmdArgs) const;
   bool hasGoodDiagnostics() const override { return true; }
   bool hasIntegratedAssembler() const override { return false; }
   bool hasIntegratedCPP() const override { return false; }

Added: cfe/trunk/test/Driver/masm.s
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/masm.s?rev=275877&view=auto
==
--- cfe/trunk/test/Driver/masm.s (added)
+++ cfe/trunk/test/Driver/masm.s Mon Jul 18 13:44:51 2016
@@ -0,0 +1,11 @@
+// RUN: %clang -target i386-unknown-linux -masm=intel -c %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-INTEL %s
+// RUN: %clang -target i386-unknown-linux -masm=att -c %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-ATT %s
+// RUN: %clang -target i386-unknown-linux -c -masm=somerequired %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
+// RUN: %clang -target arm-unknown-eabi -c -masm=intel %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-ARM %s
+
+// CHECK-INTEL: -x86-asm-syntax=intel
+// CHECK-ATT: -x86-asm-syntax=att
+// CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 
'masm='
+// CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
+.text
+moval, 0


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


Re: [PATCH] D22285: Support -masm= flag for x86 assembly targets

2016-07-18 Thread Yunzhong Gao via cfe-commits
ygao marked an inline comment as done.


Comment at: lib/Driver/Tools.cpp:6379
@@ +6378,3 @@
+void ClangAs::AddX86TargetArgs(const ArgList &Args,
+ArgStringList &CmdArgs) const {
+  if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) {

bruno wrote:
> Fix the param indentation.
Good catch! Thanks.


https://reviews.llvm.org/D22285



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


Re: [PATCH] D22285: Support -masm= flag for x86 assembly targets

2016-07-18 Thread Yunzhong Gao via cfe-commits
ygao closed this revision.
ygao marked an inline comment as done.
ygao added a comment.

Closed by https://reviews.llvm.org/rL275877.


https://reviews.llvm.org/D22285



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


[PATCH] D22717: Improve documentation of the type safety attributes

2016-07-22 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added reviewers: gribozavr, aaron.ballman.
ygao added a subscriber: cfe-commits.

Hi,
I was preparing our internal release documentation with our tech writers, and
when reviewing the clang manual for the current release, we think the current
documentation of type safety attributes are inadequate in a few aspects:

1. The arguments to these attributes are not described.
2. Some of the MPI code examples seem incomplete as they miss declarations.
3. Some references could be made more clear. For example, for the
   "type_tag_for_datatype" attribute, it is mentioned that its optional
   third argument determines "how the expression is compared to the type
   tag", but it is left unspecified what the "expression" is referring to.

We would like to share the edits we have made, both in hope that the edits are
useful to a wider audience, and also to gather some feedback that the new
documentation is still accurate.

Could you review?

- Gao

https://reviews.llvm.org/D22717

Files:
  include/clang/Basic/AttrDocs.td

Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -1338,7 +1338,8 @@
 def DocCatTypeSafety : DocumentationCategory<"Type Safety Checking"> {
   let Content = [{
 Clang supports additional attributes to enable checking type safety properties
-that can't be enforced by the C type system.  Use cases include:
+that can't be enforced by the C type system. To see warnings produced by these
+checks, ensure that -Wtype-safety is enabled. Use cases include:
 
 * MPI library implementations, where these attributes enable checking that
   the buffer type matches the passed ``MPI_Datatype``;
@@ -1376,12 +1377,23 @@
 Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx,
 type_tag_idx)))`` on a function declaration to specify that the function
 accepts a type tag that determines the type of some other argument.
-``arg_kind`` is an identifier that should be used when annotating all
-applicable type tags.
 
 This attribute is primarily useful for checking arguments of variadic functions
 (``pointer_with_type_tag`` can be used in most non-variadic cases).
 
+In the attribute prototype above:
+* ``arg_kind`` is an identifier that should be used when annotating all
+  applicable type tags.
+* ``arg_idx`` provides the position of a function argument. The expected type of
+  this function argument will be determined by the function argument specified
+  by ``type_tag_idx``. In the code example below, "3" means that the type of the
+  function's third argument will be determined by ``type_tag_idx``.
+* ``type_tag_idx`` provides the position of a function argument. This function
+  argument will be a type tag. The type tag will determine the expected type of
+  the argument specified by ``arg_idx``. In the code example below, "2" means
+  that the type tag associated with the function's second argument should agree
+  with the type of the argument specified by ``arg_idx``.
+
 For example:
 
 .. code-block:: c++
@@ -1388,6 +1400,8 @@
 
   int fcntl(int fd, int cmd, ...)
   __attribute__(( argument_with_type_tag(fcntl,3,2) ));
+  // The function's second argument will be a type tag; this type tag will
+  // determine the expected type of the function's third argument.
   }];
 }
 
@@ -1399,12 +1413,30 @@
 on a function declaration to specify that the function accepts a type tag that
 determines the pointee type of some other pointer argument.
 
+In the attribute prototype above:
+* ``ptr_kind`` is an identifier that should be used when annotating all
+  applicable type tags.
+* ``ptr_idx`` provides the position of a function argument; this function
+  argument will have a pointer type. The expected pointee type of this pointer
+  type will be determined by the function argument specified by
+  ``type_tag_idx``. In the code example below, "1" means that the pointee type
+  of the function's first argument will be determined by ``type_tag_idx``.
+* ``type_tag_idx`` provides the position of a function argument; this function
+  argument will be a type tag. The type tag will determine the expected pointee
+  type of the pointer argument specified by ``ptr_idx``. In the code example
+  below, "3" means that the type tag associated with the function's third
+  argument should agree with the pointee type of the pointer argument specified
+  by ``ptr_idx``.
+
 For example:
 
 .. code-block:: c++
 
+  typedef int MPI_Datatype;
   int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
   __attribute__(( pointer_with_type_tag(mpi,1,3) ));
+  // The function's 3rd argument will be a type tag; this type tag will
+  // determine the expected pointee type of the function's 1st argument.
   }];
 }
 
@@ -1411,70 +1443,107 @@
 def TypeTagForDatatypeDocs : Documentation {
   let Category = DocCatTypeSafety;
   let Content = [{
+When declari

r277192 - Improve documentation of the type safety attributes.

2016-07-29 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Fri Jul 29 13:34:21 2016
New Revision: 277192

URL: http://llvm.org/viewvc/llvm-project?rev=277192&view=rev
Log:
Improve documentation of the type safety attributes.
1. Add description of the arguments to these attributes.
2. Add missing declarations to some of the MPI code examples.
3. Made clarifications where possible.

Based on the write-up by: Craig Flores.

Differential Revision: https://reviews.llvm.org/D22717


Modified:
cfe/trunk/include/clang/Basic/AttrDocs.td

Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=277192&r1=277191&r2=277192&view=diff
==
--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
+++ cfe/trunk/include/clang/Basic/AttrDocs.td Fri Jul 29 13:34:21 2016
@@ -1338,7 +1338,8 @@ to avoid false positives in other places
 def DocCatTypeSafety : DocumentationCategory<"Type Safety Checking"> {
   let Content = [{
 Clang supports additional attributes to enable checking type safety properties
-that can't be enforced by the C type system.  Use cases include:
+that can't be enforced by the C type system. To see warnings produced by these
+checks, ensure that -Wtype-safety is enabled. Use cases include:
 
 * MPI library implementations, where these attributes enable checking that
   the buffer type matches the passed ``MPI_Datatype``;
@@ -1376,18 +1377,31 @@ def ArgumentWithTypeTagDocs : Documentat
 Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx,
 type_tag_idx)))`` on a function declaration to specify that the function
 accepts a type tag that determines the type of some other argument.
-``arg_kind`` is an identifier that should be used when annotating all
-applicable type tags.
 
 This attribute is primarily useful for checking arguments of variadic functions
 (``pointer_with_type_tag`` can be used in most non-variadic cases).
 
+In the attribute prototype above:
+* ``arg_kind`` is an identifier that should be used when annotating all
+  applicable type tags.
+* ``arg_idx`` provides the position of a function argument. The expected type 
of
+  this function argument will be determined by the function argument specified
+  by ``type_tag_idx``. In the code example below, "3" means that the type of 
the
+  function's third argument will be determined by ``type_tag_idx``.
+* ``type_tag_idx`` provides the position of a function argument. This function
+  argument will be a type tag. The type tag will determine the expected type of
+  the argument specified by ``arg_idx``. In the code example below, "2" means
+  that the type tag associated with the function's second argument should agree
+  with the type of the argument specified by ``arg_idx``.
+
 For example:
 
 .. code-block:: c++
 
   int fcntl(int fd, int cmd, ...)
   __attribute__(( argument_with_type_tag(fcntl,3,2) ));
+  // The function's second argument will be a type tag; this type tag will
+  // determine the expected type of the function's third argument.
   }];
 }
 
@@ -1399,82 +1413,137 @@ Use ``__attribute__((pointer_with_type_t
 on a function declaration to specify that the function accepts a type tag that
 determines the pointee type of some other pointer argument.
 
+In the attribute prototype above:
+* ``ptr_kind`` is an identifier that should be used when annotating all
+  applicable type tags.
+* ``ptr_idx`` provides the position of a function argument; this function
+  argument will have a pointer type. The expected pointee type of this pointer
+  type will be determined by the function argument specified by
+  ``type_tag_idx``. In the code example below, "1" means that the pointee type
+  of the function's first argument will be determined by ``type_tag_idx``.
+* ``type_tag_idx`` provides the position of a function argument; this function
+  argument will be a type tag. The type tag will determine the expected pointee
+  type of the pointer argument specified by ``ptr_idx``. In the code example
+  below, "3" means that the type tag associated with the function's third
+  argument should agree with the pointee type of the pointer argument specified
+  by ``ptr_idx``.
+
 For example:
 
 .. code-block:: c++
 
+  typedef int MPI_Datatype;
   int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args 
omitted */)
   __attribute__(( pointer_with_type_tag(mpi,1,3) ));
+  // The function's 3rd argument will be a type tag; this type tag will
+  // determine the expected pointee type of the function's 1st argument.
   }];
 }
 
 def TypeTagForDatatypeDocs : Documentation {
   let Category = DocCatTypeSafety;
   let Content = [{
+When declaring a variable, use
+``__attribute__((type_tag_for_datatype(kind, type)))`` to create a type tag 
that
+is tied to the ``type`` argument given to the attribute.
+
+In the attribute prototype above:
+* ``kind`` is an identifier that should be used when annotating all applic

Re: [PATCH] D22717: Improve documentation of the type safety attributes

2016-07-29 Thread Yunzhong Gao via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL277192: Improve documentation of the type safety attributes. 
(authored by ygao).

Changed prior to commit:
  https://reviews.llvm.org/D22717?vs=65206&id=66155#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22717

Files:
  cfe/trunk/include/clang/Basic/AttrDocs.td

Index: cfe/trunk/include/clang/Basic/AttrDocs.td
===
--- cfe/trunk/include/clang/Basic/AttrDocs.td
+++ cfe/trunk/include/clang/Basic/AttrDocs.td
@@ -1338,7 +1338,8 @@
 def DocCatTypeSafety : DocumentationCategory<"Type Safety Checking"> {
   let Content = [{
 Clang supports additional attributes to enable checking type safety properties
-that can't be enforced by the C type system.  Use cases include:
+that can't be enforced by the C type system. To see warnings produced by these
+checks, ensure that -Wtype-safety is enabled. Use cases include:
 
 * MPI library implementations, where these attributes enable checking that
   the buffer type matches the passed ``MPI_Datatype``;
@@ -1376,18 +1377,31 @@
 Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx,
 type_tag_idx)))`` on a function declaration to specify that the function
 accepts a type tag that determines the type of some other argument.
-``arg_kind`` is an identifier that should be used when annotating all
-applicable type tags.
 
 This attribute is primarily useful for checking arguments of variadic functions
 (``pointer_with_type_tag`` can be used in most non-variadic cases).
 
+In the attribute prototype above:
+* ``arg_kind`` is an identifier that should be used when annotating all
+  applicable type tags.
+* ``arg_idx`` provides the position of a function argument. The expected type of
+  this function argument will be determined by the function argument specified
+  by ``type_tag_idx``. In the code example below, "3" means that the type of the
+  function's third argument will be determined by ``type_tag_idx``.
+* ``type_tag_idx`` provides the position of a function argument. This function
+  argument will be a type tag. The type tag will determine the expected type of
+  the argument specified by ``arg_idx``. In the code example below, "2" means
+  that the type tag associated with the function's second argument should agree
+  with the type of the argument specified by ``arg_idx``.
+
 For example:
 
 .. code-block:: c++
 
   int fcntl(int fd, int cmd, ...)
   __attribute__(( argument_with_type_tag(fcntl,3,2) ));
+  // The function's second argument will be a type tag; this type tag will
+  // determine the expected type of the function's third argument.
   }];
 }
 
@@ -1399,82 +1413,137 @@
 on a function declaration to specify that the function accepts a type tag that
 determines the pointee type of some other pointer argument.
 
+In the attribute prototype above:
+* ``ptr_kind`` is an identifier that should be used when annotating all
+  applicable type tags.
+* ``ptr_idx`` provides the position of a function argument; this function
+  argument will have a pointer type. The expected pointee type of this pointer
+  type will be determined by the function argument specified by
+  ``type_tag_idx``. In the code example below, "1" means that the pointee type
+  of the function's first argument will be determined by ``type_tag_idx``.
+* ``type_tag_idx`` provides the position of a function argument; this function
+  argument will be a type tag. The type tag will determine the expected pointee
+  type of the pointer argument specified by ``ptr_idx``. In the code example
+  below, "3" means that the type tag associated with the function's third
+  argument should agree with the pointee type of the pointer argument specified
+  by ``ptr_idx``.
+
 For example:
 
 .. code-block:: c++
 
+  typedef int MPI_Datatype;
   int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
   __attribute__(( pointer_with_type_tag(mpi,1,3) ));
+  // The function's 3rd argument will be a type tag; this type tag will
+  // determine the expected pointee type of the function's 1st argument.
   }];
 }
 
 def TypeTagForDatatypeDocs : Documentation {
   let Category = DocCatTypeSafety;
   let Content = [{
+When declaring a variable, use
+``__attribute__((type_tag_for_datatype(kind, type)))`` to create a type tag that
+is tied to the ``type`` argument given to the attribute.
+
+In the attribute prototype above:
+* ``kind`` is an identifier that should be used when annotating all applicable
+  type tags.
+* ``type`` indicates the name of the type.
+
 Clang supports annotating type tags of two forms.
 
-* **Type tag that is an expression containing a reference to some declared
-  identifier.** Use ``__attribute__((type_tag_for_datatype(kind, type)))`` on a
-  declaration with that identifier:
+* **Type tag that is a reference to a declared identifier.**
+  Use ``__attribute__((type_tag_for_datatype(kind, type)))``

r264801 - Fixing PR26558: remove the adx target attribute requirement from adc builtins.

2016-03-29 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Tue Mar 29 17:59:20 2016
New Revision: 264801

URL: http://llvm.org/viewvc/llvm-project?rev=264801&view=rev
Log:
Fixing PR26558: remove the adx target attribute requirement from adc builtins.

The addcarry and subborrow variants of the builtins do not require the adx
target attribute; only the addcarryx variants require them.

Differential Revision: http://reviews.llvm.org/D18533


Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/test/CodeGen/adc-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=264801&r1=264800&r2=264801&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Tue Mar 29 17:59:20 2016
@@ -690,10 +690,10 @@ TARGET_BUILTIN(__builtin_ia32_xsaves64,
 // ADX
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
 
 // RDSEED
 TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")

Modified: cfe/trunk/test/CodeGen/adc-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/adc-builtins.c?rev=264801&r1=264800&r2=264801&view=diff
==
--- cfe/trunk/test/CodeGen/adc-builtins.c (original)
+++ cfe/trunk/test/CodeGen/adc-builtins.c Tue Mar 29 17:59:20 2016
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx 
-emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | 
FileCheck %s
 
 #define __MM_MALLOC_H
 


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


Re: [PATCH] D18533: Fixing PR26558: the adc builtins do not require the adx target attribute

2016-03-29 Thread Yunzhong Gao via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264801: Fixing PR26558: remove the adx target attribute 
requirement from adc builtins. (authored by ygao).

Changed prior to commit:
  http://reviews.llvm.org/D18533?vs=51857&id=52000#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18533

Files:
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/test/CodeGen/adc-builtins.c

Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -690,10 +690,10 @@
 // ADX
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
 
 // RDSEED
 TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")
Index: cfe/trunk/test/CodeGen/adc-builtins.c
===
--- cfe/trunk/test/CodeGen/adc-builtins.c
+++ cfe/trunk/test/CodeGen/adc-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx 
-emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | 
FileCheck %s
 
 #define __MM_MALLOC_H
 


Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -690,10 +690,10 @@
 // ADX
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
 
 // RDSEED
 TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")
Index: cfe/trunk/test/CodeGen/adc-builtins.c
===
--- cfe/trunk/test/CodeGen/adc-builtins.c
+++ cfe/trunk/test/CodeGen/adc-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
 
 #define __MM_MALLOC_H
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18533: Fixing PR26558: the adc builtins do not require the adx target attribute

2016-03-29 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

> Yep, only the ADCX instruction needs adx. This LGTM, but please just

>  remove "-target-feature +adx" from the run line instead of adding a

>  second run line.


Thanks, Justin.
Committed r264801 and updated the test as you suggested.


Repository:
  rL LLVM

http://reviews.llvm.org/D18533



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


[PATCH] D18709: Add copyright notice to modulemap files

2016-04-01 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added subscribers: cfe-commits, rsmith.

Hi,
It seems that the module.modulemap file in the lib/Headers directory is missing 
the LLVM copyright notice.
This patch adds the copyright notice just like the rest of the files in this 
directory.
Could you review that is acceptable?

Thanks,
- Gao

http://reviews.llvm.org/D18709

Files:
  lib/Headers/module.modulemap

Index: lib/Headers/module.modulemap
===
--- lib/Headers/module.modulemap
+++ lib/Headers/module.modulemap
@@ -1,3 +1,26 @@
+/*=== module.modulemap - intrinsics module map -===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===---===
+ */
+
 module _Builtin_intrinsics [system] [extern_c] {
   explicit module altivec {
 requires altivec


Index: lib/Headers/module.modulemap
===
--- lib/Headers/module.modulemap
+++ lib/Headers/module.modulemap
@@ -1,3 +1,26 @@
+/*=== module.modulemap - intrinsics module map -===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===---===
+ */
+
 module _Builtin_intrinsics [system] [extern_c] {
   explicit module altivec {
 requires altivec
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18708: Set C99 as default C Standard for PS4 target

2016-04-01 Thread Yunzhong Gao via cfe-commits
ygao added a subscriber: ygao.


Comment at: test/Driver/ps4-misc-defaults.cpp:10
@@ +9,2 @@
+// RUN: %clang -target x86_64-scei-ps4 -E -x c -dM %s | FileCheck 
-check-prefix=CHECK-CSTD %s
+// CHECK-CSTD: __STDC_VERSION__ 199901L

It seems to me that this part of the test, exercising "-E", should be placed 
under test/Preprocessor, instead of test/Driver.


http://reviews.llvm.org/D18708



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


Re: [PATCH] D18709: Add copyright notice to modulemap files

2016-04-04 Thread Yunzhong Gao via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL265325: Add copyright notice to the modulemap file. 
(authored by ygao).

Changed prior to commit:
  http://reviews.llvm.org/D18709?vs=52414&id=52590#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18709

Files:
  cfe/trunk/lib/Headers/module.modulemap

Index: cfe/trunk/lib/Headers/module.modulemap
===
--- cfe/trunk/lib/Headers/module.modulemap
+++ cfe/trunk/lib/Headers/module.modulemap
@@ -1,3 +1,26 @@
+/*=== module.modulemap - intrinsics module map -===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===---===
+ */
+
 module _Builtin_intrinsics [system] [extern_c] {
   explicit module altivec {
 requires altivec


Index: cfe/trunk/lib/Headers/module.modulemap
===
--- cfe/trunk/lib/Headers/module.modulemap
+++ cfe/trunk/lib/Headers/module.modulemap
@@ -1,3 +1,26 @@
+/*=== module.modulemap - intrinsics module map -===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===---===
+ */
+
 module _Builtin_intrinsics [system] [extern_c] {
   explicit module altivec {
 requires altivec
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r265325 - Add copyright notice to the modulemap file.

2016-04-04 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Mon Apr  4 13:46:09 2016
New Revision: 265325

URL: http://llvm.org/viewvc/llvm-project?rev=265325&view=rev
Log:
Add copyright notice to the modulemap file.

The module.modulemap file in the lib/Headers directory was missing the LLVM
copyright notice. This patch adds the copyright notice just like the rest of
the files in this directory.

Differential Revision: http://reviews.llvm.org/D18709


Modified:
cfe/trunk/lib/Headers/module.modulemap

Modified: cfe/trunk/lib/Headers/module.modulemap
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.modulemap?rev=265325&r1=265324&r2=265325&view=diff
==
--- cfe/trunk/lib/Headers/module.modulemap (original)
+++ cfe/trunk/lib/Headers/module.modulemap Mon Apr  4 13:46:09 2016
@@ -1,3 +1,26 @@
+/*=== module.modulemap - intrinsics module map -===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===---===
+ */
+
 module _Builtin_intrinsics [system] [extern_c] {
   explicit module altivec {
 requires altivec


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


Re: [PATCH] D18708: Set C99 as default C Standard for PS4 target

2016-04-04 Thread Yunzhong Gao via cfe-commits
ygao accepted this revision.
ygao added a reviewer: ygao.
ygao added a comment.

The test LGTM. Thanks!


http://reviews.llvm.org/D18708



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


[PATCH] D22285: Support -masm= flag for x86 assembly targets

2016-07-12 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added subscribers: thakis, cfe-commits.

For assembly files without .intel_syntax or .att_syntax directives, allow the
-masm= flag to supply a default assembly dialect. For example,

C:\TMP> type intel.s
.text
mov al,0

C:\TMP> clang -masm=intel -c intel.s

Without this patch, one would need to pass an -mllvm -x86-asm-syntax= flag 
directly to the backend.
C:\TMP> clang -mllvm --x86-asm-syntax=intel -c intel.s

Does it seem acceptable to expose -masm= flag as a way to configure the input 
assembly syntax?


http://reviews.llvm.org/D22285

Files:
  lib/Driver/Tools.cpp
  lib/Driver/Tools.h
  test/Driver/masm.s

Index: test/Driver/masm.s
===
--- test/Driver/masm.s
+++ test/Driver/masm.s
@@ -0,0 +1,11 @@
+// RUN: %clang -target i386-unknown-linux -masm=intel -c %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-INTEL %s
+// RUN: %clang -target i386-unknown-linux -masm=att -c %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-ATT %s
+// RUN: %clang -target i386-unknown-linux -c -masm=somerequired %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
+// RUN: %clang -target arm-unknown-eabi -c -masm=intel %s -### 2>&1 | 
FileCheck --check-prefix=CHECK-ARM %s
+
+// CHECK-INTEL: -x86-asm-syntax=intel
+// CHECK-ATT: -x86-asm-syntax=att
+// CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 
'masm='
+// CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
+.text
+moval, 0
Index: lib/Driver/Tools.h
===
--- lib/Driver/Tools.h
+++ lib/Driver/Tools.h
@@ -126,6 +126,8 @@
   : Tool("clang::as", "clang integrated assembler", TC, RF_Full) {}
   void AddMIPSTargetArgs(const llvm::opt::ArgList &Args,
  llvm::opt::ArgStringList &CmdArgs) const;
+  void AddX86TargetArgs(const llvm::opt::ArgList &Args,
+llvm::opt::ArgStringList &CmdArgs) const;
   bool hasGoodDiagnostics() const override { return true; }
   bool hasIntegratedAssembler() const override { return false; }
   bool hasIntegratedCPP() const override { return false; }
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -6375,6 +6375,20 @@
   CmdArgs.push_back(ABIName.data());
 }
 
+void ClangAs::AddX86TargetArgs(const ArgList &Args,
+ArgStringList &CmdArgs) const {
+  if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) {
+StringRef Value = A->getValue();
+if (Value == "intel" || Value == "att") {
+  CmdArgs.push_back("-mllvm");
+  CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value));
+} else {
+  
getToolChain().getDriver().Diag(diag::err_drv_unsupported_option_argument)
+  << A->getOption().getName() << Value;
+}
+  }
+}
+
 void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList 
&Inputs,
const ArgList &Args,
@@ -6522,6 +6536,11 @@
   case llvm::Triple::mips64el:
 AddMIPSTargetArgs(Args, CmdArgs);
 break;
+
+  case llvm::Triple::x86:
+  case llvm::Triple::x86_64:
+AddX86TargetArgs(Args, CmdArgs);
+break;
   }
 
   // Consume all the warning flags. Usually this would be handled more


Index: test/Driver/masm.s
===
--- test/Driver/masm.s
+++ test/Driver/masm.s
@@ -0,0 +1,11 @@
+// RUN: %clang -target i386-unknown-linux -masm=intel -c %s -### 2>&1 | FileCheck --check-prefix=CHECK-INTEL %s
+// RUN: %clang -target i386-unknown-linux -masm=att -c %s -### 2>&1 | FileCheck --check-prefix=CHECK-ATT %s
+// RUN: %clang -target i386-unknown-linux -c -masm=somerequired %s -### 2>&1 | FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
+// RUN: %clang -target arm-unknown-eabi -c -masm=intel %s -### 2>&1 | FileCheck --check-prefix=CHECK-ARM %s
+
+// CHECK-INTEL: -x86-asm-syntax=intel
+// CHECK-ATT: -x86-asm-syntax=att
+// CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 'masm='
+// CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
+.text
+moval, 0
Index: lib/Driver/Tools.h
===
--- lib/Driver/Tools.h
+++ lib/Driver/Tools.h
@@ -126,6 +126,8 @@
   : Tool("clang::as", "clang integrated assembler", TC, RF_Full) {}
   void AddMIPSTargetArgs(const llvm::opt::ArgList &Args,
  llvm::opt::ArgStringList &CmdArgs) const;
+  void AddX86TargetArgs(const llvm::opt::ArgList &Args,
+llvm::opt::ArgStringList &CmdArgs) const;
   bool hasGoodDiagnostics() const override { return true; }
   bool hasIntegratedAssembler() const override { return false; }
   bool hasIntegratedCPP() const override { return false; }
Index: lib/Driver/T

Re: [PATCH] D17682: [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

2016-03-01 Thread Yunzhong Gao via cfe-commits
ygao added a subscriber: ygao.


Comment at: lib/Basic/Targets.cpp:2772
@@ -2771,2 +2771,3 @@
 setFeatureEnabledImpl(Features, "xsaveopt", true);
+setFeatureEnabledImpl(Features, "xsave", true);
 // FALLTHROUGH

Is this line necessary? Line#3027 below in the same file says that xsaveopt 
already implies xsave.


Repository:
  rL LLVM

http://reviews.llvm.org/D17682



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


[PATCH] D18533: Fixing PR26558: the adc builtins do not require the adx target attribute

2016-03-28 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added subscribers: craig.topper, bogner, cfe-commits.

Hi,
The addcarry and subborrow variants of the builtins do not require the adx 
target attribute. Only the addcarryx variants require them.
This patch attempts to remove the target attribute requirements from these 
builtins, and also to update the test (run the same test without adx and make 
sure nothing breaks).
Could you review?

Many thanks,
- Gao

http://reviews.llvm.org/D18533

Files:
  include/clang/Basic/BuiltinsX86.def
  test/CodeGen/adc-builtins.c

Index: test/CodeGen/adc-builtins.c
===
--- test/CodeGen/adc-builtins.c
+++ test/CodeGen/adc-builtins.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx 
-emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | 
FileCheck %s
 
 #define __MM_MALLOC_H
 
Index: include/clang/Basic/BuiltinsX86.def
===
--- include/clang/Basic/BuiltinsX86.def
+++ include/clang/Basic/BuiltinsX86.def
@@ -690,10 +690,10 @@
 // ADX
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
 
 // RDSEED
 TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")


Index: test/CodeGen/adc-builtins.c
===
--- test/CodeGen/adc-builtins.c
+++ test/CodeGen/adc-builtins.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
 
 #define __MM_MALLOC_H
 
Index: include/clang/Basic/BuiltinsX86.def
===
--- include/clang/Basic/BuiltinsX86.def
+++ include/clang/Basic/BuiltinsX86.def
@@ -690,10 +690,10 @@
 // ADX
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
 TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
-TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
+TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
 
 // RDSEED
 TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D15705: Adding a scripted test for PR25717

2016-01-04 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

> What I would suggest is:

> 

>   Check that this test fails at least on windows with your patch

> 

> reverted. If so, commit it. BTW, don't you need to drop the "|

>  FileCheck" to cause a crash?


Hmm, even with the pipe removed, I still have difficulty reproducing the crash 
within lit. I was doing:
C:\llvm\build>python ..\llvm\utils\lit\lit.py -v --no-progress-bar --param 
build_mode=Release tools\clang\test\Preprocessor\macro.c
But the test is passing. And the run line is simply:
// RUN: %clang_cc1 -E -x c %s

And, if I use the RUN line directly on a command-prompt, the test crashes as 
expected.


http://reviews.llvm.org/D15705



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


Re: [PATCH] D15705: Adding a scripted test for PR25717

2016-01-05 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

In llvm/utils/lit/lit/TestRunner.py line#202 inside function executeShCmd(), 
the test is spawned by
subprocess.Popen(command, ..., stdout = subprocess.PIPE, stderr = 
subprocess.PIPE, ...)
And the test passes. I can verify with a small python script doing just a 
subprocess.Popen.

If the test is spawned with stdout = None instead, the test will crash as 
expected.

I could not find a way to trick TestRunner into leaving stdout as None. Is 
there supposed to be
a command-line option to lit? Or maybe a special redirection mark on the RUN 
line? Maybe a lit
expert can help me here.


http://reviews.llvm.org/D15705



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


Re: [PATCH] D15705: Adding a scripted test for PR25717

2016-01-08 Thread Yunzhong Gao via cfe-commits
ygao updated this revision to Diff 44351.

http://reviews.llvm.org/D15705

Files:
  test/Preprocessor/bigoutput.c

Index: test/Preprocessor/bigoutput.c
===
--- test/Preprocessor/bigoutput.c
+++ test/Preprocessor/bigoutput.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -E -x c %s > /dev/console
+// The original bug requires UNIX line endings to trigger.
+// The original bug triggers only when outputting directly to console.
+
+// Make sure clang does not crash during preprocessing
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14


Index: test/Preprocessor/bigoutput.c
===
--- test/Preprocessor/bigoutput.c
+++ test/Preprocessor/bigoutput.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -E -x c %s > /dev/console
+// The original bug requires UNIX line endings to trigger.
+// The original bug triggers only when outputting directly to console.
+
+// Make sure clang does not crash during preprocessing
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D16365: Do not define GXX_RTTI macro for C

2016-01-20 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added a reviewer: rsmith.
ygao added a subscriber: cfe-commits.
Herald added subscribers: dschuff, jfb.

Hi,
I was looking at the list of pre-defined macros by the new LLVM release and 
noticed that the __GXX_RTTI macro is being defined for both C and C++, and I 
wonder maybe it makes sense to only enable RTTI for C++. What do you think?
Thanks in advance,
- Gao

http://reviews.llvm.org/D16365

Files:
  lib/Frontend/CompilerInvocation.cpp
  test/Preprocessor/init.c

Index: test/Preprocessor/init.c
===
--- test/Preprocessor/init.c
+++ test/Preprocessor/init.c
@@ -57,14 +57,22 @@
 //
 // C99:#define __STDC_VERSION__ 199901L
 // C99:#define __STRICT_ANSI__ 1
+// C99-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C99-NOT: __GXX_RTTI
+// C99-NOT: __GXX_WEAK__
+// C99-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
 //
 // C11:#define __STDC_UTF_16__ 1
 // C11:#define __STDC_UTF_32__ 1
 // C11:#define __STDC_VERSION__ 201112L
 // C11:#define __STRICT_ANSI__ 1
+// C11-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C11-NOT: __GXX_RTTI
+// C11-NOT: __GXX_WEAK__
+// C11-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
@@ -3286,7 +3294,6 @@
 // MIPSN32BE: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32BE: #define __GNUC__ 4
 // MIPSN32BE: #define __GXX_ABI_VERSION 1002
-// MIPSN32BE: #define __GXX_RTTI 1
 // MIPSN32BE: #define __ILP32__ 1
 // MIPSN32BE: #define __INT16_C_SUFFIX__
 // MIPSN32BE: #define __INT16_FMTd__ "hd"
@@ -3592,7 +3599,6 @@
 // MIPSN32EL: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32EL: #define __GNUC__ 4
 // MIPSN32EL: #define __GXX_ABI_VERSION 1002
-// MIPSN32EL: #define __GXX_RTTI 1
 // MIPSN32EL: #define __ILP32__ 1
 // MIPSN32EL: #define __INT16_C_SUFFIX__
 // MIPSN32EL: #define __INT16_FMTd__ "hd"
@@ -7618,7 +7624,6 @@
 // X86_64-CLOUDABI:#define __GNUC_STDC_INLINE__ 1
 // X86_64-CLOUDABI:#define __GNUC__ 4
 // X86_64-CLOUDABI:#define __GXX_ABI_VERSION 1002
-// X86_64-CLOUDABI:#define __GXX_RTTI 1
 // X86_64-CLOUDABI:#define __INT16_C_SUFFIX__ 
 // X86_64-CLOUDABI:#define __INT16_FMTd__ "hd"
 // X86_64-CLOUDABI:#define __INT16_FMTi__ "hi"
@@ -8483,7 +8488,6 @@
 // WEBASSEMBLY32-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __GNUC__ {{.}}
 // WEBASSEMBLY32-NEXT:#define __GXX_ABI_VERSION 1002{{$}}
-// WEBASSEMBLY32-NEXT:#define __GXX_RTTI 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __ILP32__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT16_C_SUFFIX__ {{$}}
 // WEBASSEMBLY32-NEXT:#define __INT16_FMTd__ "hd"{{$}}
@@ -8799,7 +8803,6 @@
 // WEBASSEMBLY64-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}}
 // WEBASSEMBLY64-NEXT:#define __GNUC__ {{.}}
 // WEBASSEMBLY64-NEXT:#define __GXX_ABI_VERSION 1002{{$}}
-// WEBASSEMBLY64-NEXT:#define __GXX_RTTI 1{{$}}
 // WEBASSEMBLY64-NOT:#define __ILP32__
 // WEBASSEMBLY64-NEXT:#define __INT16_C_SUFFIX__ {{$}}
 // WEBASSEMBLY64-NEXT:#define __INT16_FMTd__ "hd"{{$}}
Index: lib/Frontend/CompilerInvocation.cpp
===
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Frontend/CompilerInvocation.cpp
@@ -1666,7 +1666,7 @@
   Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions);
   Opts.TraditionalCPP = Args.hasArg(OPT_traditional_cpp);
 
-  Opts.RTTI = !Args.hasArg(OPT_fno_rtti);
+  Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
   Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
   Opts.Blocks = Args.hasArg(OPT_fblocks);
   Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);


Index: test/Preprocessor/init.c
===
--- test/Preprocessor/init.c
+++ test/Preprocessor/init.c
@@ -57,14 +57,22 @@
 //
 // C99:#define __STDC_VERSION__ 199901L
 // C99:#define __STRICT_ANSI__ 1
+// C99-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C99-NOT: __GXX_RTTI
+// C99-NOT: __GXX_WEAK__
+// C99-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
 //
 // C11:#define __STDC_UTF_16__ 1
 // C11:#define __STDC_UTF_32__ 1
 // C11:#define __STDC_VERSION__ 201112L
 // C11:#define __STRICT_ANSI__ 1
+// C11-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C11-NOT: __GXX_RTTI
+// C11-NOT: __GXX_WEAK__
+// C11-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
@@ -3286,7 +3294,6 @@
 // MIPSN32BE: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32BE: #define __GNUC__ 4
 // MIPSN32BE: #define __GXX_ABI_VERSION 1002
-// MIPSN32BE: #define __GXX_RTTI 1
 // MIPSN32BE: #define __ILP32__ 1
 // MIPSN32BE: #define __INT16_C_SUFFIX__
 // MIPSN32BE: #define __INT16_FMTd__ "hd"
@@ -3592,7 +3599,6 @@
 // MIPSN32EL: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32EL: #define __GNUC__ 4
 // MIPSN32EL: #define __GXX_ABI_VERSION 1002
-// MIPSN32EL: #define __GXX_RTTI 1
 // MIPSN32EL: #define __ILP32

Re: [PATCH] D15705: Adding a scripted test for PR25717

2016-01-22 Thread Yunzhong Gao via cfe-commits
ygao updated this revision to Diff 45784.

http://reviews.llvm.org/D15705

Files:
  test/Preprocessor/bigoutput.c
  test/lit.cfg

Index: test/lit.cfg
===
--- test/lit.cfg
+++ test/lit.cfg
@@ -491,4 +491,9 @@
 if use_gmalloc:
  config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
 
+# Check if we should allow outputs to console.
+run_console_tests = int(lit_config.params.get('enable_console', '0'))
+if run_console_tests != 0:
+  config.available_features.add('console')
+
 lit.util.usePlatformSdkOnDarwin(config, lit_config)
Index: test/Preprocessor/bigoutput.c
===
--- test/Preprocessor/bigoutput.c
+++ test/Preprocessor/bigoutput.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -E -x c %s > /dev/tty
+// The original bug requires UNIX line endings to trigger.
+// The original bug triggers only when outputting directly to console.
+// REQUIRES: console
+
+// Make sure clang does not crash during preprocessing
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14


Index: test/lit.cfg
===
--- test/lit.cfg
+++ test/lit.cfg
@@ -491,4 +491,9 @@
 if use_gmalloc:
  config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
 
+# Check if we should allow outputs to console.
+run_console_tests = int(lit_config.params.get('enable_console', '0'))
+if run_console_tests != 0:
+  config.available_features.add('console')
+
 lit.util.usePlatformSdkOnDarwin(config, lit_config)
Index: test/Preprocessor/bigoutput.c
===
--- test/Preprocessor/bigoutput.c
+++ test/Preprocessor/bigoutput.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -E -x c %s > /dev/tty
+// The original bug requires UNIX line endings to trigger.
+// The original bug triggers only when outputting directly to console.
+// REQUIRES: console
+
+// Make sure clang does not crash during preprocessing
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D15705: Adding a scripted test for PR25717

2016-01-25 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

Thanks, Rafael!
I did verify that the test would fail without my fix. But what do I need to do 
to make buildbots turn on the new lit parameter?


http://reviews.llvm.org/D15705



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


Re: [PATCH] D16365: Do not define GXX_RTTI macro for C

2016-01-25 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

A gentle ping.


http://reviews.llvm.org/D16365



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


r258850 - Do not define GXX_RTTI macro for C.

2016-01-26 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Tue Jan 26 14:15:02 2016
New Revision: 258850

URL: http://llvm.org/viewvc/llvm-project?rev=258850&view=rev
Log:
Do not define GXX_RTTI macro for C.
This is same as GCC behavior (tested with GCC 4.8.2).

Differential Revision: http://reviews.llvm.org/D16365


Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/test/Preprocessor/init.c

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=258850&r1=258849&r2=258850&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Jan 26 14:15:02 2016
@@ -1669,7 +1669,7 @@ static void ParseLangArgs(LangOptions &O
   Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions);
   Opts.TraditionalCPP = Args.hasArg(OPT_traditional_cpp);
 
-  Opts.RTTI = !Args.hasArg(OPT_fno_rtti);
+  Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
   Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
   Opts.Blocks = Args.hasArg(OPT_fblocks);
   Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);

Modified: cfe/trunk/test/Preprocessor/init.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=258850&r1=258849&r2=258850&view=diff
==
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Tue Jan 26 14:15:02 2016
@@ -57,6 +57,10 @@
 //
 // C99:#define __STDC_VERSION__ 199901L
 // C99:#define __STRICT_ANSI__ 1
+// C99-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C99-NOT: __GXX_RTTI
+// C99-NOT: __GXX_WEAK__
+// C99-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
@@ -65,6 +69,10 @@
 // C11:#define __STDC_UTF_32__ 1
 // C11:#define __STDC_VERSION__ 201112L
 // C11:#define __STRICT_ANSI__ 1
+// C11-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C11-NOT: __GXX_RTTI
+// C11-NOT: __GXX_WEAK__
+// C11-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
@@ -3286,7 +3294,6 @@
 // MIPSN32BE: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32BE: #define __GNUC__ 4
 // MIPSN32BE: #define __GXX_ABI_VERSION 1002
-// MIPSN32BE: #define __GXX_RTTI 1
 // MIPSN32BE: #define __ILP32__ 1
 // MIPSN32BE: #define __INT16_C_SUFFIX__
 // MIPSN32BE: #define __INT16_FMTd__ "hd"
@@ -3592,7 +3599,6 @@
 // MIPSN32EL: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32EL: #define __GNUC__ 4
 // MIPSN32EL: #define __GXX_ABI_VERSION 1002
-// MIPSN32EL: #define __GXX_RTTI 1
 // MIPSN32EL: #define __ILP32__ 1
 // MIPSN32EL: #define __INT16_C_SUFFIX__
 // MIPSN32EL: #define __INT16_FMTd__ "hd"
@@ -7618,7 +7624,6 @@
 // X86_64-CLOUDABI:#define __GNUC_STDC_INLINE__ 1
 // X86_64-CLOUDABI:#define __GNUC__ 4
 // X86_64-CLOUDABI:#define __GXX_ABI_VERSION 1002
-// X86_64-CLOUDABI:#define __GXX_RTTI 1
 // X86_64-CLOUDABI:#define __INT16_C_SUFFIX__ 
 // X86_64-CLOUDABI:#define __INT16_FMTd__ "hd"
 // X86_64-CLOUDABI:#define __INT16_FMTi__ "hi"
@@ -8483,7 +8488,6 @@
 // WEBASSEMBLY32-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __GNUC__ {{.}}
 // WEBASSEMBLY32-NEXT:#define __GXX_ABI_VERSION 1002{{$}}
-// WEBASSEMBLY32-NEXT:#define __GXX_RTTI 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __ILP32__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT16_C_SUFFIX__ {{$}}
 // WEBASSEMBLY32-NEXT:#define __INT16_FMTd__ "hd"{{$}}
@@ -8799,7 +8803,6 @@
 // WEBASSEMBLY64-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}}
 // WEBASSEMBLY64-NEXT:#define __GNUC__ {{.}}
 // WEBASSEMBLY64-NEXT:#define __GXX_ABI_VERSION 1002{{$}}
-// WEBASSEMBLY64-NEXT:#define __GXX_RTTI 1{{$}}
 // WEBASSEMBLY64-NOT:#define __ILP32__
 // WEBASSEMBLY64-NEXT:#define __INT16_C_SUFFIX__ {{$}}
 // WEBASSEMBLY64-NEXT:#define __INT16_FMTd__ "hd"{{$}}


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


Re: [PATCH] D16365: Do not define GXX_RTTI macro for C

2016-01-26 Thread Yunzhong Gao via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL258850: Do not define GXX_RTTI macro for C. (authored by 
ygao).

Changed prior to commit:
  http://reviews.llvm.org/D16365?vs=45416&id=46031#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16365

Files:
  cfe/trunk/lib/Frontend/CompilerInvocation.cpp
  cfe/trunk/test/Preprocessor/init.c

Index: cfe/trunk/test/Preprocessor/init.c
===
--- cfe/trunk/test/Preprocessor/init.c
+++ cfe/trunk/test/Preprocessor/init.c
@@ -57,14 +57,22 @@
 //
 // C99:#define __STDC_VERSION__ 199901L
 // C99:#define __STRICT_ANSI__ 1
+// C99-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C99-NOT: __GXX_RTTI
+// C99-NOT: __GXX_WEAK__
+// C99-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
 //
 // C11:#define __STDC_UTF_16__ 1
 // C11:#define __STDC_UTF_32__ 1
 // C11:#define __STDC_VERSION__ 201112L
 // C11:#define __STRICT_ANSI__ 1
+// C11-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C11-NOT: __GXX_RTTI
+// C11-NOT: __GXX_WEAK__
+// C11-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
@@ -3286,7 +3294,6 @@
 // MIPSN32BE: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32BE: #define __GNUC__ 4
 // MIPSN32BE: #define __GXX_ABI_VERSION 1002
-// MIPSN32BE: #define __GXX_RTTI 1
 // MIPSN32BE: #define __ILP32__ 1
 // MIPSN32BE: #define __INT16_C_SUFFIX__
 // MIPSN32BE: #define __INT16_FMTd__ "hd"
@@ -3592,7 +3599,6 @@
 // MIPSN32EL: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32EL: #define __GNUC__ 4
 // MIPSN32EL: #define __GXX_ABI_VERSION 1002
-// MIPSN32EL: #define __GXX_RTTI 1
 // MIPSN32EL: #define __ILP32__ 1
 // MIPSN32EL: #define __INT16_C_SUFFIX__
 // MIPSN32EL: #define __INT16_FMTd__ "hd"
@@ -7618,7 +7624,6 @@
 // X86_64-CLOUDABI:#define __GNUC_STDC_INLINE__ 1
 // X86_64-CLOUDABI:#define __GNUC__ 4
 // X86_64-CLOUDABI:#define __GXX_ABI_VERSION 1002
-// X86_64-CLOUDABI:#define __GXX_RTTI 1
 // X86_64-CLOUDABI:#define __INT16_C_SUFFIX__ 
 // X86_64-CLOUDABI:#define __INT16_FMTd__ "hd"
 // X86_64-CLOUDABI:#define __INT16_FMTi__ "hi"
@@ -8483,7 +8488,6 @@
 // WEBASSEMBLY32-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __GNUC__ {{.}}
 // WEBASSEMBLY32-NEXT:#define __GXX_ABI_VERSION 1002{{$}}
-// WEBASSEMBLY32-NEXT:#define __GXX_RTTI 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __ILP32__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT16_C_SUFFIX__ {{$}}
 // WEBASSEMBLY32-NEXT:#define __INT16_FMTd__ "hd"{{$}}
@@ -8799,7 +8803,6 @@
 // WEBASSEMBLY64-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}}
 // WEBASSEMBLY64-NEXT:#define __GNUC__ {{.}}
 // WEBASSEMBLY64-NEXT:#define __GXX_ABI_VERSION 1002{{$}}
-// WEBASSEMBLY64-NEXT:#define __GXX_RTTI 1{{$}}
 // WEBASSEMBLY64-NOT:#define __ILP32__
 // WEBASSEMBLY64-NEXT:#define __INT16_C_SUFFIX__ {{$}}
 // WEBASSEMBLY64-NEXT:#define __INT16_FMTd__ "hd"{{$}}
Index: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
===
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp
@@ -1669,7 +1669,7 @@
   Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions);
   Opts.TraditionalCPP = Args.hasArg(OPT_traditional_cpp);
 
-  Opts.RTTI = !Args.hasArg(OPT_fno_rtti);
+  Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
   Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
   Opts.Blocks = Args.hasArg(OPT_fblocks);
   Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);


Index: cfe/trunk/test/Preprocessor/init.c
===
--- cfe/trunk/test/Preprocessor/init.c
+++ cfe/trunk/test/Preprocessor/init.c
@@ -57,14 +57,22 @@
 //
 // C99:#define __STDC_VERSION__ 199901L
 // C99:#define __STRICT_ANSI__ 1
+// C99-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C99-NOT: __GXX_RTTI
+// C99-NOT: __GXX_WEAK__
+// C99-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
 //
 // C11:#define __STDC_UTF_16__ 1
 // C11:#define __STDC_UTF_32__ 1
 // C11:#define __STDC_VERSION__ 201112L
 // C11:#define __STRICT_ANSI__ 1
+// C11-NOT: __GXX_EXPERIMENTAL_CXX0X__
+// C11-NOT: __GXX_RTTI
+// C11-NOT: __GXX_WEAK__
+// C11-NOT: __cplusplus
 //
 // 
 // RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
@@ -3286,7 +3294,6 @@
 // MIPSN32BE: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32BE: #define __GNUC__ 4
 // MIPSN32BE: #define __GXX_ABI_VERSION 1002
-// MIPSN32BE: #define __GXX_RTTI 1
 // MIPSN32BE: #define __ILP32__ 1
 // MIPSN32BE: #define __INT16_C_SUFFIX__
 // MIPSN32BE: #define __INT16_FMTd__ "hd"
@@ -3592,7 +3599,6 @@
 // MIPSN32EL: #define __GNUC_STDC_INLINE__ 1
 // MIPSN32EL: #define __GNUC__ 4
 // MIPSN32EL: #define __GXX_ABI_VERSION 1002
-// MIPSN32EL: #define __GXX_RTTI 1
 // MIPSN32EL: #define __ILP32__ 1
 // MIPSN32EL: #defin

r258902 - Adding a test for PR25717.

2016-01-26 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Tue Jan 26 20:18:28 2016
New Revision: 258902

URL: http://llvm.org/viewvc/llvm-project?rev=258902&view=rev
Log:
Adding a test for PR25717.

The test tries to produce a large preprocessed output to the console, and checks
that we do not see any unexpected fatal errors.

The test is not enabled unless a lit parameter "--param enable_console=1" is
passed on the command line to lit.py.


Added:
cfe/trunk/test/Preprocessor/bigoutput.c   (with props)
Modified:
cfe/trunk/test/lit.cfg

Added: cfe/trunk/test/Preprocessor/bigoutput.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/bigoutput.c?rev=258902&view=auto
==
--- cfe/trunk/test/Preprocessor/bigoutput.c (added)
+++ cfe/trunk/test/Preprocessor/bigoutput.c Tue Jan 26 20:18:28 2016
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -E -x c %s > /dev/tty
+// The original bug requires UNIX line endings to trigger.
+// The original bug triggers only when outputting directly to console.
+// REQUIRES: console
+
+// Make sure clang does not crash during preprocessing
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14

Propchange: cfe/trunk/test/Preprocessor/bigoutput.c
--
svn:eol-style = LF

Modified: cfe/trunk/test/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=258902&r1=258901&r2=258902&view=diff
==
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Tue Jan 26 20:18:28 2016
@@ -491,4 +491,9 @@ gmalloc_path_str = lit_config.params.get
 if use_gmalloc:
  config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
 
+# Check if we should allow outputs to console.
+run_console_tests = int(lit_config.params.get('enable_console', '0'))
+if run_console_tests != 0:
+  config.available_features.add('console')
+
 lit.util.usePlatformSdkOnDarwin(config, lit_config)


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


[PATCH] D16694: [llvmlab] Enable clang tests that output to the console when we are on the buildbots

2016-01-28 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added subscribers: gkistanova, sqlbyme, cfe-commits, llvm-commits.

Hi,
So this patch tries to enable tests that will output to the console. These 
tests are otherwise not exercised.
Note that the outputs will stay on the console and will not be saved into the 
test log.
Could a buildbot expert take a look whether this is the right approach?
Thanks in advance,
- Gao

http://reviews.llvm.org/D16694

Files:
  zorg/buildbot/builders/ClangBuilder.py

Index: zorg/buildbot/builders/ClangBuilder.py
===
--- zorg/buildbot/builders/ClangBuilder.py
+++ zorg/buildbot/builders/ClangBuilder.py
@@ -1367,15 +1367,15 @@
 # Save artifacts of this build for use by other builders.
 f = artifacts.uploadArtifacts(f)
 # Run the LLVM and Clang regression tests.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true 
--filter='^(?!.*debuginfo-tests)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true 
--param enable_console=1 --filter='^(?!.*debuginfo-tests)'" check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.tests', 
haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],
   workdir=clang_build_dir))
 # Work around for lldb issue rdar://14929651
 # The crazy filter regex is to remove static-member[2].cpp, which requires 
xcode5 or later.
 # radar://16295455 tracks the removal of this regex.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true 
 --filter='debuginfo-tests.(?!static-member)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true 
--param enable_console=1 --filter='debuginfo-tests.(?!static-member)'" 
check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.debuginfo-tests', 
haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],


Index: zorg/buildbot/builders/ClangBuilder.py
===
--- zorg/buildbot/builders/ClangBuilder.py
+++ zorg/buildbot/builders/ClangBuilder.py
@@ -1367,15 +1367,15 @@
 # Save artifacts of this build for use by other builders.
 f = artifacts.uploadArtifacts(f)
 # Run the LLVM and Clang regression tests.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true --filter='^(?!.*debuginfo-tests)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true --param enable_console=1 --filter='^(?!.*debuginfo-tests)'" check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.tests', haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],
   workdir=clang_build_dir))
 # Work around for lldb issue rdar://14929651
 # The crazy filter regex is to remove static-member[2].cpp, which requires xcode5 or later.
 # radar://16295455 tracks the removal of this regex.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true  --filter='debuginfo-tests.(?!static-member)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true --param enable_console=1 --filter='debuginfo-tests.(?!static-member)'" check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.debuginfo-tests', haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D16694: [llvmlab] Enable clang tests that output to the console when we are on the buildbots

2016-01-29 Thread Yunzhong Gao via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL259248: [llvmlab] Enable clang tests that output to the 
console when we are on the… (authored by ygao).

Changed prior to commit:
  http://reviews.llvm.org/D16694?vs=46313&id=46431#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16694

Files:
  zorg/trunk/zorg/buildbot/builders/ClangBuilder.py

Index: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
===
--- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
+++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
@@ -1367,15 +1367,15 @@
 # Save artifacts of this build for use by other builders.
 f = artifacts.uploadArtifacts(f)
 # Run the LLVM and Clang regression tests.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true 
--filter='^(?!.*debuginfo-tests)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true 
--param enable_console=1 --filter='^(?!.*debuginfo-tests)'" check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.tests', 
haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],
   workdir=clang_build_dir))
 # Work around for lldb issue rdar://14929651
 # The crazy filter regex is to remove static-member[2].cpp, which requires 
xcode5 or later.
 # radar://16295455 tracks the removal of this regex.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true 
 --filter='debuginfo-tests.(?!static-member)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true 
--param enable_console=1 --filter='debuginfo-tests.(?!static-member)'" 
check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.debuginfo-tests', 
haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],


Index: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
===
--- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
+++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
@@ -1367,15 +1367,15 @@
 # Save artifacts of this build for use by other builders.
 f = artifacts.uploadArtifacts(f)
 # Run the LLVM and Clang regression tests.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true --filter='^(?!.*debuginfo-tests)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-v --param run_long_tests=true --param enable_console=1 --filter='^(?!.*debuginfo-tests)'" check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.tests', haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],
   workdir=clang_build_dir))
 # Work around for lldb issue rdar://14929651
 # The crazy filter regex is to remove static-member[2].cpp, which requires xcode5 or later.
 # radar://16295455 tracks the removal of this regex.
-cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true  --filter='debuginfo-tests.(?!static-member)'" check-all"""
+cmd_str = r"""make VERBOSE=1 LIT_ARGS="-j 1 -v --param run_long_tests=true --param enable_console=1 --filter='debuginfo-tests.(?!static-member)'" check-all"""
 f.addStep(lit_test_command.LitTestCommand(name='run.llvm.debuginfo-tests', haltOnFailure=True,
   command=cmd_str,
   description=['all', 'tests'],
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D15705: Adding a scripted test for PR25717

2016-01-29 Thread Yunzhong Gao via cfe-commits
ygao closed this revision.
ygao added a comment.

The test is commited in http://reviews.llvm.org/rL258898 and 
http://reviews.llvm.org/rL258902, and it is enabled on buildbot in 
http://reviews.llvm.org/rL259248.
Thanks!


http://reviews.llvm.org/D15705



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


r255200 - Fix a typo in the clang user manual.

2015-12-09 Thread Yunzhong Gao via cfe-commits
Author: ygao
Date: Wed Dec  9 19:37:18 2015
New Revision: 255200

URL: http://llvm.org/viewvc/llvm-project?rev=255200&view=rev
Log:
Fix a typo in the clang user manual.
-fmax-unknown-pointer-align => -fmax-type-align

Modified:
cfe/trunk/docs/UsersManual.rst

Modified: cfe/trunk/docs/UsersManual.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.rst?rev=255200&r1=255199&r2=255200&view=diff
==
--- cfe/trunk/docs/UsersManual.rst (original)
+++ cfe/trunk/docs/UsersManual.rst Wed Dec  9 19:37:18 2015
@@ -1108,7 +1108,7 @@ are listed below.
This option restricts the generated code to use general registers
only. This only applies to the AArch64 architecture.
 
-**-f[no-]max-unknown-pointer-align=[number]**
+**-f[no-]max-type-align=[number]**
Instruct the code generator to not enforce a higher alignment than the given
number (of bytes) when accessing memory via an opaque pointer or reference.
This cap is ignored when directly accessing a variable or when the pointee
@@ -1136,7 +1136,7 @@ are listed below.
 
   void initialize_vector(__aligned_v16si *v) {
 // The compiler may assume that ‘v’ is 64-byte aligned, regardless 
of the
-// value of -fmax-unknown-pointer-align.
+// value of -fmax-type-align.
   }
 
 


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


[PATCH] D15705: Adding a scripted test for PR25717

2015-12-21 Thread Yunzhong Gao via cfe-commits
ygao created this revision.
ygao added subscribers: cfe-commits, rsandifo, majnemer, aaron.ballman.

Hi,
I am trying to add a test for PR25717. The test itself is fairly 
straight-forward: it generates a
large .c temporary file on the fly and then runs the preprocessor over the 
generated file to
make sure we do not see any unexpected fatal errors.
I have never added a scripted test before, so it would be really nice if 
someone with this
experience could take a look that I did make all the necessary changes.
Many thanks in advance,
- Gao

http://reviews.llvm.org/D15705

Files:
  test/Preprocessor/bigoutput.py
  test/Preprocessor/lit.local.cfg

Index: test/Preprocessor/lit.local.cfg
===
--- test/Preprocessor/lit.local.cfg
+++ test/Preprocessor/lit.local.cfg
@@ -0,0 +1,2 @@
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.cl', '.s', '.S', '.py']
+
Index: test/Preprocessor/bigoutput.py
===
--- test/Preprocessor/bigoutput.py
+++ test/Preprocessor/bigoutput.py
@@ -0,0 +1,11 @@
+# RUN: python %s
+# RUN: %clang_cc1 -E -x c bigoutput.c | FileCheck %s
+
+# Make sure clang does not crash during preprocessing
+# CHECK-NOT: fatal error
+
+f = open("bigoutput.c", "wb")
+for i in range(0, 15000):
+  # this test requires UNIX line endings
+  f.write("int v%d;\n" % i)
+f.close()


Index: test/Preprocessor/lit.local.cfg
===
--- test/Preprocessor/lit.local.cfg
+++ test/Preprocessor/lit.local.cfg
@@ -0,0 +1,2 @@
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.cl', '.s', '.S', '.py']
+
Index: test/Preprocessor/bigoutput.py
===
--- test/Preprocessor/bigoutput.py
+++ test/Preprocessor/bigoutput.py
@@ -0,0 +1,11 @@
+# RUN: python %s
+# RUN: %clang_cc1 -E -x c bigoutput.c | FileCheck %s
+
+# Make sure clang does not crash during preprocessing
+# CHECK-NOT: fatal error
+
+f = open("bigoutput.c", "wb")
+for i in range(0, 15000):
+  # this test requires UNIX line endings
+  f.write("int v%d;\n" % i)
+f.close()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D15705: Adding a scripted test for PR25717

2015-12-21 Thread Yunzhong Gao via cfe-commits
ygao added inline comments.


Comment at: test/Preprocessor/bigoutput.py:7
@@ +6,3 @@
+
+f = open("bigoutput.c", "wb")
+for i in range(0, 15000):

For example, it would be nice to use %t as the temporary file name (so lit will 
fill in with a generated
name) instead of a hard-coded name here, but I am trying to force UNIX line 
ending here. So I could
not figure out how to combine %t with the open() call.


http://reviews.llvm.org/D15705



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


Re: [PATCH] D15705: Adding a scripted test for PR25717

2015-12-23 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

Hi Rafael,
Yes I can do that, and it works for me. Do you know whether there is a way to 
keep the UNIX line ending on the test file upon checkout rather than having svn 
or git auto-translate the line endings? The UNIX line ending is necessary to 
trigger the original bug,

- Gao


http://reviews.llvm.org/D15705



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


Re: [PATCH] D15705: Adding a scripted test for PR25717

2015-12-23 Thread Yunzhong Gao via cfe-commits
ygao updated this revision to Diff 43554.
ygao added a comment.

I think what I can do is to run
svn propset svn:eol-style 'LF'
on the new file, and hopefully the subversion or git client will get the hint 
and not auto-translate the line endings.


http://reviews.llvm.org/D15705

Files:
  test/Preprocessor/macro.c

Index: test/Preprocessor/macro.c
===
--- test/Preprocessor/macro.c
+++ test/Preprocessor/macro.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -E -x c %s | FileCheck %s
+// The original bug requires UNIX line endings to trigger.
+
+// Make sure clang does not crash during preprocessing
+// CHECK-NOT: fatal error
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14


Index: test/Preprocessor/macro.c
===
--- test/Preprocessor/macro.c
+++ test/Preprocessor/macro.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -E -x c %s | FileCheck %s
+// The original bug requires UNIX line endings to trigger.
+
+// Make sure clang does not crash during preprocessing
+// CHECK-NOT: fatal error
+
+#define M0 extern int x;
+#define M2  M0  M0  M0  M0
+#define M4  M2  M2  M2  M2
+#define M6  M4  M4  M4  M4
+#define M8  M6  M6  M6  M6
+#define M10 M8  M8  M8  M8
+#define M12 M10 M10 M10 M10
+#define M14 M12 M12 M12 M12
+
+M14
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D15705: Adding a scripted test for PR25717

2015-12-23 Thread Yunzhong Gao via cfe-commits
ygao added a comment.

If you take a look at

  void PrintPreprocessedAction::ExecuteAction() {
...
while (next < end) {
if (*cur == 0x0D) {  // CR
  if (*next == 0x0A)  // CRLF
BinaryMode = false;
...

The value of this BinaryMode reflects whether the line ending style of the 
input file
is CRLF or LF. And it is passed all the way down to the constructor of 
raw_fd_ostream,

  std::unique_ptr 
CompilerInstance::createOutputFile(...) {
  ...
if (!Binary || OS->supportsSeeking())
  return std::move(OS);
  
auto B = llvm::make_unique(*OS);
...

So I think the line ending style of the input file does affect whether the 
output is buffered.


http://reviews.llvm.org/D15705



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