Hans Wennborg [Sun, 26 Oct 2014 19:39:46 +0000 (19:39 +0000)]
ModuleMap.cpp: fix VS2012 build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220644
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Sun, 26 Oct 2014 14:26:55 +0000 (14:26 +0000)]
Delete unused method and clangAST dependency it required.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220640
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 26 Oct 2014 13:12:35 +0000 (13:12 +0000)]
ModuleMap::addHeader(): Appease msc17.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220639
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 25 Oct 2014 23:33:21 +0000 (23:33 +0000)]
Driver: reduce search logic duplication
Refactor the path search into a helper function to avoid duplicating the path
handling for the search. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220628
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 25 Oct 2014 20:49:12 +0000 (20:49 +0000)]
test: attempt to make test more hermetic
Add a fake linker in to a sysroot to use for testing the driver's tool
invocation. Should make the test behave similarly on all platforms. Addresses
review comments from Reid Kleckner from SVN r220546.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220625
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 25 Oct 2014 20:48:35 +0000 (20:48 +0000)]
Driver: assume that all architectures are supported for libstc++
Rather than asserting that the target is unsupported, make a guess at what the
tree for a port would look like and use that for the search path.
Addresses review comments from Ried Kleckner for SVN r220547.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220624
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 25 Oct 2014 11:40:40 +0000 (11:40 +0000)]
Lex: Fix an invalid access into a SmallString
We would crash because we used operator[] to access past the end of a
SmallString. This occured because our token had length zero.
Instead, form the pointer using .data() and arithmetic. This is safe
because this forms a one-past-the-end pointer and it is only used to
compare with another one-past-the-end pointer.
This fixes PR21379.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220614
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 25 Oct 2014 04:06:14 +0000 (04:06 +0000)]
Update for LLVM api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220609
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 25 Oct 2014 01:51:19 +0000 (01:51 +0000)]
Make this test a bit stricter by checking clang's output too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220604
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 24 Oct 2014 22:05:27 +0000 (22:05 +0000)]
CodeGen: Don't form weak dllexport aliases
The MS linker cannot do anything interesting with these, it doesn't make
sense to emit them.
This fixes PR21373.
Differential Revision: http://reviews.llvm.org/D5986
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220595
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 24 Oct 2014 21:23:49 +0000 (21:23 +0000)]
test: correct an overzealous search-and-replace
The temporary initialized is referenced as %0, not as the auto-release pool.
Fixes R+A tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220593
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 24 Oct 2014 20:23:43 +0000 (20:23 +0000)]
CodeGen: correct materialize temporary aggregates in ARC mode
Avoid an assertion when materializing a lifetime type aggregate temporary. When
performing CodeGen for ObjC++, we could generate a lifetime-only aggregate
temporary by using an initializer list (which is effectively an array). We
would reach through the temporary expression, fishing out the inner expression.
If this expression was a lifetime expression, we would attempt to emit this as a
scalar. This would eventually result in an assertion as the emission would
eventually assert that the expression being emitted has a scalar evaluation
kind.
Add a case to handle the aggregate expressions. Use the EmitAggExpr to emit the
aggregate expression rather than the EmitScalarInit.
Addresses PR21347.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220590
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 24 Oct 2014 20:23:01 +0000 (20:23 +0000)]
[modules] Support combining 'textual' with 'private'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220589
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 24 Oct 2014 20:22:57 +0000 (20:22 +0000)]
Itanium ABI: Template template parameters are usable as substitutions
Template template parameters weren't added to the list of substitutions.
This would make the substitution map contain inaccurate mappings,
leading to Clang violating the Itanium ABI and breaking compatibility
with GCC.
This fixes PR21351.
Differential Revision: http://reviews.llvm.org/D5959
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220588
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 24 Oct 2014 19:54:32 +0000 (19:54 +0000)]
CodeGen: trivial conversion to range based loop
Switch to a range-based for loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220587
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 24 Oct 2014 19:54:29 +0000 (19:54 +0000)]
test: add -std=c++11
This test uses C++11 features (r-value references) in ObjC++. Add a -std=c++11
to silence a warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220586
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 24 Oct 2014 19:49:04 +0000 (19:49 +0000)]
CodeGen: GLValue exprs in template parameters should have reference type
This fixes a corner-case where __uuidof as a template argument would
result in us trying to emit a GLValue as an RValue. This would lead to
a crash down the road.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220585
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Oct 2014 17:55:29 +0000 (17:55 +0000)]
Fix windows-cross.c test on my machine
I suspect it will need a custom sysroot to pass reliably elsewhere.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220576
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Oct 2014 17:42:17 +0000 (17:42 +0000)]
Add frontend support for __vectorcall
Wire it through everywhere we have support for fastcall, essentially.
This allows us to parse the MSVC "14" CTP headers, but we will
miscompile them because LLVM doesn't support __vectorcall yet.
Reviewed By: Aaron Ballman
Differential Revision: http://reviews.llvm.org/D5808
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220573
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Pavlov [Fri, 24 Oct 2014 17:31:32 +0000 (17:31 +0000)]
Use enumerators instead of hardcoded integers when processing macro names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220572
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Oct 2014 16:31:42 +0000 (16:31 +0000)]
[Modules] Free modules that failed signature verification.
The control flow and ownership is weird enough so unique_ptr doesn't help here :(
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220569
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 24 Oct 2014 15:30:16 +0000 (15:30 +0000)]
[mips] Mark aggregate arguments passed in registers with the inreg attribute
Summary:
This allows us to easily identify them in the backend which in turn allows us
to handle them correctly for big-endian targets (where they must be shifted
into the upper bits of the register).
Depends on D5961
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: cfe-commits, theraven
Differential Revision: http://reviews.llvm.org/D5962
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220566
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 24 Oct 2014 14:42:42 +0000 (14:42 +0000)]
[mips] Promote all integral/enumeration types to the GPR width
Summary:
Ensure all integral/enumeration types are appropriately annotated with
signext/zeroext. In particular, i32 now has these attributes when using the
N32/N64 ABI. This paves the way for accurately representing the way the
N32/N64 ABI's promotes integer arguments to i64.
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: cfe-commits, theraven
Differential Revision: http://reviews.llvm.org/D5961
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220563
91177308-0d34-0410-b5e6-
96231b3b80d8
Olivier Goffart [Fri, 24 Oct 2014 13:52:55 +0000 (13:52 +0000)]
Fix initializing TypeOfTypeLoc
This fixes a crash in the RecursiveASTVisitor on such code
__typeof__(struct F*) var[invalid];
The UnderlyingTInfo of a TypeOfTypeLoc was left uninitialized when
created from ASTContext::getTrivialTypeSourceInfo
This lead to a crash in RecursiveASTVisitor when trying to access it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220562
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Oct 2014 13:29:21 +0000 (13:29 +0000)]
ASTMatchers: Peel off a layer of indirection from true matcher. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220560
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Oct 2014 13:29:15 +0000 (13:29 +0000)]
ASTMatchers: for-rangify loops. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220559
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Oct 2014 13:29:07 +0000 (13:29 +0000)]
Add arguments() to CXXConstructExpr so the same interface as with CallExpr can be used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220558
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 24 Oct 2014 13:19:19 +0000 (13:19 +0000)]
Report when a function-try-block does not return a value on all control paths. Fixed PR14620.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220557
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Fri, 24 Oct 2014 11:28:47 +0000 (11:28 +0000)]
[Thumb] Clang thinks "char" is signed when using a thumb triple
'char' is unsigned on all ARM and Thumb architectures. Clang gets this
right for ARM, and for thumb when using and arm triple and the -mthumb
option, but gets it wrong for thumb triples. This fixes that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220555
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 24 Oct 2014 08:44:01 +0000 (08:44 +0000)]
[CMake] clangRewrite: Roll back clangAST in libdeps, due to clang::Stmt::printPretty().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220549
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 24 Oct 2014 03:24:33 +0000 (03:24 +0000)]
Driver: add missed file from previous commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220547
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 24 Oct 2014 03:13:37 +0000 (03:13 +0000)]
Driver: add CrossWindowsToolChain
This is a very basic toolchain. It supports cross-compiling Windows (primarily
inspired by the WoA target). It is meant to use clang with the LLVM IAS and a
binutils ld-compatible interface for the linker (eventually to be lld). It does
not perform any "standard" GCC lookup, nor does it perform any special
adjustments given that it is expected to be used in an environment where the
user is using MSVCRT (and as such Visual Studio headers) and the Windows SDK.
The primary runtime library is expected to be compiler-rt and the C++
implementation to be libc++.
It also expects that a sysroot has been setup given the usual Unix semantics
(standard C headers in /usr/include, all the import libraries available in
/usr/lib). It also expects that an entry point stub is present in /usr/lib
(crtbegin.obj for executables, crtbeginS.obj for shared libraries).
The entry point stub is responsible for running any GNU constructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220546
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 24 Oct 2014 00:49:29 +0000 (00:49 +0000)]
Add a new -fmerge-functions -cc1 flag that enables function merging.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220543
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 23 Oct 2014 22:40:46 +0000 (22:40 +0000)]
Don't emit strong vtable definitions for imported classes with key functions (PR21355)
Clang would previously assert on the following code when targeting MinGW:
struct __declspec(dllimport) S {
virtual ~S();
};
S::~S() {}
Because ~S is a key function and the class is dllimport, we would try to emit a
strong definition of the vtable, with dllimport - which is a conflict. We
should not emit strong vtable definitions for imported classes.
Differential Revision: http://reviews.llvm.org/D5944
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220532
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 23 Oct 2014 22:20:11 +0000 (22:20 +0000)]
Driver: Include driver diagnostics when we --serialize-diagnostics
Currently, when --serialize-diagnostics is passed this only includes
the diagnostics from clang -cc1, and driver diagnostics are
dropped. This causes issues for tools that use the serialized
diagnostics, since stderr is lost and these diagnostics aren't seen at
all.
We handle this by merging the diagnostics from the CC1 process and the
driver diagnostics into a single file when the driver invokes CC1.
Fixes rdar://problem/
10585062
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220525
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Oct 2014 22:18:29 +0000 (22:18 +0000)]
[modules] Simplify reading of INPUT_FILE_OFFSETS record and make it robust against changes to record order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220524
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Oct 2014 22:12:14 +0000 (22:12 +0000)]
Factor out common checks from module map deserialization. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220521
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 23 Oct 2014 20:22:22 +0000 (20:22 +0000)]
clang-format: Fix incorrect space after "<".
Before:
bool a = 2 <::SomeFunction();
After:
bool a = 2 < ::SomeFunction();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220505
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 23 Oct 2014 19:47:36 +0000 (19:47 +0000)]
Remove code duplication and cut dependency from clangRewrite on
clangAST.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220502
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 23 Oct 2014 19:00:10 +0000 (19:00 +0000)]
patch to issue warning on comparing parameters with
nonnull attribute when comparison is always
true/false. Patch by Steven Wu with few fixes and minor
refactoring and adding tests by me. rdar://
18712242
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220496
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Thu, 23 Oct 2014 18:05:36 +0000 (18:05 +0000)]
Add a "signature" to AST files to verify that they haven't changed
Since the order of the IDs in the AST file (e.g. DeclIDs, SelectorIDs)
is not stable, it is not safe to load an AST file that depends on
another AST file that has been rebuilt since the importer was built,
even if "nothing changed". We previously used size and modtime to check
this, but I've seen cases where a module rebuilt quickly enough to foil
this check and caused very hard to debug build errors.
To save cycles when we're loading the AST, we just generate a random
nonce value and check that it hasn't changed when we load an imported
module, rather than actually hash the whole file.
This is slightly complicated by the fact that we need to verify the
signature inside addModule, since we might otherwise consider that a
mdoule is "OutOfDate" when really it is the importer that is out of
date. I didn't see any regressions in module load time after this
change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220493
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 16:39:49 +0000 (16:39 +0000)]
DebugInfo: Correctly describe the lexical decl context of static member variable definitions.
The previous IR representation used the non-lexical decl context, which
placed the definitions in the same scope as the declarations (ie: within
the class) - this was hidden by the fact that LLVM currently doesn't
respect the context of global variable definitions at all, and always
puts them at the top level (as direct children of the compile_unit).
Having the correct lexical scope improves source fidelity and simplify
backend global variable emission (with changes coming shortly).
Doing something similar for non-member global variables would help
simplify/cleanup things further (see FIXME in the commit) and provide
similar source fidelity benefits to the final debug info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220488
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Oct 2014 02:02:31 +0000 (02:02 +0000)]
Revert accidentally-committed files in r220460.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220461
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Oct 2014 02:01:19 +0000 (02:01 +0000)]
Refactor implementation of 'exclude header'.
This was not a real header role, and was never exposed to clients of ModuleMap.
Remove the enumeration value for it and track it as marking the header as
'known' rather than creating an extra KnownHeader entry that *every single*
client ignores.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220460
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Oct 2014 01:03:45 +0000 (01:03 +0000)]
Fix covered-switch warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220456
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 23 Oct 2014 00:46:10 +0000 (00:46 +0000)]
Revert r218541 - Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.
This is a sad thing to do, but all the alternatives look ugly.
Looks like there are legitimate cases when users may want to link
with sanitizer runtimes *and* -nodefaultlibs (and ensure they provide
replacements for system libraries). For example, this happens in libc++
test suite.
"-nodefaultlibs" is told to link only the libraries explicitly provided
by the user, and providing "-fsanitize=address" is a clear indication of
intention to link with ASan runtime.
We can't easily introduce analogue of "-print-libgcc-name": linking with
sanitizers runtimes is not trivial: some runtimes are split into several
archive libraries, which are required to be wrapped in
-whole-archive/-no-whole-archive.
If "-fsanitize=whatever" and "-nodefaultlibs" are provided, system library
dependencies of sanitizer runtimes (-lc/-ldl/-lpthread/-lrt) will *not* be
linked, and user would have to link them in manually. Note that this can
cause problems, as failing to provide "-lrt" might lead to crashes in runtime
during ASan initialization. But looks like we should bite this bullet.
See r218541 review thread for the discussion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220455
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 22 Oct 2014 23:57:14 +0000 (23:57 +0000)]
Update the documentation for API change to CreateASTConsumer the rest of the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220450
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 22 Oct 2014 23:52:04 +0000 (23:52 +0000)]
Test files I forgot to svn add in r220448.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220449
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 22 Oct 2014 23:50:56 +0000 (23:50 +0000)]
[modules] Add support for 'textual header' directives.
This allows a module to specify that it logically contains a file, but that
said file is non-modular and intended for textual inclusion. This allows
layering checks to work properly in the presence of such files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220448
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 22 Oct 2014 23:03:58 +0000 (23:03 +0000)]
Basic: Add ext_delete_void_ptr_operand to -Wdelete-incomplete
This fixes PR21340.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220442
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 22 Oct 2014 21:48:56 +0000 (21:48 +0000)]
Fix C++ compliance issue. string literals must be const char *
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220434
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 22 Oct 2014 21:08:43 +0000 (21:08 +0000)]
Parse: Ignore "long" and "short" in #pragma section
This fixes PR21337.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220429
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 22 Oct 2014 21:06:18 +0000 (21:06 +0000)]
Removing the setLBracLoc and setRBracLoc functions from CompoundStmt -- their only use was with the AST reader, and friendship can be used to handle that. Drive-by rename of "Brac" to "Brace" for the private data members. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220428
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Oct 2014 20:54:25 +0000 (20:54 +0000)]
Fix up attribute documentation links to MSDN in a nicer way
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220426
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 22 Oct 2014 20:40:43 +0000 (20:40 +0000)]
Make a good guess about where MSVC and Windows SDK libraries are for linking.
When a user has not configured a standard Visual Studio environment
by running vcvarsall, clang tries its best to find Visual Studio
include files and executables anyway. This patch makes clang also
try to find system and Windows SDK libraries for linking against,
as well.
Reviewed by: Hans Wennborg
Differential Revision: http://reviews.llvm.org/D5873
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220425
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 22 Oct 2014 20:40:28 +0000 (20:40 +0000)]
Resubmit "Improve Windows toolchain support for non-standard environments."
This resubmits change r220226. That change broke the chromium
build bots because chromium it ships an hermetic MSVC toolchain
that it expects clang to fallback to by finding it on the path.
This patch fixes the issue by bumping up the prioritization of PATH
when looking for MSVC binaries.
Reviewed by: Hans Wennborg, Reid Kleckner
Differential Revision: http://reviews.llvm.org/D5892
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220424
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 22 Oct 2014 20:33:24 +0000 (20:33 +0000)]
Create a documentation category for the new calling convention documentation. Drive-by fixing of duplicate target names from a previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220419
91177308-0d34-0410-b5e6-
96231b3b80d8
Samuel Benzaquen [Wed, 22 Oct 2014 20:31:05 +0000 (20:31 +0000)]
Add support for profiling the matchers used.
Summary:
Add support for profiling the matchers used.
This will be connected with clang-tidy to generate a report to determine
and debug slow checks.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5911
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220418
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Oct 2014 20:20:35 +0000 (20:20 +0000)]
Try to fix link errors in mingw cmake -DBUILD_SHARED_LIBS=ON
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220417
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Oct 2014 20:14:27 +0000 (20:14 +0000)]
Add documentation for calling convention attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220415
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Oct 2014 20:09:12 +0000 (20:09 +0000)]
Remove unused DiagnosticsEngine::NumErrorsSuppressed member.
Patch by Brad King!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220413
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 22 Oct 2014 19:54:16 +0000 (19:54 +0000)]
Correct importing of the type of a TemplateArgument
It's not clear how this would be tested - I imagine we should have an
ASTImporter test that RAVs the new AST and checks that all the elements
in it are from this ASTContext and not the foreign one... but I know
little about the ASTImporter and how/where that testing might be done.
(post-commit review feedback from Richard Smith on r219900)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220411
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 22 Oct 2014 19:34:33 +0000 (19:34 +0000)]
DebugInfo: Omit scopes in -gmlt to reduce metadata size (on disk and in memory)
I haven't done any actual impact analysis of this change as it's a
strict improvement, but I'd be curious to know how much it helps.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220408
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Wed, 22 Oct 2014 19:34:25 +0000 (19:34 +0000)]
Fixup for r220403: Use getFileLoc() instead of getSpellingLoc() in SanitizerBlacklist.
This also handles the case where function name (not its body)
is obtained from macro expansion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220407
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Wed, 22 Oct 2014 18:26:07 +0000 (18:26 +0000)]
SanitizerBlacklist: Use spelling location for blacklisting purposes.
When SanitizerBlacklist decides if the SourceLocation is blacklisted,
we need to first turn it into a SpellingLoc before fetching the filename
and scanning "src:" entries. Otherwise we will fail to fecth the
correct filename for function definitions coming from macro expansion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220403
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Oct 2014 17:50:19 +0000 (17:50 +0000)]
Reland r219810 "Fix late template parsing leak with incremental processing"
Original message:
Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing. Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed. Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.
Patch by Brad King!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220400
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Oct 2014 17:26:00 +0000 (17:26 +0000)]
MS ABI: Emit more canonical vbptr stores and loads
This eliminates some i8* GEPs and makes the IR that clang emits a bit
more canonical. More work is needed for vftables, but that isn't a clear
win so I plan to send it for review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220398
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Oct 2014 14:27:08 +0000 (14:27 +0000)]
Remove unused StmtVector& parameters from declaration parsing functions.
Patch by Eelis van der Weegen!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220387
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 22 Oct 2014 13:00:05 +0000 (13:00 +0000)]
Support using sample profiles with partial debug info (driver)
Summary:
When using a profile, we used to require the use -gmlt so that we could
get access to the line locations. This is used to match line numbers in
the input profile to the line numbers in the function's IR.
But this is actually not necessary. The driver can provide source
location tracking without the emission of debug information. In these
cases, the annotation 'llvm.dbg.cu' is missing from the IR, but the
actual line location annotations are still present.
This patch tells the driver to only emit source location tracking
when -fprofile-sample-use is present in the command line.
Reviewers: echristo, dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5888
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220383
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 22 Oct 2014 09:50:23 +0000 (09:50 +0000)]
clang-format: Fix tests after recent change to ObjC block formatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220376
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 22 Oct 2014 09:12:44 +0000 (09:12 +0000)]
clang-format: Use AllowShortBlocksOnASingleLine for ObjC blocks, too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220375
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 22 Oct 2014 09:01:12 +0000 (09:01 +0000)]
clang-format: Fix broken test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220374
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 22 Oct 2014 08:42:58 +0000 (08:42 +0000)]
clang-format: Fix incorrect trailing return arrow detection.
Before:
auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa -> f()) {}
After:
auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa->f()) {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220373
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 22 Oct 2014 05:21:59 +0000 (05:21 +0000)]
Fix style issue from r220363. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220370
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 22 Oct 2014 02:52:00 +0000 (02:52 +0000)]
Disable the uninitialized field warning in uninstantiated classes.
If a templated class is not instantiated, then the AST for it could be missing
some things that would throw the field checker off. Wait until specialization
before emitting these warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220363
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 22 Oct 2014 02:37:29 +0000 (02:37 +0000)]
Driver: rename Windows to MSVCToolChain
This renames the Windows toolchain to MSVCToolChain. This is a preparatory step
for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the
standard GCC toolchain lookup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220362
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 22 Oct 2014 02:05:46 +0000 (02:05 +0000)]
[modules] Initial support for explicitly loading .pcm files.
Implicit module builds are not well-suited to a lot of build systems. In
particular, they fare badly in distributed build systems, and they lead to
build artifacts that are not tracked as part of the usual dependency management
process. This change allows explicitly-built module files (which are already
supported through the -emit-module flag) to be explicitly loaded into a build,
allowing build systems to opt to manage module builds and dependencies
themselves.
This is only the first step in supporting such configurations, and it should
be considered experimental and subject to change or removal for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220359
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 22 Oct 2014 01:25:49 +0000 (01:25 +0000)]
<float.h>: Don't seek #include_next if -ffreestanding for targeting mingw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220356
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Oct 2014 23:01:04 +0000 (23:01 +0000)]
PR21327 / C++ DR1652 / C++ DR73: comparing a past-the-end pointer for one
complete object to a pointer to the start of another complete object does
not evaluate to the constant 'false'. All other comparisons between the
addresses of subobjects of distinct complete objects still do.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220343
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Oct 2014 22:21:41 +0000 (22:21 +0000)]
R600: Update for div_fmas intrinsic change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220339
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Oct 2014 21:15:18 +0000 (21:15 +0000)]
[modules] When building an injected-class-name type, we may have to insert it
into multiple merged classes' TypeForDecl slots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220331
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 21 Oct 2014 19:37:56 +0000 (19:37 +0000)]
Removing unused variable (assigned into, but never read from); NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220313
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 21 Oct 2014 19:24:06 +0000 (19:24 +0000)]
Follow-up commit to r211657 which introduced these macros, but not for MSVC. This turns out to break our freestanding tests on Windows when compiling in MSVC-compatible mode. It was decided (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
20141020/116942.html is the start of the thread) to support this as part of Clang's interface on all platforms.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220312
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 21 Oct 2014 19:20:21 +0000 (19:20 +0000)]
Treat -g1 as -gline-tables-only
-g1 on gcc (and also IBM's xlc) are documented to be very similar to
-gline-tables-only. Our -gline-tables-only might still be more verbose than -g1
on other compilers, but currently we treat -g1 as -g, and so we're producing
much more debug info at -g1 than everybody else. Treating -g1 as
-gline-tables-only brings us much closer to what everyone else is doing.
For more information, see the discussion on
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039649.html
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220311
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 21 Oct 2014 18:03:08 +0000 (18:03 +0000)]
Driver: Quote the command in crash reproduction scripts.
This fixes crash report generation when filenames have spaces. It also
removes an awkward workaround that quoted *some* arguments when
generating crash reports.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220307
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 21 Oct 2014 17:24:44 +0000 (17:24 +0000)]
Driver: Move crash report command mangling into Command::Print
This pushes the logic for generating a crash reproduction script
entirely into Command::Print, instead of Command doing half of the
work and then relying on textual substitution for the rest. This makes
this logic much easier to read and will simplify fixing a couple of
issues in this area.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220305
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 21 Oct 2014 15:46:57 +0000 (15:46 +0000)]
The nodebug attribute has a C++11-style spelling supported by GCC as well. This modifies it so we support that spelling as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220297
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 21 Oct 2014 13:39:56 +0000 (13:39 +0000)]
Fixing the MSVC build by removing friendship with CodeGenFunction; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220293
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Yartsev [Tue, 21 Oct 2014 12:41:36 +0000 (12:41 +0000)]
[analyzer] Move the NewDeleteLeaks checker from CplusplusAlpha to Cplusplus package.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220289
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 11:34:53 +0000 (11:34 +0000)]
clang-format: [Java] Understand string literal concatenation.
Before:
String someString = "abc" + "cde";
After:
String someString = "abc"
+ "cde";
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220287
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 11:17:56 +0000 (11:17 +0000)]
clang-format: [Java] Fix formatting of multiple annotations.
Before:
@SuppressWarnings(value = "unchecked")
@Author(name = "abc") public void doSomething() {
}
After:
@SuppressWarnings(value = "unchecked")
@Author(name = "abc")
public void doSomething() {
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220286
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 11:13:31 +0000 (11:13 +0000)]
clang-format: [Java] Fix space in generic method calls.
Before:
A.<B>doSomething();
After:
A.<B>doSomething();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220285
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 10:58:14 +0000 (10:58 +0000)]
clang-format: [Java] Improve annotation handling.
Before:
@SuppressWarnings(
value = "
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii;
After:
@SuppressWarnings(value = "
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
public static int iiiiiiiiiiiiiiiiiiiiiiii;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220284
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 10:02:03 +0000 (10:02 +0000)]
clang-format: [Java] Make annotation formatting more consistent.
Before:
DoSomething(new A() {
@Override public String toString() {
}
});
After:
DoSomething(new A() {
@Override
public String toString() {
}
});
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220282
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 09:57:09 +0000 (09:57 +0000)]
clang-format: [Java] Improve generic support.
Before:
Iterable< ? > a;
Iterable< ? extends SomeObject > a;
After:
Iterable<?> a;
Iterable<? extends SomeObject> a;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220281
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 09:31:29 +0000 (09:31 +0000)]
clang-format: [Java] Support extending inner classes.
Before:
class A extends B
.C {}
After:
class A extends B.C {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220280
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 09:25:39 +0000 (09:25 +0000)]
clang-format: [Java] Support annotations with parameters.
Before:
@SuppressWarnings
(value = "unchecked") public void doSomething() { .. }
After:
@SuppressWarnings(value = "unchecked")
public void doSomething() { .. }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220279
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 21 Oct 2014 08:24:18 +0000 (08:24 +0000)]
clang-format: [Java] Wrap after each function annotation.
Before:
@Override public String toString() { .. }
After:
@Override
public String toString() { .. }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220274
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Astigeevich [Tue, 21 Oct 2014 08:16:42 +0000 (08:16 +0000)]
Test case B: fixed check rule
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220272
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Astigeevich [Tue, 21 Oct 2014 08:01:37 +0000 (08:01 +0000)]
Test case B is updated to work for 32-bit and 64-bit platforms
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220271
91177308-0d34-0410-b5e6-
96231b3b80d8