]> granicus.if.org Git - clang/log
clang
9 years agoRevert r240872, "Suppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts...
NAKAMURA Takumi [Sun, 28 Jun 2015 23:14:35 +0000 (23:14 +0000)]
Revert r240872, "Suppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts for now. Will fix later."

This has been fixed since r240912.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240920 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC] fixes typos in builtins-ppc-p8vector.c
Jingyue Wu [Sun, 28 Jun 2015 18:30:36 +0000 (18:30 +0000)]
[PPC] fixes typos in builtins-ppc-p8vector.c

The extra ] causes %{{[0-9]]*}} to match only %<single digit> such as %1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240912 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Stop old options from overriding new options
Birunthan Mohanathas [Sun, 28 Jun 2015 14:52:34 +0000 (14:52 +0000)]
clang-format: Stop old options from overriding new options

Summary: Depends on D10785.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240909 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Add missing members to FormatStyle::operator==
Birunthan Mohanathas [Sun, 28 Jun 2015 14:52:01 +0000 (14:52 +0000)]
clang-format: Add missing members to FormatStyle::operator==

Summary: Depends on D10784.

Reviewers: djasper

Reviewed By: djasper

Subscribers: dblaikie, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240908 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Alphabetize FormatStyle members
Birunthan Mohanathas [Sun, 28 Jun 2015 14:51:17 +0000 (14:51 +0000)]
clang-format: Alphabetize FormatStyle members

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240907 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Driver] x86-64 Windows is always PIC
David Majnemer [Sun, 28 Jun 2015 04:23:33 +0000 (04:23 +0000)]
[Driver] x86-64 Windows is always PIC

This fixes PR23963.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240902 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Support @autoreleasepool.
Nico Weber [Sun, 28 Jun 2015 01:06:16 +0000 (01:06 +0000)]
clang-format: Support @autoreleasepool.

Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.

Patch from Strager Neds!
http://reviews.llvm.org/D10372

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240896 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Unions cannot have virtual functions.
Davide Italiano [Sat, 27 Jun 2015 19:18:55 +0000 (19:18 +0000)]
[Sema] Unions cannot have virtual functions.

PR: PR23931
Differential Revision: http://reviews.llvm.org/D10752
Reviewed by:  rsmith

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240889 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo. NFC.
Alex Denisov [Sat, 27 Jun 2015 19:04:55 +0000 (19:04 +0000)]
Fix typo. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240888 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Fix language of DisableFormat description
Birunthan Mohanathas [Sat, 27 Jun 2015 09:25:28 +0000 (09:25 +0000)]
clang-format: Fix language of DisableFormat description

This is a comment-only change to test commit access.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240879 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSuppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts for now. Will fix...
NAKAMURA Takumi [Sat, 27 Jun 2015 03:33:47 +0000 (03:33 +0000)]
Suppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts for now. Will fix later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240872 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a testcase for bitfield debug info.
Adrian Prantl [Fri, 26 Jun 2015 21:25:18 +0000 (21:25 +0000)]
Add a testcase for bitfield debug info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240833 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd missing builtins to altivec.h for ABI compliance (vol. 1)
Nemanja Ivanovic [Fri, 26 Jun 2015 19:27:20 +0000 (19:27 +0000)]
Add missing builtins to altivec.h for ABI compliance (vol. 1)

This patch corresponds to review:
http://reviews.llvm.org/D10637

This is the first round of additions of missing builtins listed in the ABI document. More to come (this builds onto what seurer already addes). This patch adds:
vector signed long long vec_abs(vector signed long long)
vector double vec_abs(vector double)
vector signed long long vec_add(vector signed long long, vector signed long long)
vector unsigned long long vec_add(vector unsigned long long, vector unsigned long long)
vector double vec_add(vector double, vector double)
vector double vec_and(vector bool long long, vector double)
vector double vec_and(vector double, vector bool long long)
vector double vec_and(vector double, vector double)
vector signed long long vec_and(vector signed long long, vector signed long long)
vector double vec_andc(vector bool long long, vector double)
vector double vec_andc(vector double, vector bool long long)
vector double vec_andc(vector double, vector double)
vector signed long long vec_andc(vector signed long long, vector signed long long)
vector double vec_ceil(vector double)
vector bool long long vec_cmpeq(vector double, vector double)
vector bool long long vec_cmpge(vector double, vector double)
vector bool long long vec_cmpge(vector signed long long, vector signed long long)
vector bool long long vec_cmpge(vector unsigned long long, vector unsigned long long)
vector bool long long vec_cmpgt(vector double, vector double)
vector bool long long vec_cmple(vector double, vector double)
vector bool long long vec_cmple(vector signed long long, vector signed long long)
vector bool long long vec_cmple(vector unsigned long long, vector unsigned long long)
vector bool long long vec_cmplt(vector double, vector double)
vector bool long long vec_cmplt(vector signed long long, vector signed long long)
vector bool long long vec_cmplt(vector unsigned long long, vector unsigned long long)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240821 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC]: Fix bug in getMultiarchTriple.
Douglas Katzman [Fri, 26 Jun 2015 18:37:15 +0000 (18:37 +0000)]
[PPC]: Fix bug in getMultiarchTriple.

