]> granicus.if.org Git - clang/log
clang
9 years agoI took care of the build problem in the commit 250252.
Ekaterina Romanova [Wed, 14 Oct 2015 01:09:02 +0000 (01:09 +0000)]
I took care of the build problem in the commit 250252.
Resubmitting the patch.

This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

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

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

9 years agoreverting my patch, cause build problems
Ekaterina Romanova [Wed, 14 Oct 2015 00:03:20 +0000 (00:03 +0000)]
reverting my patch, cause build problems

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

9 years agoThis patch adds missing pieces to clang, including the PS4 toolchain
Ekaterina Romanova [Tue, 13 Oct 2015 23:40:02 +0000 (23:40 +0000)]
This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

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

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

9 years ago[Sema/objc] When checking for unimplemented methods treat methods from class extensio...
Argyrios Kyrtzidis [Tue, 13 Oct 2015 23:27:34 +0000 (23:27 +0000)]
[Sema/objc] When checking for unimplemented methods treat methods from class extensions as continuation of the class interface.

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

9 years ago[CMake]Getting rid of references to LLVM_SUBMIT_VERSION and LLVM_SUBMIT_SUBVERSION...
Chris Bieneman [Tue, 13 Oct 2015 23:03:54 +0000 (23:03 +0000)]
[CMake]Getting rid of references to LLVM_SUBMIT_VERSION and LLVM_SUBMIT_SUBVERSION in favor of LLVM_VERSION_MAJOR and LLVM_VERSION_MINOR.

LLVM_SUBMIT_VERSION and LLVM_SUBMIT_SUBVERSION are commonly used variable names in the autoconf build system. They seem to have leeched into clang's CMake in a few places, and should just be replaced by the LLVM_VERSION_* variables where appropriate.

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