And generally prefer not to restate TargetTriple.str() over and over.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240808 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAvoid false positive/negative test results from line directive interference.NFC.
Chad Rosier [Fri, 26 Jun 2015 17:49:10 +0000 (17:49 +0000)]
Avoid false positive/negative test results from line directive interference.NFC.

http://reviews.llvm.org/D10443
Patch by Geoff Berry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240801 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[static analyzer] Analyzer is skipping forward declared C/C++ functions
Anna Zaks [Fri, 26 Jun 2015 17:42:58 +0000 (17:42 +0000)]
[static analyzer] Analyzer is skipping forward declared C/C++ functions

A patch by Karthik Bhat!

This patch fixes a regression introduced by r224398. Prior to r224398
we were able to analyze the following code in test-include.c and report
a null deref in this case. But post r224398 this analysis is being skipped.

E.g.
  // test-include.c
  #include "test-include.h"
  void test(int * data) {
    data = 0;
    *data = 1;
  }

   // test-include.h
  void test(int * data);

This patch uses the function body (instead of its declaration) as the location
of the function when deciding if the Decl should be analyzed with path-sensitive
analysis. (Prior to r224398, the call graph was guaranteed to have a definition
when available.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240800 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format some of the files in lib/Driver. NFC
Douglas Katzman [Fri, 26 Jun 2015 15:47:46 +0000 (15:47 +0000)]
clang-format some of the files in lib/Driver. NFC

Nothing was hand edited afterward except a few literal strings
and comments that were poorly broken.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240791 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ObjC] Add NSValue support for objc_boxed_expressions
Alex Denisov [Fri, 26 Jun 2015 05:28:36 +0000 (05:28 +0000)]
[ObjC] Add NSValue support for objc_boxed_expressions

Patch extends ObjCBoxedExpr to accept records (structs and unions):

typedef struct __attribute__((objc_boxable)) _Color {
  int r, g, b;
} Color;

Color color;
NSValue *boxedColor = @(color); // [NSValue valueWithBytes:&color objCType:@encode(Color)];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240761 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix crash-on-invalid bug in template instantiation.
Manuel Klimek [Fri, 26 Jun 2015 02:15:04 +0000 (02:15 +0000)]
Fix crash-on-invalid bug in template instantiation.

Get rid of code-path that (according to Richard Smith) is not needed but
leads to a crasher bug when assuming a template has been fully
instantiated and thus has a definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240752 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFileCheck-ize test and make sure more things don't happen.
Paul Robinson [Fri, 26 Jun 2015 00:36:50 +0000 (00:36 +0000)]
FileCheck-ize test and make sure more things don't happen.

Attribute 'nodebug' means no llvm.dbg.* intrinsics, no !dbg
annotations, and no DISubprogram for the function.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240747 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd new file from r240741 to CMakeLists.txt.
Nico Weber [Fri, 26 Jun 2015 00:19:32 +0000 (00:19 +0000)]
Add new file from r240741 to CMakeLists.txt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240743 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Commit a better fix for r240242
Davide Italiano [Fri, 26 Jun 2015 00:18:35 +0000 (00:18 +0000)]
[Sema] Commit a better fix for r240242

Skip calls to HasTrivialDestructorBody() in the case where the
destructor is never invoked. Alternatively, Richard proposed to change
Sema to declare a trivial destructor for anonymous union member, which
seems too wasteful.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240742 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd an inttypes.h wrapper that fixes up some macros in Microsoft mode.
Nico Weber [Fri, 26 Jun 2015 00:13:18 +0000 (00:13 +0000)]
Add an inttypes.h wrapper that fixes up some macros in Microsoft mode.

Before MSVS2015, MSVS's headers disagree about int32_t and PRIx32 and so on.
Provide a wrapper header to fix this, so that -Wformat can still be used.
Fixes PR23412.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240741 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Maintain ellipsis location when transforming lambda captures
Meador Inge [Fri, 26 Jun 2015 00:09:55 +0000 (00:09 +0000)]
[Sema] Maintain ellipsis location when transforming lambda captures

This patch fixes a crash caused by the following case:

  template<typename T>
  auto f(T x) {
    auto g = [](auto ... args) {
      auto h = [args...]() -> int {
        return 0;
      };
      return h;
    };
    return g;
  }

  auto x = f(0)();

When the templated function 'f' is instantiated and the inner-most
lambda is transformed the ellipsis location on the captured variable
is lost.  Then the lambda returned by 'f' is instantiated and the
tree transformer chokes on the invalid ellipsis location.  The
problem is fixed by making a minor change to properly track the
ellipsis location.

This fixes PR23716.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240740 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Restrict isTriviallyRecursive to predefined lib functions forwarding to...
David Majnemer [Thu, 25 Jun 2015 23:50:40 +0000 (23:50 +0000)]
[CodeGen] Restrict isTriviallyRecursive to predefined lib functions forwarding to lib functions

isTriviallyRecursive is only supposed to guard functions part of the
implementation.

This fixes PR23953.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240735 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a typo correction crash when resolving ambiguous corrections.
Kaelyn Takata [Thu, 25 Jun 2015 23:47:39 +0000 (23:47 +0000)]
Fix a typo correction crash when resolving ambiguous corrections.

In certain cases, the tree transform would introduce new TypoExprs while
trying one of the corrections, invalidating the unique_ptr in the state
reference, and also causing a TypoExpr to exist that will never be
corrected since it doesn't exist in the final corrected expression. The
simple solution to both problems is to temporarily disable typo
correction while handling potentially ambiguous typo corrections.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240734 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[docs] Several updates to the Address Sanitizer webpage.
Anna Zaks [Thu, 25 Jun 2015 23:36:44 +0000 (23:36 +0000)]
[docs] Several updates to the Address Sanitizer webpage.

 - Added the description of the interceptor suppression.
 - Re-organized a bit: grouped a few things under the Issue Suppression
   section, grouped IOC and leaks under a section, placed symbolication
   info into Symbolizing the Reports section..
 - In supported platforms: "MacOS" -> "OS X"; added "iOS Simulator"
 - Added a paragraph to the Usage section describing when DYLD_INSERT_LIBRARIES
   might need to be used.
 - "attribute((no_sanitize_address))" -> "__attribute__((no_sanitize("address")))"
 - Updated Leak Sanitizer page with most up to date info.
....

http://reviews.llvm.org/D10559

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240725 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove `requires` for x86 CPU features.
Sean Silva [Thu, 25 Jun 2015 23:22:11 +0000 (23:22 +0000)]
Remove `requires` for x86 CPU features.

Ever since the target attributes change, we don't need to guard these
headers with `requires`. Actually it's a bit worse, because if we do
then they are included textually under the covers, causing declarations
to appear in submodules they aren't supposed to be in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240720 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix the test added in r240710.
Jonathan Roelofs [Thu, 25 Jun 2015 23:21:11 +0000 (23:21 +0000)]
Fix the test added in r240710.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240718 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CFI] Diagnose when we CFI in diagnostic mode is unavailable on a toolchain.
Alexey Samsonov [Thu, 25 Jun 2015 23:14:32 +0000 (23:14 +0000)]
[CFI] Diagnose when we CFI in diagnostic mode is unavailable on a toolchain.

Summary:
Namely, we must have proper C++ABI support in UBSan runtime. We don't
have a good way to check for that, so just assume that C++ABI support is
there whenever -fsanitize=vptr is supported (i.e. only on handful of
platforms).

Exact diagnostic is also tricky. It's not "cfi" that is unsupported,
just the diagnostic mode. So, I suggest to report that
"-fno-sanitize-trap=cfi-foobar" is incompatible with a given target
toolchain.

Test Plan: regression test suite

Reviewers: pcc

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240716 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDisplay profile file name when emitting a file not found diagnostic.
Diego Novillo [Thu, 25 Jun 2015 22:56:00 +0000 (22:56 +0000)]
Display profile file name when emitting a file not found diagnostic.

When a profile file cannot be opened, we used to display just the error
message but not the name of the profile the compiler was trying to open.
This will become useful in the next set of patches that introduce
GCC-compatible flags to specify profiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240715 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis should actually fix the broken bots.
Chris Bieneman [Thu, 25 Jun 2015 22:15:39 +0000 (22:15 +0000)]
This should actually fix the broken bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240710 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Parse] Allow 'constexpr' in condition declarations
Meador Inge [Thu, 25 Jun 2015 22:06:40 +0000 (22:06 +0000)]
[Parse] Allow 'constexpr' in condition declarations

This patch implements the functionality specified by DR948.
The changes are two fold.  First, the parser was modified
to allow 'constexpr's to appear in condition declarations
(which was a hard error before).  Second, Sema was modified
to cleanup maybe odr-used declarations by way of a call to
'ActOnFinishFullExpr'.  As 'constexpr's were not allowed in
condition declarations before the cleanup wasn't necessary
(such declarations were always odr-used).

This fixes PR22491.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240707 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Properly merge visibility of class definitions that got merged while
Richard Smith [Thu, 25 Jun 2015 21:42:33 +0000 (21:42 +0000)]
[modules] Properly merge visibility of class definitions that got merged while
parsing then merged again when the module was loaded.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240700 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agodocs: Fix bad link in SafeStack.rst.
Peter Collingbourne [Thu, 25 Jun 2015 21:02:17 +0000 (21:02 +0000)]
docs: Fix bad link in SafeStack.rst.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240696 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSpeculative fix for the broken bots.
Chris Bieneman [Thu, 25 Jun 2015 20:50:46 +0000 (20:50 +0000)]
Speculative fix for the broken bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240693 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Fix findDirectiveAtLoc to not call a member function on a null pointer.
Richard Smith [Thu, 25 Jun 2015 20:48:44 +0000 (20:48 +0000)]
[modules] Fix findDirectiveAtLoc to not call a member function on a null pointer.