9 years ago[analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods...
Devin Coughlin [Tue, 13 Oct 2015 22:20:52 +0000 (22:20 +0000)]
[analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)

Prevent invalidation of `this' when a method is const; fixing PR 21606.

A patch by Sean Eveson!

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

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

9 years agoMove the adc-builtins test to the pattern of the other builtins
Eric Christopher [Tue, 13 Oct 2015 18:40:21 +0000 (18:40 +0000)]
Move the adc-builtins test to the pattern of the other builtins
tests by predefining _MM_MALLOC_H rather than use -ffreestanding.

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

9 years agoAdd subtarget feature support for 3dnowa to the 3dnowa intrinsics.
Eric Christopher [Tue, 13 Oct 2015 18:40:17 +0000 (18:40 +0000)]
Add subtarget feature support for 3dnowa to the 3dnowa intrinsics.

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

9 years ago[CMake] When building clang as an external project we should pass through all variabl...
Chris Bieneman [Tue, 13 Oct 2015 18:17:30 +0000 (18:17 +0000)]
[CMake] When building clang as an external project we should pass through all variables that start with COMPILER_RT

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

9 years agoAlways pass a -dwarf-version argument to integrated as.
Douglas Katzman [Tue, 13 Oct 2015 16:22:51 +0000 (16:22 +0000)]
Always pass a -dwarf-version argument to integrated as.

This removes the default of 3 hidden in the assembler previously.

Fixes breakage caused by r249655, reported by vsukharev.

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

9 years ago[Driver] Use the parent_path of the clang executable as the default InstalledDir
Benjamin Kramer [Tue, 13 Oct 2015 15:19:32 +0000 (15:19 +0000)]
[Driver] Use the parent_path of the clang executable as the default InstalledDir

This is what most people want anyways. Clang -cc1's main() will override
this but for other tools this is the most sensible default and avoids
some work.

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

9 years ago[X86] Add XSAVE intrinsic family
Amjad Aboud [Tue, 13 Oct 2015 12:29:35 +0000 (12:29 +0000)]
[X86] Add XSAVE intrinsic family

Add intrinsics for the
  XSAVE instructions (XSAVE/XSAVE64/XRSTOR/XRSTOR64)
  XSAVEOPT instructions (XSAVEOPT/XSAVEOPT64)
  XSAVEC instructions (XSAVEC/XSAVEC64)
  XSAVES instructions (XSAVES/XSAVES64/XRSTORS/XRSTORS64)

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

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

9 years agoRemove unused diagnostic. NFC.
Benjamin Kramer [Tue, 13 Oct 2015 10:10:03 +0000 (10:10 +0000)]
Remove unused diagnostic. NFC.

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

9 years ago[X86] LLVM now prints XOP immediates as unsigned after r250147. Fix expected check...
Craig Topper [Tue, 13 Oct 2015 05:15:17 +0000 (05:15 +0000)]
[X86] LLVM now prints XOP immediates as unsigned after r250147. Fix expected check string accordingly.

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

9 years ago[modules] Improve error message on failed module load due to a missing file to
Richard Smith [Tue, 13 Oct 2015 01:26:26 +0000 (01:26 +0000)]
[modules] Improve error message on failed module load due to a missing file to
say which module file referenced the missing file.

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

9 years ago[modules] Allow the error on importing a C++ module within an extern "C"
Richard Smith [Tue, 13 Oct 2015 00:39:40 +0000 (00:39 +0000)]
[modules] Allow the error on importing a C++ module within an extern "C"
context (but otherwise at the top level) to be disabled, to support use of C++
standard library implementations that (legitimately) mark their <blah.h>
headers as being C++ headers from C libraries that wrap things in 'extern "C"'
a bit too enthusiastically.

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

9 years agoTweak clang/test/CodeGen/debug-prefix-map.c to appease win32 hosts.
NAKAMURA Takumi [Tue, 13 Oct 2015 00:38:06 +0000 (00:38 +0000)]
Tweak clang/test/CodeGen/debug-prefix-map.c to appease win32 hosts.

  !1 = !DIFile(filename: "/var/empty\5C<stdin>", directory: "E:\5Cllvm\5Cbuild\5Ccmake-ninja\5Ctools\5Cclang\5Ctest\5CCodeGen")

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

9 years ago[modules] Fix merging of __va_list_tag's implicit special member functions.
Richard Smith [Tue, 13 Oct 2015 00:23:25 +0000 (00:23 +0000)]
[modules] Fix merging of __va_list_tag's implicit special member functions.

We model predefined declarations as not being from AST files, but in most ways
they act as if they come from some implicit prebuilt module file imported
before all others. Therefore, if we see an update to the predefined 'struct
__va_list_tag' declaration (and we've already loaded any modules), it needs a
corresponding update record, even though it didn't technically come from an AST
file.

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

9 years ago[safestack] Driver link test for safestack on android.
Evgeniy Stepanov [Mon, 12 Oct 2015 23:50:19 +0000 (23:50 +0000)]
[safestack] Driver link test for safestack on android.

Safestack runtime should never be linked on Android targets because
it is implemented directly in libc. This is already the case, but
mostly by chance (collectSanitizerRuntimes would only link shared
sanitizer runtimes, and safestack has only a static one). Protect
this behavior with a test.

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

9 years agoAdd decayedType and hasDecayedType AST matchers
Matthias Gehre [Mon, 12 Oct 2015 21:46:07 +0000 (21:46 +0000)]
Add decayedType and hasDecayedType AST matchers

Summary: Add decayedType and hasDecayedType AST matchers

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agotest: change argument
Saleem Abdulrasool [Mon, 12 Oct 2015 21:19:30 +0000 (21:19 +0000)]
test: change argument

This failed on AArch64 due to the type mismatch using int instead of
__builtin_va_list.

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

9 years agotest: relax path matching for windows
Saleem Abdulrasool [Mon, 12 Oct 2015 21:19:27 +0000 (21:19 +0000)]
test: relax path matching for windows

The test failed on Windows due to use of \ as a path separator rather than /.

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

9 years agoAdd warning flags for #include_next and some nearby warnings.
Richard Smith [Mon, 12 Oct 2015 21:05:54 +0000 (21:05 +0000)]
Add warning flags for #include_next and some nearby warnings.

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

9 years agoParse and ignore #pragma runtime_checks in MS extensions mode (PR25138)
Hans Wennborg [Mon, 12 Oct 2015 20:47:58 +0000 (20:47 +0000)]
Parse and ignore #pragma runtime_checks in MS extensions mode (PR25138)

We already silently ignore the /RTC, which controls the same functionality.

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

9 years agoSupport Debug Info path remapping
Saleem Abdulrasool [Mon, 12 Oct 2015 20:21:08 +0000 (20:21 +0000)]
Support Debug Info path remapping

Add support for the `-fdebug-prefix-map=` option as in GCC.  The syntax is
`-fdebug-prefix-map=OLD=NEW`.  When compiling files from a path beginning with
OLD, change the debug info to indicate the path as start with NEW.  This is
particularly helpful if you are preprocessing in one path and compiling in
another (e.g. for a build cluster with distcc).

Note that the linearity of the implementation is not as terrible as it may seem.
This is normally done once per file with an expectation that the map will be
small (1-2) entries, making this roughly linear in the number of input paths.

Addresses PR24619.

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

9 years ago[Sema] Make `&function_with_enable_if_attrs` an error
George Burgess IV [Mon, 12 Oct 2015 19:57:04 +0000 (19:57 +0000)]
[Sema] Make `&function_with_enable_if_attrs` an error

This fixes a bug where one can take the address of a conditionally
enabled function to drop its enable_if guards. For example:

  int foo(int a) __attribute__((enable_if(a > 0, "")));
  int (*p)(int) = &foo;
  int result = p(-1); // compilation succeeds; calls foo(-1)

Overloading logic has been updated to reflect this change, as well.

Functions with enable_if attributes that are always true are still
allowed to have their address taken.

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

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

9 years ago[Sema] Don't emit multiple diags for one error
George Burgess IV [Mon, 12 Oct 2015 18:40:58 +0000 (18:40 +0000)]
[Sema] Don't emit multiple diags for one error

Fixed a bug where we'd emit multiple diagnostics if there was a problem
taking the address of an overloaded template function.

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

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

9 years ago[CMake] Bug 14109 - CMake build for compiler-rt should use just-built clang
Chris Bieneman [Mon, 12 Oct 2015 16:34:23 +0000 (16:34 +0000)]
[CMake] Bug 14109 - CMake build for compiler-rt should use just-built clang

Summary:
Many small improvements to LLVM_BUILD_EXTERNAL_COMPILER_RT.

* Works correctly with Ninja by working around CMake Bug 14771 (https://cmake.org/Bug/view.php?id=14771)
* Has install-compiler-rt target, and installs as part of the default install target
* Sets the install paths properly so that it matches the non-standalone build
* Only generate the test targets if(LLVM_INCLUDE_TESTS)

Reviewers: samsonov, Bigcheese

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

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

9 years ago[VFS] Let the user decide if they want path normalization.
Benjamin Kramer [Mon, 12 Oct 2015 16:16:39 +0000 (16:16 +0000)]
[VFS] Let the user decide if they want path normalization.

This is a more principled version of what I did earlier. Path
normalization is generally a good thing, but may break users in strange
environments, e. g. using lots of symlinks. Let the user choose and
default it to on.

This also changes adding a duplicated file into returning an error if
the file contents are different instead of an assertion failure.

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

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

9 years ago[Driver] Remove `else` after `return`
Simon Atanasyan [Mon, 12 Oct 2015 14:32:57 +0000 (14:32 +0000)]
[Driver] Remove `else` after `return`

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

9 years ago[VFS] Unbreak test.
Benjamin Kramer [Mon, 12 Oct 2015 13:39:33 +0000 (13:39 +0000)]
[VFS] Unbreak test.

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

9 years ago[VFS] Don't try to be heroic with '.' in paths.
Benjamin Kramer [Mon, 12 Oct 2015 13:30:38 +0000 (13:30 +0000)]
[VFS] Don't try to be heroic with '.' in paths.

Actually the only special path we have to handle is ./foo, the rest is
tricky to get right so do the same thing as the existing YAML vfs here.

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

9 years ago[VFS] remove handling of '..' for now.
Benjamin Kramer [Mon, 12 Oct 2015 09:22:07 +0000 (09:22 +0000)]
[VFS] remove handling of '..' for now.

This can fail badly if we're overlaying a real file system and there are
symlinks there. Just keep the path as-is for now.

This essentially reverts r249830.

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

9 years ago[ATTR] Automatic line feed after pragma-like attribute.
Alexey Bataev [Mon, 12 Oct 2015 06:59:48 +0000 (06:59 +0000)]
[ATTR] Automatic line feed after pragma-like attribute.
Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations.
Differential Revision: http://reviews.llvm.org/D13546

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

9 years agoclang-format: Fixed typecast getting put on a separate line from the
Daniel Jasper [Mon, 12 Oct 2015 03:19:07 +0000 (03:19 +0000)]
clang-format: Fixed typecast getting put on a separate line from the
key in Obj-C dictionary literals

This fixes: https://llvm.org/PR22647

Patch by Kent Sutherland. Thank you.

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

9 years agoclang-format: [JS] handle character classes in regexes.
Daniel Jasper [Mon, 12 Oct 2015 03:13:48 +0000 (03:13 +0000)]
clang-format: [JS] handle character classes in regexes.

Slashes in regular expressions do not need to be escaped and do not
terminate the regular expression even without a preceding backslash.

Patch by Martin Probst. Thank you.

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

9 years agobindings: add new C++ function attribute accessors
Saleem Abdulrasool [Mon, 12 Oct 2015 03:10:20 +0000 (03:10 +0000)]
bindings: add new C++ function attribute accessors

Add methods to index Cursor to see if a cxx method is pure_virtual,
virtual or const methods.

Patch by Jonathan B Coe!

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

9 years agoFix warning caused by r249995
George Burgess IV [Sun, 11 Oct 2015 20:37:14 +0000 (20:37 +0000)]
Fix warning caused by r249995

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

9 years ago[Sema] Allow C conversions in C overload logic
George Burgess IV [Sun, 11 Oct 2015 20:13:20 +0000 (20:13 +0000)]
[Sema] Allow C conversions in C overload logic

C allows for some implicit conversions that C++ does not, e.g. void* ->
char*. This patch teaches clang that these conversions are okay when
dealing with overloads in C.

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

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

9 years agoKeep the IfStmt node even if the condition is invalid
Olivier Goffart [Sun, 11 Oct 2015 17:27:29 +0000 (17:27 +0000)]
Keep the IfStmt node even if the condition is invalid

This is important to keep the information in IDE or other tools
even if the code contains a few errors

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

9 years ago[CMake] Always generate and install cmake config files on CMake>=3.0.
NAKAMURA Takumi [Sat, 10 Oct 2015 02:37:30 +0000 (02:37 +0000)]
[CMake] Always generate and install cmake config files on CMake>=3.0.

Currently, cmake config files are only generated and installed when CLANG_BUILD_STANDALONE set, which means config file will not be generated or installed when clang is built with llvm. This change removes that restriction.

Thanks to Don Hinton <hintonda@gmail.com>

http://reviews.llvm.org/D13453

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

9 years ago[Concepts] Fixing Concepts TS directory structure; NFC
Nathan Wilson [Sat, 10 Oct 2015 02:17:39 +0000 (02:17 +0000)]
[Concepts] Fixing Concepts TS directory structure; NFC

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

9 years agoFix inference of _Nullable for weak Objective-C properties.
Douglas Gregor [Fri, 9 Oct 2015 20:36:17 +0000 (20:36 +0000)]
Fix inference of _Nullable for weak Objective-C properties.

The inference of _Nullable for weak Objective-C properties was broken
in several ways:

* It was back-patching the type information very late in the process
  of checking the attributes for an Objective-C property, which is
  just wrong.
* It was using ad hoc checks to try to suppress the warning about
  missing nullability specifiers (-Wnullability-completeness), which
  didn't actual work in all cases (rdar://problem/22985457)
* It was inferring _Nullable even outside of assumes-nonnull regions,
  which is wrong.

Putting the inference of _Nullable for weak Objective-C properties in
the same place as all of the other inference logic fixes all of these
ills.

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

9 years agoAdd a fixme to handleTargetFeatures.
Eric Christopher [Fri, 9 Oct 2015 20:30:48 +0000 (20:30 +0000)]
Add a fixme to handleTargetFeatures.

The goal of wanting this to avoid munging the feature list is so
that it can be used for various targets as a way of both adding
and verifying the features that are going to be output into the
IR.

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

9 years ago[Myriad]: put libstdc++ and libc in the right order
Douglas Katzman [Fri, 9 Oct 2015 20:26:20 +0000 (20:26 +0000)]
[Myriad]: put libstdc++ and libc in the right order

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

9 years agoFix whitespace, 80-column violations, embedded tabs for the
Eric Christopher [Fri, 9 Oct 2015 18:39:59 +0000 (18:39 +0000)]
Fix whitespace, 80-column violations, embedded tabs for the
TargetInfo class.

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

9 years agoconstify the feature vector going into initFeatureMap as it shouldn't
Eric Christopher [Fri, 9 Oct 2015 18:39:55 +0000 (18:39 +0000)]
constify the feature vector going into initFeatureMap as it shouldn't
change the set of features.

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

9 years ago[CMake] Fixing LTO library path passed into bootstrap builds.
Chris Bieneman [Fri, 9 Oct 2015 17:45:44 +0000 (17:45 +0000)]
[CMake] Fixing LTO library path passed into bootstrap builds.

This just fixes a small error in constructing the path to the LTO library.

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

9 years agoAnalysis: Make CFG::graph_iterator dereference to non-const
Duncan P. N. Exon Smith [Fri, 9 Oct 2015 16:50:55 +0000 (16:50 +0000)]
Analysis: Make CFG::graph_iterator dereference to non-const

Since the original commit in r145858, we've had `CFG::graph_iterator`
and `CFG::const_graph_iterator`, and both have derefenced to a
`const`-ified `value_type`.  The former has an implicit conversion to
non-`const`, which is how this worked at all until r249782 started using
the dereference operator (partially reverted in r249783).

This fixes the non-const iterator to be non-const (sometimes
const-iterators are intentional, but with a separate const-ified class
(and a non-const implicit conversion leak) that's not likely to be the
case here).

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

9 years agoFix VFS GCC unittest on Windows
Reid Kleckner [Fri, 9 Oct 2015 16:48:52 +0000 (16:48 +0000)]
Fix VFS GCC unittest on Windows

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

9 years agoAmending r249721 to properly handle pathological attribute-related names like __...
Aaron Ballman [Fri, 9 Oct 2015 13:53:24 +0000 (13:53 +0000)]
Amending r249721 to properly handle pathological attribute-related names like __ and ____.

Patch by Adrian Zgorzalek!

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

9 years ago[VFS] Rename RedirectingFS internals to avoid collisions with public clang classes
Benjamin Kramer [Fri, 9 Oct 2015 13:28:13 +0000 (13:28 +0000)]
[VFS] Rename RedirectingFS internals to avoid collisions with public clang classes

Hopefully fixes the MSVC build. NFC intended.

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

9 years ago[VFS] Wire up driver VFS through tooling.
Benjamin Kramer [Fri, 9 Oct 2015 13:03:25 +0000 (13:03 +0000)]
[VFS] Wire up driver VFS through tooling.

Sadly I don't currently have a way to tests this as the driver is always
initialized with the default triple and finding system headers is system
specific.

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

9 years ago[VFS] Just normalize away .. and . in paths for in-memory file systems.
Benjamin Kramer [Fri, 9 Oct 2015 13:03:22 +0000 (13:03 +0000)]
[VFS] Just normalize away .. and . in paths for in-memory file systems.

This simplifies the code and gets us support for .. for free.

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

9 years ago[VFS] Wire up multilib toolchain code to the VFS.
Benjamin Kramer [Fri, 9 Oct 2015 13:03:18 +0000 (13:03 +0000)]
[VFS] Wire up multilib toolchain code to the VFS.

This lets a VFSified driver actually validate the GCC paths.

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

9 years ago[VFS] Port tooling to use the in-memory file system.
Benjamin Kramer [Fri, 9 Oct 2015 09:54:37 +0000 (09:54 +0000)]
[VFS] Port tooling to use the in-memory file system.

This means file remappings can now be managed by ClangTool (or a
ToolInvocation user) instead of by ToolInvocation itself. The
ToolInvocation remapping is still in place so users can migrate.

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

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

9 years ago[Sema] Add "Ty" suffix to QualType variables for clarity (NFC)
Vedant Kumar [Fri, 9 Oct 2015 01:47:26 +0000 (01:47 +0000)]
[Sema] Add "Ty" suffix to QualType variables for clarity (NFC)

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

9 years agoFix a few typos in the required feature set for some of the x86
Eric Christopher [Fri, 9 Oct 2015 00:35:30 +0000 (00:35 +0000)]
Fix a few typos in the required feature set for some of the x86
builtins:

avx512vd -> avx512vl
rdrand -> rdrnd
avx512ff -> avx512f

no functional change.

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

9 years agoSkip NonNull sema checks in unevaluated contexts.
Eric Fiselier [Fri, 9 Oct 2015 00:17:57 +0000 (00:17 +0000)]
Skip NonNull sema checks in unevaluated contexts.

Summary:
Currently when a function annotated with __attribute__((nonnull)) is called in an unevaluated context with a null argument a -Wnonnull warning is emitted.
This warning seems like a false positive unless the call expression is potentially evaluated. Change this behavior so that the non-null warnings use DiagRuntimeBehavior so they wont emit when they won't be evaluated.

Reviewers: majnemer, rsmith

Subscribers: mclow.lists, cfe-commits

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

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

9 years agoExpose -f[no]ms-{compatibility,extensions} in clang-cl (PR25114)
Hans Wennborg [Thu, 8 Oct 2015 23:13:28 +0000 (23:13 +0000)]
Expose -f[no]ms-{compatibility,extensions} in clang-cl (PR25114)

These are enabled by default in clang-cl, because the whole idea is that
it should work like cl.exe, but I suppose it can make sense to disable
them if someone wants to compile code in a more strict mode.

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

9 years agoUse Triple.isAndroid() where possible.
Evgeniy Stepanov [Thu, 8 Oct 2015 21:21:44 +0000 (21:21 +0000)]
Use Triple.isAndroid() where possible.

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

9 years ago[WinEH] Push cleanupendpad scopes around exceptional cleanups
Reid Kleckner [Thu, 8 Oct 2015 21:14:56 +0000 (21:14 +0000)]
[WinEH] Push cleanupendpad scopes around exceptional cleanups

We were only doing this for SEH as a special case. Generalize it to all
cleanups.

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

9 years ago[CodeGen] [CodeGen] Attach function attributes to functions created in
Akira Hatanaka [Thu, 8 Oct 2015 20:26:34 +0000 (20:26 +0000)]
[CodeGen] [CodeGen] Attach function attributes to functions created in
CGBlocks.cpp.

This commit fixes a bug in clang's code-gen where it creates the
following functions but doesn't attach function attributes to them:

__copy_helper_block_
__destroy_helper_block_
__Block_byref_object_copy_
__Block_byref_object_dispose_

rdar://problem/20828324

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

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

9 years agoHandle sse turning on mmx, but no -mmx not turning off SSE.
Eric Christopher [Thu, 8 Oct 2015 20:10:18 +0000 (20:10 +0000)]
Handle sse turning on mmx, but no -mmx not turning off SSE.

Rationale :

// sse3
__m128d test_mm_addsub_pd(__m128d A, __m128d B) {
  return _mm_addsub_pd(A, B);
}

// mmx
void shift(__m64 a, __m64 b, int c) {
  _mm_slli_pi16(a, c);
  _mm_slli_pi32(a, c);
  _mm_slli_si64(a, c);
  _mm_srli_pi16(a, c);
  _mm_srli_pi32(a, c);
  _mm_srli_si64(a, c);
  _mm_srai_pi16(a, c);
  _mm_srai_pi32(a, c);
}

clang -msse3 -mno-mmx file.c -c

For this code we should be able to explicitly turn off MMX
without affecting the compilation of the SSE3 function and then
diagnose and error on compiling the MMX function.

This is a preparatory patch to the actual diagnosis code which is
coming in a future patch. This sets us up to have the correct information
where we need it and verifies that it's being emitted for the backend
to handle.

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

9 years agoMigrate most feature map inclusion to initFeatureMap for the x86 target so
Eric Christopher [Thu, 8 Oct 2015 20:10:14 +0000 (20:10 +0000)]
Migrate most feature map inclusion to initFeatureMap for the x86 target so
that we can build up an accurate set of features rather than relying on
TargetInfo initialization via handleTargetFeatures to munge the list
of features.

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

9 years ago[CodeGen] Check if the Decl pointer passed is null, and if so, return
Akira Hatanaka [Thu, 8 Oct 2015 19:30:57 +0000 (19:30 +0000)]
[CodeGen] Check if the Decl pointer passed is null, and if so, return
early.

This is needed in a patch I plan to commit later, in which a null Decl
pointer is passed to SetLLVMFunctionAttributesForDefinition.

Relevant discussion is in http://reviews.llvm.org/D13525.

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

9 years agoWhen mapping no_sanitize_* attributes to no_sanitize attributes, handle GNU-style...
Aaron Ballman [Thu, 8 Oct 2015 19:24:08 +0000 (19:24 +0000)]
When mapping no_sanitize_* attributes to no_sanitize attributes, handle GNU-style formatting that involves prefix and suffix underscores. Cleans up other usages of similar functionality.

Patch by Adrian Zgorzalek!

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

9 years ago[clang-cl] Make /EHs turn on C++ EH once again
Reid Kleckner [Thu, 8 Oct 2015 17:29:07 +0000 (17:29 +0000)]
[clang-cl] Make /EHs turn on C++ EH once again

C++ exceptions are still off by default, which is similar to how C++
cleanups are off by default in MSVC.

If you use clang instead of clang-cl, exceptions are also still off by
default. In the future, when C++ EH is proven to be stable, we may flip
the default for that driver to be consistent with other platforms.

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

9 years agoSimplify DefaultCPU in ARMTargetInfo
Renato Golin [Thu, 8 Oct 2015 16:43:26 +0000 (16:43 +0000)]
Simplify DefaultCPU in ARMTargetInfo

Simplifying the convoluted CPU handling in ARMTargetInfo.

The default base CPU on ARM is ARM7TDMI, arch ARMv4T, and
ARMTargetInfo had a different one. This wasn't visible from
Clang because the driver selects the defaults and sets the
Arch/CPU features directly, but the constructor depended
on the CPU, which was never used.

This patch corrects the mistake and greatly simplifies
how CPU is dealt with (essentially by removing the duplicated
DefaultCPU field).

Tests updated.

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

9 years agoCGStmtOpenMP.cpp: Prune redundant \param. [-Wdocumentation]
NAKAMURA Takumi [Thu, 8 Oct 2015 16:41:42 +0000 (16:41 +0000)]
CGStmtOpenMP.cpp: Prune redundant \param. [-Wdocumentation]

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

9 years ago[VFS] Use VFS instead of virtual files in PPCallbacks test.
Benjamin Kramer [Thu, 8 Oct 2015 14:20:14 +0000 (14:20 +0000)]
[VFS] Use VFS instead of virtual files in PPCallbacks test.

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

9 years ago[Myriad]: default the Dwarf version to 2
Douglas Katzman [Thu, 8 Oct 2015 14:18:02 +0000 (14:18 +0000)]
[Myriad]: default the Dwarf version to 2

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

9 years ago[Driver] Use Twine instead of itostr. NFC.
Benjamin Kramer [Thu, 8 Oct 2015 10:31:17 +0000 (10:31 +0000)]
[Driver] Use Twine instead of itostr. NFC.

No need to construct temporary std::strings here.

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

9 years ago[MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enum
David Majnemer [Thu, 8 Oct 2015 10:04:46 +0000 (10:04 +0000)]
[MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enum

consider the following:
enum E *p;
enum E { e };

The above snippet is not ANSI C because 'enum E' has not bee defined
when we are processing the declaration of 'p'; however, it is a popular
extension to make the above work.  This would fail using the Microsoft
enum semantics because the definition of 'E' would implicitly have a
fixed underlying type of 'int' which would trigger diagnostic messages
about a mismatch between the declaration and the definition.

Instead, treat fixed underlying types as not fixed for the purposes of
the diagnostic.

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

9 years ago[OPENMP 4.1] Codegen for array sections/subscripts in 'reduction' clause.
Alexey Bataev [Thu, 8 Oct 2015 09:10:53 +0000 (09:10 +0000)]
[OPENMP 4.1] Codegen for array sections/subscripts in 'reduction' clause.
OpenMP 4.1 adds support for array sections/subscripts in 'reduction' clause. Patch adds codegen for this feature.

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

9 years agoUpdate a few more tests in response to the MS ABI enum semantics
David Majnemer [Thu, 8 Oct 2015 08:28:09 +0000 (08:28 +0000)]
Update a few more tests in response to the MS ABI enum semantics

Our self hosting buildbots found a few more tests which weren't updated
to reflect that the enum semantics are part of the Microsoft ABI.

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

9 years ago[Sema] Tweak incomplete enum types on MSVC ABI targets
David Majnemer [Thu, 8 Oct 2015 07:45:35 +0000 (07:45 +0000)]
[Sema] Tweak incomplete enum types on MSVC ABI targets

Enums without an explicit, fixed, underlying type are implicitly given a
fixed 'int' type for ABI compatibility with MSVC.  However, we can
enforce the standard-mandated rules on these types as-if we didn't know
this fact if the tag is not part of a definition.

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

9 years agoUpdate tests touched by r249656
David Majnemer [Thu, 8 Oct 2015 06:31:22 +0000 (06:31 +0000)]
Update tests touched by r249656

These test updates almost exclusively around the change in behavior
around enum: enums without a definition are considered incomplete except
when targeting MSVC ABIs.  Since these tests are interested in the
'incomplete-enum' behavior, restrict them to %itanium_abi_triple.

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

9 years agoUse itostr(), not std::to_string() because of Android.
Douglas Katzman [Thu, 8 Oct 2015 05:25:03 +0000 (05:25 +0000)]
Use itostr(), not std::to_string() because of Android.

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

9 years agoUnbreak 'debug-options' test when builder is Darwin
Douglas Katzman [Thu, 8 Oct 2015 05:02:24 +0000 (05:02 +0000)]
Unbreak 'debug-options' test when builder is Darwin

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

9 years ago[MSVC Compat] Enable ABI impacting non-conforming behavior independently of -fms...
David Majnemer [Thu, 8 Oct 2015 04:53:31 +0000 (04:53 +0000)]
[MSVC Compat] Enable ABI impacting non-conforming behavior independently of -fms-compatibility

No ABI for C++ currently makes it possible to implement the standard
100% perfectly.  We wrongly hid some of our compatible behavior behind
-fms-compatibility instead of tying it to the compiler ABI.

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

9 years agoStop messing with the 'g' group of options in CompilerInvocation.
Douglas Katzman [Thu, 8 Oct 2015 04:24:12 +0000 (04:24 +0000)]
Stop messing with the 'g' group of options in CompilerInvocation.

With this change, most 'g' options are rejected by CompilerInvocation.
They remain only as Driver options. The new way to request debug info
from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}"
and "-dwarf-version={2|3|4}". In the absence of a command-line option
to specify Dwarf version, the Toolchain decides it, rather than placing
Toolchain-specific logic in CompilerInvocation.

Also fix a bug in the Windows compatibility argument parsing
in which the "rightmost argument wins" principle failed.

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

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

9 years agoFix a -Wdeclaration-after-statement warning.
Craig Topper [Thu, 8 Oct 2015 03:37:36 +0000 (03:37 +0000)]
Fix a -Wdeclaration-after-statement warning.

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

9 years ago[WinEH] Remove NewMSEH and enable its behavior by default
Reid Kleckner [Thu, 8 Oct 2015 01:13:52 +0000 (01:13 +0000)]
[WinEH] Remove NewMSEH and enable its behavior by default

Testing has shown that it is at least as reliable as the old landingpad
pattern matching code.

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

9 years agoWhen pretty-printing a C++11 literal operator, don't insert whitespace between
Richard Smith [Thu, 8 Oct 2015 00:17:59 +0000 (00:17 +0000)]
When pretty-printing a C++11 literal operator, don't insert whitespace between
the "" and the suffix; that breaks names such as 'operator""if'. For symmetry,
also remove the space between the 'operator' and the '""'.

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

9 years agoDon't emit exceptional stackrestore cleanups around inalloca functions
Reid Kleckner [Thu, 8 Oct 2015 00:17:45 +0000 (00:17 +0000)]
Don't emit exceptional stackrestore cleanups around inalloca functions

The backend restores the stack pointer after recovering from an
exception.  This is similar to r245879, but it doesn't try to use the
normal cleanup mechanism, so hopefully it won't cause the same breakage.

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

9 years agoMake clang_Cursor_getMangling not mangle if the declaration isn't mangled
Ehsan Akhgari [Thu, 8 Oct 2015 00:01:20 +0000 (00:01 +0000)]
Make clang_Cursor_getMangling not mangle if the declaration isn't mangled

Right now clang_Cursor_getMangling will attempt to mangle any
declaration, even if the declaration isn't mangled (extern C).  This
results in a partially mangled name which isn't useful for much. This
patch makes clang_Cursor_getMangling return an empty string if the
declaration isn't mangled.

Patch by Michael Wu <mwu@mozilla.com>.

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

9 years ago[WinEH] Don't use lifetime markers for MS catch parameters
Reid Kleckner [Wed, 7 Oct 2015 21:03:41 +0000 (21:03 +0000)]
[WinEH] Don't use lifetime markers for MS catch parameters

We don't have a good place to put them. Our previous spot was causing us
to optimize loads from the exception object to undef, because it was
after the catchpad instruction that models the write to the catch
object.

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

9 years agoFix a shared CMake build by linking with libclangBasic.
Benjamin Kramer [Wed, 7 Oct 2015 20:19:25 +0000 (20:19 +0000)]
Fix a shared CMake build by linking with libclangBasic.

Patch by Jan Vesely!

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

9 years agoASTMatchers: Keep AllCallbacks in a set instead of a vector
Daniel Jasper [Wed, 7 Oct 2015 19:56:12 +0000 (19:56 +0000)]
ASTMatchers: Keep AllCallbacks in a set instead of a vector

AllCallbacks is currently only used to call onStartOfTranslationUnit and
onEndOfTranslationUnit on them. In this (and any other scenario I can
come up with), it is important (or at least better) not to have
duplicates in this container. E.g. currently onEndOfTranslationUnit is
called repeatedly on the same callback for every matcher that is
registered with it.

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

9 years agoclang-format: Add include sorting capabilities to sublime, emacs and
Daniel Jasper [Wed, 7 Oct 2015 17:00:20 +0000 (17:00 +0000)]
clang-format: Add include sorting capabilities to sublime, emacs and
clang-format-diff.py.

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

9 years ago[VFS] Port driver tool chains to VFS.
Benjamin Kramer [Wed, 7 Oct 2015 15:48:01 +0000 (15:48 +0000)]
[VFS] Port driver tool chains to VFS.

There are still some loose ends here but it's sufficient so we can detect
GCC headers that are inside of a VFS.

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

9 years agoclang-format: Fixed missing space between Obj-C for/in and a typecast.
Daniel Jasper [Wed, 7 Oct 2015 15:09:08 +0000 (15:09 +0000)]
clang-format: Fixed missing space between Obj-C for/in and a typecast.

Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504

TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but
not TT_ObjCForIn, so lines that look like:

  for (id nextObject in (NSArray *)myArray)

would incorrectly turn into:

  for (id nextObject in(NSArray *)myArray)

Patch by Kent Sutherland, thank you.

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

9 years ago[clang-format] Stop alignment sequences on open braces and parens when
Daniel Jasper [Wed, 7 Oct 2015 15:03:26 +0000 (15:03 +0000)]
[clang-format] Stop alignment sequences on open braces and parens when
aligning assignments.

This was done correctly when aligning the declarations, but not when
aligning assignments.

FIXME: The code between assignments and declarations alignment is
roughly duplicated and
would benefit from factorization.

Bug 25090: https://llvm.org/bugs/show_bug.cgi?id=25090

Patch by Beren Minor. Thank you.

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

9 years agoclang-format: Hopefully fix code blocks in docs.
Daniel Jasper [Wed, 7 Oct 2015 13:02:45 +0000 (13:02 +0000)]
clang-format: Hopefully fix code blocks in docs.

Otherwise I will have to install sphinx ;)..

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

9 years agoSilence warning about not being able to find clang-interpreter
Richard Barton [Wed, 7 Oct 2015 11:14:25 +0000 (11:14 +0000)]
Silence warning about not being able to find clang-interpreter

This binary is only built with the examples project, so only require it then.

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

9 years agoMake the test take input from stdin to prevent matching characters in a file path
Richard Barton [Wed, 7 Oct 2015 10:33:36 +0000 (10:33 +0000)]
Make the test take input from stdin to prevent matching characters in a file path

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

9 years agoFix crash in codegen on casting to `bool &`.
Alexey Bataev [Wed, 7 Oct 2015 10:22:08 +0000 (10:22 +0000)]
Fix crash in codegen on casting to `bool &`.
Currently codegen crashes trying to emit casting to bool &. It happens because bool type is converted to i1 and later then lvalue for reference is converted to i1*. But when codegen tries to load this lvalue it crashes trying to load value from this i1*.

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

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

9 years ago[VFS] Refactor VFSFromYAML a bit.
Benjamin Kramer [Wed, 7 Oct 2015 10:05:44 +0000 (10:05 +0000)]
[VFS] Refactor VFSFromYAML a bit.

- Rename it to RedirectingFileSystem. This is what it does, YAML is just a
  serialization format for it.
- Consistently use unique_ptr for memory management.

No functional change intended.

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

9 years ago[VFS] Also drop '.' when adding files to an in-memory FS.
Benjamin Kramer [Wed, 7 Oct 2015 08:32:50 +0000 (08:32 +0000)]
[VFS] Also drop '.' when adding files to an in-memory FS.

Otherwise we won't be able to find them later.

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