This is exercised by existing tests, and fixes a failure with -fsanitize=null.
No observable change otherwise; the code happened to do the right thing in
practice under recent versions of Clang and GCC because
MacroDirective::getDefinition happens to check whether this == null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240691 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd -miphonesimulator-version-min as alias to -ios-simulator-version-min.
Chris Bieneman [Thu, 25 Jun 2015 20:25:43 +0000 (20:25 +0000)]
Add -miphonesimulator-version-min as alias to -ios-simulator-version-min.

Summary:
For better or worse the OS X command line tools refer to the iOS simulator as iphonesimucator. We should provide an alias flag -miphonesimulator-version-min that matches a consistent pattern with the other tools.

This is in the interest of making it easier for people to write platform-agnostic darwin build scripts.

Reviewers: bob.wilson, bogner

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[clang-fuzzer] Update clang-fuzzer to API change in r240225.
Alexey Samsonov [Thu, 25 Jun 2015 20:21:59 +0000 (20:21 +0000)]
[clang-fuzzer] Update clang-fuzzer to API change in r240225.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240685 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRename local variable CCCPrintActions -> CCCPrintPhases.
Douglas Katzman [Thu, 25 Jun 2015 19:37:41 +0000 (19:37 +0000)]
Rename local variable CCCPrintActions -> CCCPrintPhases.

To match the '-ccc-print-phases' command-line flag.
Also make two more 'for' loops range-based. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240680 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse more range-based for loops
Douglas Katzman [Thu, 25 Jun 2015 18:51:37 +0000 (18:51 +0000)]
Use more range-based for loops

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240674 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CUDA] Implemented __nvvm_atom_*_gen_* builtins.
Artem Belevich [Thu, 25 Jun 2015 18:29:42 +0000 (18:29 +0000)]
[CUDA] Implemented __nvvm_atom_*_gen_* builtins.

Integer variants are implemented as atomicrmw or cmpxchg instructions.
Atomic add for floating point (__nvvm_atom_add_gen_f()) is implemented
as a call to an overloaded @llvm.nvvm.atomic.load.add.f32.* LVVM
intrinsic.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240669 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOmit 'nodebug' methods from the class description.
Paul Robinson [Thu, 25 Jun 2015 17:50:43 +0000 (17:50 +0000)]
Omit 'nodebug' methods from the class description.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240664 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.
Artem Belevich [Thu, 25 Jun 2015 17:34:23 +0000 (17:34 +0000)]
[NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240659 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix #pragma redefine_extname when there is a local variable of the same name. The...
Aaron Ballman [Thu, 25 Jun 2015 15:37:16 +0000 (15:37 +0000)]
Fix #pragma redefine_extname when there is a local variable of the same name. The local should not be renamed, only the externally-available declaration should be.

Patch by Andrey Bokhanko!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240653 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a crash by division by zero in analyzer
Daniel Marjamaki [Thu, 25 Jun 2015 14:06:02 +0000 (14:06 +0000)]
Fix a crash by division by zero in analyzer

Patch by takeshi-yoshimura!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240643 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTeach Clang about the PPC64 memory sanitizer implementation.
Jay Foad [Thu, 25 Jun 2015 10:35:19 +0000 (10:35 +0000)]
Teach Clang about the PPC64 memory sanitizer implementation.

Summary:
This is the Clang part of the PPC64 memory sanitizer implementation in
D10648.

Reviewers: kcc, eugenis, willschm, wschmidt, samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240628 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [Proto] Don't treat "operator" as keyword.
Daniel Jasper [Thu, 25 Jun 2015 08:38:46 +0000 (08:38 +0000)]
clang-format: [Proto] Don't treat "operator" as keyword.

Before:
  optional string operator= 1;

After:
  optional string operator = 1;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240624 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate darwin SDK version parsing to support OSX and simulator
Steven Wu [Thu, 25 Jun 2015 01:59:35 +0000 (01:59 +0000)]
Update darwin SDK version parsing to support OSX and simulator

This re-commits r226005 with a tweak. The origin attempt failed because
Darwin bot sets up SDKROOT and clang can deduce SDK version from them
after this patch. That broke many driver tests due to the change of
deployment target version. Now the tests should not complain after
r240574.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240619 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[UBSan] Allow to use -fsanitize=vptr only on Mac OS 10.9+
Alexey Samsonov [Thu, 25 Jun 2015 00:58:02 +0000 (00:58 +0000)]
[UBSan] Allow to use -fsanitize=vptr only on Mac OS 10.9+

See https://llvm.org/bugs/show_bug.cgi?id=23539 for why this
is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240618 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoConsolidate and unify initializer list deduction
Hubert Tong [Thu, 25 Jun 2015 00:25:49 +0000 (00:25 +0000)]
Consolidate and unify initializer list deduction

Summary:
This patch reduces duplication in the template argument deduction code
for handling deduction from initializer lists in a function call. This
extends the fix for PR12119 to also apply to the case where the
corresponding parameter is a trailing parameter pack.

Test Plan:
A test for deduction from nested initializer lists where the
corresponding parameter is a trailing parameter pack is added in
`clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp`.

Reviewers: fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240612 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Concepts] Parsing of requires-clause in template-declaration
Hubert Tong [Thu, 25 Jun 2015 00:23:39 +0000 (00:23 +0000)]
[Concepts] Parsing of requires-clause in template-declaration

Summary:
This change implements parse-only acceptance of the optional
requires-clause in a template-declaration. Diagnostic testing is added
for cases where the grammar is ambiguous with the expectation that the
longest token sequence which matches the syntax of a
constraint-expression is consumed without backtracking.

Reviewers: faisalv, fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240611 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] The bits set in the variable HW_FP could get unset
Ranjeet Singh [Wed, 24 Jun 2015 23:39:25 +0000 (23:39 +0000)]
[ARM] The bits set in the variable HW_FP could get unset
when iterating through the Features vector if we don't
keep track of what's already been set. This could lead to
the macro __ARM_FP getting the wrong value. This patch
fixes this issue by keeping track of the bits that have
already been set in the loop.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240607 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoupdate comment
Derek Schuff [Wed, 24 Jun 2015 22:36:38 +0000 (22:36 +0000)]
update comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240601 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRelax assertion in x86_64 byval argument handling for 32-bit pointers
Derek Schuff [Wed, 24 Jun 2015 22:36:36 +0000 (22:36 +0000)]
Relax assertion in x86_64 byval argument handling for 32-bit pointers

Summary:
Byval argument pair formation assumes that if a type is less than 8 bytes
it must be an integer and not a pointer, which is not true for x32 and NaCl.

Relax the assertion and add a test for a codegen case that triggered it.

Reviewers: jvoung

Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240600 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd __nonnull/__nullable/__null_unspecified predefines for Darwin.
Douglas Gregor [Wed, 24 Jun 2015 22:02:16 +0000 (22:02 +0000)]
Add __nonnull/__nullable/__null_unspecified predefines for Darwin.

Addresses the rest of rdar://problem/21530726.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240597 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace __double_underscored type nullability qualifiers with _Uppercase_underscored
Douglas Gregor [Wed, 24 Jun 2015 22:02:08 +0000 (22:02 +0000)]
Replace __double_underscored type nullability qualifiers with _Uppercase_underscored

Addresses a conflict with glibc's __nonnull macro by renaming the type
nullability qualifiers as follows:

  __nonnull -> _Nonnull
  __nullable -> _Nullable
  __null_unspecified -> _Null_unspecified

This is the major part of rdar://problem/21530726, but does not yet
provide the Darwin-specific behavior for the old names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240596 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove environment variables from driver tests
Steven Wu [Wed, 24 Jun 2015 19:30:36 +0000 (19:30 +0000)]
Remove environment variables from driver tests

Summary:
Remove some of dangerous environmental variables from clang/Driver tests.
Driver tests should not rely on preset value of these variables and may
actually fail because of them.
They cannot be removed in test/lit.cfg because we still need to support
relocatable SDKs and other overwrite for other clang tests.

Reviewers: bogner

Subscribers: rnk, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240574 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Preprocessor] Iterating over all macros should include those from modules.
Jordan Rose [Wed, 24 Jun 2015 19:27:02 +0000 (19:27 +0000)]
[Preprocessor] Iterating over all macros should include those from modules.

So, iterate over the list of macros mentioned in modules, and make sure those
are in the master table.

This isn't particularly efficient, but hopefully it's something that isn't
done too often.

PR23929 and rdar://problem/21480635

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240571 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Support regex literals containing quotes (' and ").
Daniel Jasper [Wed, 24 Jun 2015 16:01:02 +0000 (16:01 +0000)]
clang-format: [JS] Support regex literals containing quotes (' and ").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240548 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoExpress Driver::GetFilePath more concisely.
Douglas Katzman [Wed, 24 Jun 2015 15:10:30 +0000 (15:10 +0000)]
Express Driver::GetFilePath more concisely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240545 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSilencing some Sphinx warnings about duplicate explicit target names.
Aaron Ballman [Wed, 24 Jun 2015 12:11:04 +0000 (12:11 +0000)]
Silencing some Sphinx warnings about duplicate explicit target names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240536 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Codegen for 'depend' clause (OpenMP 4.0).
Alexey Bataev [Wed, 24 Jun 2015 11:01:36 +0000 (11:01 +0000)]
[OPENMP] Codegen for 'depend' clause (OpenMP 4.0).

If task directive has associated 'depend' clause then function kmp_int32 __kmpc_omp_task_with_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_task_t * new_task, kmp_int32 ndeps, kmp_depend_info_t *dep_list,kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called instead of __kmpc_omp_task().
If this directive has associated 'if' clause then also before a call of kmpc_omp_task_begin_if0() a function void __kmpc_omp_wait_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called.
Array sections are not supported yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240532 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove a limited and somewhat questionable DenseMapInfo specialization
Chandler Carruth [Wed, 24 Jun 2015 10:24:30 +0000 (10:24 +0000)]
Remove a limited and somewhat questionable DenseMapInfo specialization
for StringRef now that the core DenseMap library provides this facility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240530 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove the special-case check from r240462 into ARM-specific code.
Bob Wilson [Wed, 24 Jun 2015 06:05:20 +0000 (06:05 +0000)]
Move the special-case check from r240462 into ARM-specific code.

This fixes a serious bug in r240462: checking the BuiltinID for
ARM::BI_MoveToCoprocessor* in EmitBuiltinExpr() ignores the fact that
each target has an overlapping range of the BuiltinID values. That check
can trigger for builtins from other targets, leading to very bad
behavior.

Part of the reason I did not implement r240462 this way to begin with is
the special handling of the last argument for Neon builtins. In this
change, I have factored out the check to see which builtins have that
extra argument into a new HasExtraNeonArgument() function. There is still
some awkwardness in having to check for those builtins in two separate
places, i.e., once to see if the extra argument is present and once to
generate the appropriate IR, but this seems much cleaner than my previous
patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240522 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoProper changing/restoring for CapturedStmtInfo, NFC.
Alexey Bataev [Wed, 24 Jun 2015 03:35:38 +0000 (03:35 +0000)]
Proper changing/restoring for CapturedStmtInfo, NFC.

Added special RAII class for proper values changing/restoring in CodeGenFunction::CapturedStmtInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240517 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix test failure if this value doesn't end up named %0.
Richard Smith [Tue, 23 Jun 2015 23:13:31 +0000 (23:13 +0000)]
Fix test failure if this value doesn't end up named %0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240479 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse range-based loops when handling OPT_print_search_dirs.
Douglas Katzman [Tue, 23 Jun 2015 22:43:50 +0000 (22:43 +0000)]
Use range-based loops when handling OPT_print_search_dirs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240476 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSafeStack documentation improvements
Peter Collingbourne [Tue, 23 Jun 2015 22:24:45 +0000 (22:24 +0000)]
SafeStack documentation improvements

This patch makes the following improvements to the SafeStack documentation:

Explicitly states the security guarantees of the SafeStack
Clarifies which of the security guarantees are probabilistic
Re-orders security limitations to put the most severe ones first
Explains how `__attribute__((no_sanitize("safe-stack")))` works and how to use it safely
Explains that SafeStack should be combined with a forward-edge protection mechanism, such as CPI, IFCC or others
Multiple readability and stylistic improvements

Patch by Volodymyr Kuznetsov!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240472 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.
Benjamin Kramer [Tue, 23 Jun 2015 21:15:15 +0000 (21:15 +0000)]
[Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.

This is consistent with all other classes in Tools.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240464 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImprove error handling for PR22560.
Bob Wilson [Tue, 23 Jun 2015 21:10:24 +0000 (21:10 +0000)]
Improve error handling for PR22560.

The ARM _MoveToCoprocessor and _MoveFromCoprocessor builtins require
integer constants for most arguments, but clang was not checking that.
With this change, we now report meaningful errors instead of crashing
in the backend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240463 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22560: Fix argument order for ARM _MoveToCoprocessor builtins.
Bob Wilson [Tue, 23 Jun 2015 21:10:15 +0000 (21:10 +0000)]
PR22560: Fix argument order for ARM _MoveToCoprocessor builtins.

The Microsoft-extension _MoveToCoprocessor and _MoveToCoprocessor2
builtins take the register value to be moved as the first argument,
but the corresponding mcr and mcr2 LLVM intrinsics expect that value
to be the third argument. Handle this as a special case, while still
leaving those intrinsics as generic MSBuiltins. I considered the
alternative of handling these in EmitARMBuiltinExpr, but that does
not work well for the follow-up change that I'm going to make to improve
the error handling for PR22560 -- we need the GetBuiltinType() checks
for ICEArguments, and the ARM version of that code is only used for
Neon intrinsics where the last argument is special and not
checked in the normal way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240462 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPedantically rename all Tool subclasses to be nouns, not verbs. NFC
Douglas Katzman [Tue, 23 Jun 2015 20:42:09 +0000 (20:42 +0000)]
Pedantically rename all Tool subclasses to be nouns, not verbs. NFC

Classes in Tools.h inherit ultimately from Tool, which is a noun,
but subclasses of Tool were named for their operation, such as "Compile",
wherein the constructor call "Compile(args...)" could be misconstrued
as actually causing a compile to happen.

Likewise various other methods were not harmonious with their effect,
in that "BuildLinker()" returned a "new namespace::Link(...)"
instead of a "new namespace::Linker(...)" which it now does.

Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names.
And there is no particulary great way to name the "Lipo-er" and a few others.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240455 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Account for the virtual inheritance quirk when mangling
David Majnemer [Tue, 23 Jun 2015 20:34:18 +0000 (20:34 +0000)]
[MS ABI] Account for the virtual inheritance quirk when mangling

Virtual inheritance member pointers are always relative to the vbindex,
even when the member pointer doesn't point into a virtual base.  This is
corrected by adjusting the non-virtual offset backwards from the vbptr
back to the top of the most derived class.  While we performed this
adjustment when manifesting member pointers as constants or when
performing conversions, we didn't perform the adjustment when mangling
them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240453 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Fix a crash when an implicit def appears in a macro
Justin Bogner [Tue, 23 Jun 2015 20:29:09 +0000 (20:29 +0000)]
InstrProf: Fix a crash when an implicit def appears in a macro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240452 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake the typo resolution in r240441 apply to all function calls.
Kaelyn Takata [Tue, 23 Jun 2015 19:13:17 +0000 (19:13 +0000)]
Make the typo resolution in r240441 apply to all function calls.

Regular function calls (such as to cabs()) run into the same problem
with handling dependent exprs, not just builtins with custom type
checking.

Fixes PR23775.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240443 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEnsure delayed typos have been corrected in calls to builtins before
Kaelyn Takata [Tue, 23 Jun 2015 18:42:21 +0000 (18:42 +0000)]
Ensure delayed typos have been corrected in calls to builtins before
checking those calls when not in C++ mode, since those code paths can't
handle dependent exprs.

Fixes PR23740.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240441 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse AddString/ReadString instead of doing it manually NFC
Ben Langmuir [Tue, 23 Jun 2015 18:20:23 +0000 (18:20 +0000)]
Use AddString/ReadString instead of doing it manually NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240434 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Modules] Consider -fmodule-feature in module hash and when loading
Ben Langmuir [Tue, 23 Jun 2015 18:20:18 +0000 (18:20 +0000)]
[Modules] Consider -fmodule-feature in module hash and when loading

Any extra features from -fmodule-feature are part of the module hash and
need to get validated on load.  Also print them with -module-file-info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240433 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: Pass -I options to cc1as for .include search paths.
Jim Grosbach [Tue, 23 Jun 2015 18:20:13 +0000 (18:20 +0000)]
Driver: Pass -I options to cc1as for .include search paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240432 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdding a title to appease the sphinx build bot.
Aaron Ballman [Tue, 23 Jun 2015 17:31:30 +0000 (17:31 +0000)]
Adding a title to appease the sphinx build bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240430 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAttributeReference.rst is automatically generated by a server-side process currently...
Aaron Ballman [Tue, 23 Jun 2015 17:14:51 +0000 (17:14 +0000)]
AttributeReference.rst is automatically generated by a server-side process currently. To cut down on accidental commits to this file that are not properly reflected in AttrDocs.td (such as r215806 - r215808), this file now contains nothing but a comment explaining the current state of affairs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240428 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Initial support for 'depend' clause (4.0).
Alexey Bataev [Tue, 23 Jun 2015 14:25:19 +0000 (14:25 +0000)]
[OPENMP] Initial support for 'depend' clause (4.0).

Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240409 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate for LLVM api change.
Rafael Espindola [Tue, 23 Jun 2015 13:59:36 +0000 (13:59 +0000)]
Update for LLVM api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240406 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMoving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally...
Aaron Ballman [Tue, 23 Jun 2015 13:41:03 +0000 (13:41 +0000)]
Moving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally applied to the RST file that is automatically generated by the server, and so the changes were never properly reflected online once the server overwrote AttributeReference.rst.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240402 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixing a build bot break from r240400.
Aaron Ballman [Tue, 23 Jun 2015 13:29:33 +0000 (13:29 +0000)]
Fixing a build bot break from r240400.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240401 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoClarify pointer ownership semantics by hoisting the std::unique_ptr creation to the...
Aaron Ballman [Tue, 23 Jun 2015 13:15:32 +0000 (13:15 +0000)]
Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240400 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a warning. [-Wsign-compare]
NAKAMURA Takumi [Tue, 23 Jun 2015 10:01:20 +0000 (10:01 +0000)]
Fix a warning. [-Wsign-compare]

FIXME: Should "Level" be unsigned?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240391 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSilence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
Yaron Keren [Tue, 23 Jun 2015 09:45:42 +0000 (09:45 +0000)]
Silence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
not all control paths return a value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240389 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrite output file to temp directory. The tests shouldn't assume that
Daniel Jasper [Tue, 23 Jun 2015 09:26:37 +0000 (09:26 +0000)]
Write output file to temp directory. The tests shouldn't assume that
they can write to the current working directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240388 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe...
NAKAMURA Takumi [Tue, 23 Jun 2015 08:37:21 +0000 (08:37 +0000)]
Tweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe on newer version of Windows.

It seems "*.pcm" would be expanded with current directory by NTOS 6.x's msvcrt. GnuWin32 utils are affected.
To avoid the issue, put an expression that msvcrt's glob won't match, like "*.pc[m]".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240387 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Rework member pointer conversion
David Majnemer [Tue, 23 Jun 2015 07:31:11 +0000 (07:31 +0000)]
[MS ABI] Rework member pointer conversion

Member pointers in the MS ABI are made complicated due to the following:
- Virtual methods in the most derived class (MDC) might live in a
  vftable in a virtual base.
- There are four different representations of member pointer: single
  inheritance, multiple inheritance, virtual inheritance and the "most
  general" representation.
- Bases might have a *more* general representation than classes which
  derived from them, a most surprising result.

We believed that we could treat all member pointers as-if they were a
degenerate case of the multiple inheritance model.  This fell apart once
we realized that implementing standard member pointers using this ABI
requires referencing members with a non-zero vbindex.

On a bright note, all but the virtual inheritance model operate rather
similarly.  The virtual inheritance member pointer representation
awkwardly requires a virtual base adjustment in order to refer to
entities in the MDC.

However, the first virtual base might be quite far from the start of the
virtual base.  This means that we must add a negative non-virtual
displacement.

However, things get even more complicated.  The most general
representation interprets vbindex zero differently from the virtual
inheritance model: it doesn't reference the vbtable at all.

It turns out that this complexity can increase for quite some time:
consider a derived to base conversion from the most general model to the
multiple inheritance model...

To manage this complexity we introduce a concept of "normalized" member
pointer which allows us to treat all three models as the most general
model.  Then we try to figure out how to map this generalized member
pointer onto the destination member pointer model.  I've done my best to
furnish the code with comments explaining why each adjustment is
performed.

This fixes PR23878.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240384 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Refactor member pointer generation
David Majnemer [Tue, 23 Jun 2015 07:31:07 +0000 (07:31 +0000)]
[MS ABI] Refactor member pointer generation

The MS ABI has very complicated member pointers.  Don't attempt to
synthesize the final member pointer ab ovo usque ad mala in one go.

Instead, start with a member pointer which points to the declaration in
question as-if it's decl context was the target class.  Then, utilize
our conversion logical to convert it to the target type.

This allows us to simplify how we think about member pointers because we
don't need to consider non-zero nv adjustments before we even generate
the member pointer.  Furthermore, it gives our adjustment logic more
exposure by utilizing it in a common path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240383 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Rename EmitMemberPointer to EmitMemberFunctionPointer
David Majnemer [Tue, 23 Jun 2015 07:31:01 +0000 (07:31 +0000)]
[CodeGen] Rename EmitMemberPointer to EmitMemberFunctionPointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240382 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Do not emit references to original variables in 'private' clause.
Alexey Bataev [Tue, 23 Jun 2015 04:51:00 +0000 (04:51 +0000)]
[OPENMP] Do not emit references to original variables in 'private' clause.

Currently if the variable is captured in captured region, capture record for this region stores reference to this variable for future use. But we don't need to provide the reference to the original variable if it was explicitly marked as private in the 'private' clause of the OpenMP construct, this variable is replaced by private copy.
Differential Revision: http://reviews.llvm.org/D9550

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240377 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEliminate "enumeration value not handled in switch" warnings
Douglas Katzman [Tue, 23 Jun 2015 04:20:44 +0000 (04:20 +0000)]
Eliminate "enumeration value not handled in switch" warnings

(Caused by r240370)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240376 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoChange some if/else chains to 'switch' statements. NFC
Douglas Katzman [Tue, 23 Jun 2015 03:02:39 +0000 (03:02 +0000)]
Change some if/else chains to 'switch' statements. NFC

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240370 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r240270 ("Fixed/added namespace ending comments using clang-tidy").
Alexander Kornienko [Mon, 22 Jun 2015 23:07:51 +0000 (23:07 +0000)]
Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] When building a module, if there are multiple matches for a header
Richard Smith [Mon, 22 Jun 2015 22:20:47 +0000 (22:20 +0000)]
[modules] When building a module, if there are multiple matches for a header
file in the loaded module maps and one of them is from the current module,
that's the right match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240350 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate for LLVM API change to return by InputArgList directly (rather than by pointer...
David Blaikie [Mon, 22 Jun 2015 22:07:27 +0000 (22:07 +0000)]
Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240349 91177308-0d34-0410-b5e6-96231b3b80d8