]> granicus.if.org Git - clang/log
clang
9 years agoModule Debugging: Emit debug type information into clang modules.
Adrian Prantl [Tue, 8 Sep 2015 19:20:27 +0000 (19:20 +0000)]
Module Debugging: Emit debug type information into clang modules.

When -fmodule-format is set to "obj", emit debug info for all types
declared in a module or referenced by a declaration into the module's
object file container.

This patch adds support for C and C++ types.

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

9 years agoFailing test highlighting no poisoning if dtor undeclared.
Naomi Musgrave [Tue, 8 Sep 2015 16:38:17 +0000 (16:38 +0000)]
Failing test highlighting no poisoning if dtor undeclared.

Summary:
If class or struct has not declared a destructor,
no destructor is emitted, and members are not poisoned
after destruction. This case highlights bug in current
implementation of use-after-dtor poisoning (detailed
in https://github.com/google/sanitizers/issues/596).

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

Only check simplest object for existence of sanitizing callback.

Rename test.

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

9 years agoFix performance regression when running clang tools.
Manuel Klimek [Tue, 8 Sep 2015 15:14:06 +0000 (15:14 +0000)]
Fix performance regression when running clang tools.

Brings tool start time for a large synthetic test case down from (on my
machine) 4 seconds to 0.5 seconds.

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

9 years agoclang/test/CodeGen/complex-convert.c: Appease for targeting powerpc64-*.
NAKAMURA Takumi [Tue, 8 Sep 2015 14:19:13 +0000 (14:19 +0000)]
clang/test/CodeGen/complex-convert.c: Appease for targeting powerpc64-*.

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

9 years agofindDominatingStoreToReturn in CGCall.cpp didn't check if a candidate store
Jakub Kuderski [Tue, 8 Sep 2015 10:36:42 +0000 (10:36 +0000)]
findDominatingStoreToReturn in CGCall.cpp didn't check if a candidate store
instruction used the ReturnValue as pointer operand or value operand. This
led to wrong code gen - in later stages (load-store elision code) the found
store and its operand would be erased, causing ReturnValue to become a <badref>.

The patch adds a check that makes sure that ReturnValue is a pointer operand of
store instruction. Regression test is also added.

This fixes PR24386.
Differential Revision: http://reviews.llvm.org/D12400

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

9 years agoUpdate code owners for AST matchers / libtooling.
Manuel Klimek [Tue, 8 Sep 2015 10:31:09 +0000 (10:31 +0000)]
Update code owners for AST matchers / libtooling.

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

9 years agoFix documentation of numSelectorArgs.
Manuel Klimek [Tue, 8 Sep 2015 10:11:26 +0000 (10:11 +0000)]
Fix documentation of numSelectorArgs.

Currently, the documentation for numSelectorArgs includes an incorrect
example. It shows a case where an argument of 1 will match a property
getter, but a getter will be matched only when N == 0.

This diff corrects the documentation and adds a test for numSelectorArgs(0).

Patch by Dave Lee.

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

9 years agoclangCodeGen: Fix comments. [-Wdocumentation]
NAKAMURA Takumi [Tue, 8 Sep 2015 09:42:41 +0000 (09:42 +0000)]
clangCodeGen: Fix comments. [-Wdocumentation]

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

9 years agoFix clang/test/CodeGen/mips-varargs.c for -Asserts, possibly typo.
NAKAMURA Takumi [Tue, 8 Sep 2015 09:37:09 +0000 (09:37 +0000)]
Fix clang/test/CodeGen/mips-varargs.c for -Asserts, possibly typo.

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

9 years agoAnother fix to this test, this one apparently working by
John McCall [Tue, 8 Sep 2015 09:33:33 +0000 (09:33 +0000)]
Another fix to this test, this one apparently working by
coincidence on all bots.

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

9 years agoFix clang/test/CodeGenCXX/alignment.cpp for -Asserts.
NAKAMURA Takumi [Tue, 8 Sep 2015 09:31:04 +0000 (09:31 +0000)]
Fix clang/test/CodeGenCXX/alignment.cpp for -Asserts.

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

9 years agoWhen building the alloca for a local variable, set its name
John McCall [Tue, 8 Sep 2015 09:18:30 +0000 (09:18 +0000)]
When building the alloca for a local variable, set its name
separately from building the instruction so that it's
preserved even in -Asserts builds.

Employ C++'s mystical "comment" feature to discourage
breaking this in the future.

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

9 years agoRemove unnecessary braces; this resolves against a
John McCall [Tue, 8 Sep 2015 08:57:00 +0000 (08:57 +0000)]
Remove unnecessary braces; this resolves against a
single-pointer overload instead of the ArrayRef one.

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

9 years agoMove BlockByrefHelpers back to CodeGenModule.h to placate MSVC.
John McCall [Tue, 8 Sep 2015 08:21:11 +0000 (08:21 +0000)]
Move BlockByrefHelpers back to CodeGenModule.h to placate MSVC.

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

9 years agoCompute and preserve alignment more faithfully in IR-generation.
John McCall [Tue, 8 Sep 2015 08:05:57 +0000 (08:05 +0000)]
Compute and preserve alignment more faithfully in IR-generation.

Introduce an Address type to bundle a pointer value with an
alignment.  Introduce APIs on CGBuilderTy to work with Address
values.  Change core APIs on CGF/CGM to traffic in Address where
appropriate.  Require alignments to be non-zero.  Update a ton
of code to compute and propagate alignment information.

As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment
helper function to CGF and made use of it in a number of places in
the expression emitter.

The end result is that we should now be significantly more correct
when performing operations on objects that are locally known to
be under-aligned.  Since alignment is not reliably tracked in the
type system, there are inherent limits to this, but at least we
are no longer confused by standard operations like derived-to-base
conversions and array-to-pointer decay.  I've also fixed a large
number of bugs where we were applying the complete-object alignment
to a pointer instead of the non-virtual alignment, although most of
these were hidden by the very conservative approach we took with
member alignment.

Also, because IRGen now reliably asserts on zero alignments, we
should no longer be subject to an absurd but frustrating recurring
bug where an incomplete type would report a zero alignment and then
we'd naively do a alignmentAtOffset on it and emit code using an
alignment equal to the largest power-of-two factor of the offset.

We should also now be emitting much more aggressive alignment
attributes in the presence of over-alignment.  In particular,
field access now uses alignmentAtOffset instead of min.

Several times in this patch, I had to change the existing
code-generation pattern in order to more effectively use
the Address APIs.  For the most part, this seems to be a strict
improvement, like doing pointer arithmetic with GEPs instead of
ptrtoint.  That said, I've tried very hard to not change semantics,
but it is likely that I've failed in a few places, for which I
apologize.

ABIArgInfo now always carries the assumed alignment of indirect and
indirect byval arguments.  In order to cut down on what was already
a dauntingly large patch, I changed the code to never set align
attributes in the IR on non-byval indirect arguments.  That is,
we still generate code which assumes that indirect arguments have
the given alignment, but we don't express this information to the
backend except where it's semantically required (i.e. on byvals).
This is likely a minor regression for those targets that did provide
this information, but it'll be trivial to add it back in a later
patch.

I partially punted on applying this work to CGBuiltin.  Please
do not add more uses of the CreateDefaultAligned{Load,Store}
APIs; they will be going away eventually.

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

9 years ago[analyzer] Apply whitespace cleanups by Honggyu Kim.
Ted Kremenek [Tue, 8 Sep 2015 03:50:52 +0000 (03:50 +0000)]
[analyzer] Apply whitespace cleanups by Honggyu Kim.

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

9 years ago[X86][SSE4A] Added SSE4A IR + assembly codegen builtin tests
Simon Pilgrim [Mon, 7 Sep 2015 20:10:11 +0000 (20:10 +0000)]
[X86][SSE4A] Added SSE4A IR + assembly codegen builtin tests

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

9 years ago[X86][SSSE3] Added SSSE3 IR + assembly codegen builtin tests
Simon Pilgrim [Sun, 6 Sep 2015 17:06:22 +0000 (17:06 +0000)]
[X86][SSSE3] Added SSSE3 IR + assembly codegen builtin tests

Transferred SSSE3 instructions from sse-builtins.c

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

9 years ago[X86]][SSE3] Added SSE41 IR + assembly codegen builtin tests
Simon Pilgrim [Sun, 6 Sep 2015 16:38:17 +0000 (16:38 +0000)]
[X86]][SSE3] Added SSE41 IR + assembly codegen builtin tests

Transferred SSE41 instructions from sse-builtins.c

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

9 years agoRefactoring of how ARMTargetInfo handles default target features.
Alexandros Lamprineas [Sun, 6 Sep 2015 16:15:45 +0000 (16:15 +0000)]
Refactoring of how ARMTargetInfo handles default target features.

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

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

9 years ago[X86]][SSE3] Added SSE3 IR + assembly codegen builtin tests
Simon Pilgrim [Sun, 6 Sep 2015 14:45:13 +0000 (14:45 +0000)]
[X86]][SSE3] Added SSE3 IR + assembly codegen builtin tests

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

9 years ago[X86]][SSE42] Added SSE42 IR + assembly codegen builtin tests
Simon Pilgrim [Sun, 6 Sep 2015 14:05:33 +0000 (14:05 +0000)]
[X86]][SSE42] Added SSE42 IR + assembly codegen builtin tests

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

9 years agoIndex: expose visibility attribute
Saleem Abdulrasool [Sat, 5 Sep 2015 18:53:43 +0000 (18:53 +0000)]
Index: expose visibility attribute

Expose the previously unexposed visibility attribute via the python and C
bindings.

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

9 years agoFix a bug in __builtin_object_size cast removal
George Burgess IV [Fri, 4 Sep 2015 22:36:18 +0000 (22:36 +0000)]
Fix a bug in __builtin_object_size cast removal

Apparently there are many cast kinds that may cause implicit pointer
arithmetic to happen. In light of this, the cast ignoring logic
introduced in r246877 has been changed to only ignore a small set of
cast kinds, and a test for this behavior has been added.

Thanks to Richard for catching this before it became a bug report. :)

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

9 years agoRelax partial-init test case for ARM
Reid Kleckner [Fri, 4 Sep 2015 22:32:51 +0000 (22:32 +0000)]
Relax partial-init test case for ARM

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

9 years agoDon't crash on a self-alias declaration
Hal Finkel [Fri, 4 Sep 2015 21:49:21 +0000 (21:49 +0000)]
Don't crash on a self-alias declaration

We were crashing in CodeGen given input like this:

  int self_alias(void) __attribute__((weak, alias("self_alias")));

such a self-alias is invalid, but instead of diagnosing the situation, we'd
proceed to produce IR for both the function declaration and the alias. Because
we already had a function named 'self_alias', the alias could not be named the
same thing, and so LLVM would pick a different name ('self_alias1' for example)
for that value. When we later called CodeGenModule::checkAliases, we'd look up
the IR value corresponding to the alias name, find the function declaration
instead, and then assert in a cast to llvm::GlobalAlias. The easiest way to prevent
this is simply to avoid creating the wrongly-named alias value in the first
place and issue the diagnostic there (instead of in checkAliases). We detect a
related cycle case in CodeGenModule::EmitAliasDefinition already, so this just
adds a second such check.

Even though the other test cases for this 'alias definition is part of a cycle'
diagnostic are in test/Sema/attr-alias-elf.c, I've added a separate regression
test for this case. This is because I can't add this check to
test/Sema/attr-alias-elf.c without disturbing the other test cases in that
file. In order to avoid construction of the bad IR values, this diagnostic
is emitted from within CodeGenModule::EmitAliasDefinition (and the relevant
declaration is not added to the Aliases vector). The other cycle checks are
done within the CodeGenModule::checkAliases function based on the Aliases
vector, called from CodeGenModule::Release.  However, if there have been errors
earlier, HandleTranslationUnit does not call Release, and so checkAliases is
never called, and so none of the other diagnostics would be produced.

Fixes PR23509.

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

9 years agoFix crash on invalid if we can't find a suitable PCH file in a specified
Richard Smith [Fri, 4 Sep 2015 21:44:32 +0000 (21:44 +0000)]
Fix crash on invalid if we can't find a suitable PCH file in a specified
directory, and our frontend action cares whether the frontend setup actually
succeeded.

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

9 years agoDon't use unreachable as a placeholder, it confuses EmitBlock
Reid Kleckner [Fri, 4 Sep 2015 21:39:15 +0000 (21:39 +0000)]
Don't use unreachable as a placeholder, it confuses EmitBlock

This fixes an issue raised in D12412, where we generated invalid IR.

Thanks to Vedant Kumar for coming up with the initial work around.

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

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

9 years agoIncrease accuracy of __builtin_object_size.
George Burgess IV [Fri, 4 Sep 2015 21:28:13 +0000 (21:28 +0000)]
Increase accuracy of __builtin_object_size.

Improvements:

- For all types, we would give up in a case such as:
    __builtin_object_size((char*)&foo, N);
  even if we could provide an answer to
    __builtin_object_size(&foo, N);
  We now provide the same answer for both of the above examples in all
  cases.

- For type=1|3, we now support subobjects with unknown bases, as long
  as the designator is valid.

Thanks to Richard Smith for the review + design planning.

Review: http://reviews.llvm.org/D12169

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

9 years agoDon't allow dllexport/import on static local variables
Hans Wennborg [Fri, 4 Sep 2015 19:59:39 +0000 (19:59 +0000)]
Don't allow dllexport/import on static local variables

They might technically have external linkage, but it still doesn't make sense
for the user to try and export such variables. This matches MSVC's and MinGW's
behaviour.

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

9 years agoFixing a bug where hasType(decl()) would fail to match on C code involving structs...
Aaron Ballman [Fri, 4 Sep 2015 18:34:48 +0000 (18:34 +0000)]
Fixing a bug where hasType(decl()) would fail to match on C code involving structs or unions.

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

9 years agoPut ext_implicit_lib_function_decl in ImplicitFunctionDeclare.
Ed Schouten [Fri, 4 Sep 2015 16:07:39 +0000 (16:07 +0000)]
Put ext_implicit_lib_function_decl in ImplicitFunctionDeclare.

If we build with -Werror=implicit-function-declaration, only implicit
function declarations of non-library functions throw compiler errors.
For library functions, we only produce a warning. There is no way to
promote both of these cases to an error without promoting other
warnings.

It makes little sense to introduce an additional compiler flag just to
control this specific warning. In my opinion it should just be part of
the same group.

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

9 years ago[OPENMP] Fix false diagnostic on instantiation-dependent exprs for atomic constructs.
Alexey Bataev [Fri, 4 Sep 2015 12:55:50 +0000 (12:55 +0000)]
[OPENMP] Fix false diagnostic on instantiation-dependent exprs for atomic constructs.
Some of instantiation-dependent expressions could cause false diagnostic to be emitted about unsupported atomic constructs. Relaxed rules for detection of incorrect expressions.

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

9 years agoclang/test/SemaCXX/sourceranges.cpp: Fix silly expressions. Sorry for the breakage.
NAKAMURA Takumi [Fri, 4 Sep 2015 11:49:36 +0000 (11:49 +0000)]
clang/test/SemaCXX/sourceranges.cpp: Fix silly expressions. Sorry for the breakage.

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

9 years agoclang/test/SemaCXX/sourceranges.cpp: Appease win32. Class method is thiscall for...
NAKAMURA Takumi [Fri, 4 Sep 2015 11:40:31 +0000 (11:40 +0000)]
clang/test/SemaCXX/sourceranges.cpp: Appease win32. Class method is thiscall for targeting i686-(msvc|mingw32).

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

9 years ago[OPENMP] Fix for http://llvm.org/PR24674: assertion failed and and abort trap
Alexey Bataev [Fri, 4 Sep 2015 11:26:21 +0000 (11:26 +0000)]
[OPENMP] Fix for http://llvm.org/PR24674: assertion failed and and abort trap
Fix processing of shared variables with reference types in OpenMP constructs. Previously, if the variable was not marked in one of the private clauses, the reference to this variable was emitted incorrectly and caused an assertion later.

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

9 years agoFix the perentheses location when the constructor is called on a class that has a...
Olivier Goffart [Fri, 4 Sep 2015 10:17:10 +0000 (10:17 +0000)]
Fix the perentheses location when the constructor is called on a class that has a destructor

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

9 years agoFix a couple of \param(s) in r246815. [-Wdocumentation]
NAKAMURA Takumi [Fri, 4 Sep 2015 05:19:31 +0000 (05:19 +0000)]
Fix a couple of \param(s) in r246815. [-Wdocumentation]

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

9 years agoCleanups, no functionality change.
Richard Smith [Fri, 4 Sep 2015 04:09:21 +0000 (04:09 +0000)]
Cleanups, no functionality change.

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

9 years ago[X86-64] Allow additional register names in inline assembler.
Alexey Bataev [Fri, 4 Sep 2015 03:42:23 +0000 (03:42 +0000)]
[X86-64] Allow additional register names in inline assembler.
Patch allows to recognize additional registers x8d, x8b, x8w - x15d, x15b, x15w in inline assembler, already recognized by backend
Differential Revision: http://reviews.llvm.org/D12594

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

9 years agoFix a potential APInt memory leak when using __attribute__((flag_enum)), and
Richard Smith [Fri, 4 Sep 2015 01:03:03 +0000 (01:03 +0000)]
Fix a potential APInt memory leak when using __attribute__((flag_enum)), and
simplify the implementation a bit.

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

9 years agoUntabify.
Eric Christopher [Fri, 4 Sep 2015 00:15:47 +0000 (00:15 +0000)]
Untabify.

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

9 years ago[Static Analyzer] Remove sinks from nullability checks.
Gabor Horvath [Thu, 3 Sep 2015 23:16:21 +0000 (23:16 +0000)]
[Static Analyzer] Remove sinks from nullability checks.

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

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

9 years agoRefactored dtor sanitizing into EHScopeStack
Naomi Musgrave [Thu, 3 Sep 2015 23:02:30 +0000 (23:02 +0000)]
Refactored dtor sanitizing into EHScopeStack

Summary:
Dtor sanitization handled amidst other dtor cleanups,
between cleaning bases and fields. Sanitizer call pushed onto
stack of cleanup operations.

Reviewers: eugenis, kcc

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

Refactoring dtor sanitizing emission order.

- Support multiple inheritance by poisoning after
 member destructors are invoked, and before base
 class destructors are invoked.
- Poison for virtual destructor and virtual bases.
- Repress dtor aliasing when sanitizing in dtor.
- CFE test for dtor aliasing, and repression of aliasing in dtor
 code generation.
- Poison members on field-by-field basis, with collective poisoning
 of trivial members when possible.
- Check msan flags and existence of fields, before dtor sanitizing,
 and when determining if aliasing is allowed.
- Testing sanitizing bit fields.

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

9 years ago[WebAssembly] Initial WebAssembly support in clang
Dan Gohman [Thu, 3 Sep 2015 22:51:53 +0000 (22:51 +0000)]
[WebAssembly] Initial WebAssembly support in clang

This implements basic support for compiling (though not yet assembling
or linking) for a WebAssembly target. Note that ABI details are not yet
finalized, and may change.

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

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

9 years agoThread safety analysis: the NO_THREAD_SAFETY_ANALYSIS attribute will now
DeLesley Hutchins [Thu, 3 Sep 2015 21:14:22 +0000 (21:14 +0000)]
Thread safety analysis: the NO_THREAD_SAFETY_ANALYSIS attribute will now
disable checking of arguments to the function, which is done by
-Wthread-safety-reference.

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

9 years agoAdd target flag to clang-cl invocation in this test.
Alexey Samsonov [Thu, 3 Sep 2015 20:53:14 +0000 (20:53 +0000)]
Add target flag to clang-cl invocation in this test.

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

9 years agoFix PR23472þ by emitting initialized variable and its guard in the same COMDAT only...
Yaron Keren [Thu, 3 Sep 2015 20:33:29 +0000 (20:33 +0000)]
Fix PR23472þ by emitting initialized variable and its guard in the same COMDAT only for ELF objects.

 http://llvm.org/pr23472

Reviewed by Reid Kleckner.

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

9 years agoAdd -target flag to Clang invocations in this test.
Alexey Samsonov [Thu, 3 Sep 2015 19:11:42 +0000 (19:11 +0000)]
Add -target flag to Clang invocations in this test.

ASan may not be supported for the default target triple.

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

9 years ago[libclang] Return deduced type for auto type, not the one written in the source.
Manuel Klimek [Thu, 3 Sep 2015 16:11:10 +0000 (16:11 +0000)]
[libclang] Return deduced type for auto type, not the one written in the source.

It used to work, but was accidentally broken by r179769.
The issue with decayed types was fixed by r190796.
So this patch partially reverts r179769, and adds more tests.

This also fixes PR 18669.

Patch by Sergey Kalinichev.

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

9 years agoImplement ACLE 2.0 macros of chapters 6.4 and 6.5 for [ARM] and [Aarch64] targets.
Alexandros Lamprineas [Thu, 3 Sep 2015 14:40:57 +0000 (14:40 +0000)]
Implement ACLE 2.0 macros of chapters 6.4 and 6.5 for [ARM] and [Aarch64] targets.
Differential Revision: http://reviews.llvm.org/D12244

Change-Id: Iffd4e822c15e18668fe8868278230ff232ef50aa

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

9 years ago[mips] Added support for choosing between traps and breaks in the integrated assemble...
Daniel Sanders [Thu, 3 Sep 2015 12:58:39 +0000 (12:58 +0000)]
[mips] Added support for choosing between traps and breaks in the integrated assembler macros.

Summary: The command line options for these are -Wa,--trap and -Wa,--break.

Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: llvm-commits

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

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

9 years ago[ARM] Allow passing/returning of __fp16 arguments
Oliver Stannard [Thu, 3 Sep 2015 12:40:58 +0000 (12:40 +0000)]
[ARM] Allow passing/returning of __fp16 arguments

The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be
used as a functon argument or return type (ACLE 1.1 did not).

The current public release of the AAPCS (2.09) states that __fp16 values
should be converted to single-precision before being passed or returned,
but AAPCS 2.10 (to be released shortly) changes this, so that they are
passed in the least-significant 16 bits of either a GPR (for base AAPCS)
or a single-precision register (for AAPCS-VFP). This does not change how
arguments are passed if they get passed on the stack.

This patch brings clang up to compliance with the latest versions of
both of these specs.

We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always
been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support
the alternative format).

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

9 years agoRevert 246755 as it breaks buildbots
Oliver Stannard [Thu, 3 Sep 2015 11:46:24 +0000 (11:46 +0000)]
Revert 246755 as it breaks buildbots

Original commit message:
[ARM] Allow passing/returning of __fp16 arguments

The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be
used as a functon argument or return type (ACLE 1.1 did not).

The current public release of the AAPCS (2.09) states that __fp16 values
should be converted to single-precision before being passed or returned,
but AAPCS 2.10 (to be released shortly) changes this, so that they are
passed in the least-significant 16 bits of either a GPR (for base AAPCS)
or a single-precision register (for AAPCS-VFP). This does not change how
arguments are passed if they get passed on the stack.

This patch brings clang up to compliance with the latest versions of
both of these specs.

We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always
been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support
the alternative format).

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

9 years ago[OPENMP] Fix for http://llvm.org/PR24687: ICE on compilation of R package TPmsm.
Alexey Bataev [Thu, 3 Sep 2015 10:21:46 +0000 (10:21 +0000)]
[OPENMP] Fix for http://llvm.org/PR24687: ICE on compilation of R package TPmsm.
Fixed capturing of VLAs in 'private' clause of the OpenMP directives.

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

9 years ago[ARM] Allow passing/returning of __fp16 arguments
Oliver Stannard [Thu, 3 Sep 2015 09:34:53 +0000 (09:34 +0000)]
[ARM] Allow passing/returning of __fp16 arguments

The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be
used as a functon argument or return type (ACLE 1.1 did not).

The current public release of the AAPCS (2.09) states that __fp16 values
should be converted to single-precision before being passed or returned,
but AAPCS 2.10 (to be released shortly) changes this, so that they are
passed in the least-significant 16 bits of either a GPR (for base AAPCS)
or a single-precision register (for AAPCS-VFP). This does not change how
arguments are passed if they get passed on the stack.

This patch brings clang up to compliance with the latest versions of
both of these specs.

We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always
been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support
the alternative format).

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

9 years ago[OPENMP 4.1] Codegen for extended format of 'if' clause.
Alexey Bataev [Thu, 3 Sep 2015 08:45:56 +0000 (08:45 +0000)]
[OPENMP 4.1] Codegen for extended format of 'if' clause.
Fixed codegen for extended format of 'if' clauses with special 'directive-name-modifier' + ast-print tests for extended format of 'if' clause.

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

9 years ago[OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.
Alexey Bataev [Thu, 3 Sep 2015 07:23:48 +0000 (07:23 +0000)]
[OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.
OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause.
Format of 'if' clause is as follows:
```
if([ directive-name-modifier :] scalar-logical-expression)
```

The restriction rules are also changed.
1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'.
2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive.
3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive.

'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied.

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

9 years agoRemove inadvertent debug output from prior change.
Douglas Katzman [Wed, 2 Sep 2015 21:18:10 +0000 (21:18 +0000)]
Remove inadvertent debug output from prior change.

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

9 years agoUse new utility function to clean leading junk from pathnames. NFC
Douglas Katzman [Wed, 2 Sep 2015 21:14:53 +0000 (21:14 +0000)]
Use new utility function to clean leading junk from pathnames. NFC

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

9 years ago[analyzer] Refactoring: bring together scan-build options and environment variables.
Anton Yartsev [Wed, 2 Sep 2015 21:01:59 +0000 (21:01 +0000)]
[analyzer] Refactoring: bring together scan-build options and environment variables.

Full list of changes:
- all scan-build command-line arguments are now kept in %Options hash.
- most of environment variables scan-build operates with are stored in %EnvVars hash.
- moved processing of command-line arguments to the ProcessArgs subroutine.

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

9 years agoMigrate the target attribute parsing code to returning an instance
Eric Christopher [Wed, 2 Sep 2015 20:40:12 +0000 (20:40 +0000)]
Migrate the target attribute parsing code to returning an instance
every time it's called rather than attempting to cache the result.
It's unlikely to be called frequently and the overhead of using
it in the first place is already factored out.

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

9 years ago[modules] Tighten up this test a bit.
Sean Silva [Wed, 2 Sep 2015 20:16:09 +0000 (20:16 +0000)]
[modules] Tighten up this test a bit.

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

9 years agoUpdate comment for AdditionalMembers with a note to avoid using
Eric Christopher [Wed, 2 Sep 2015 20:13:41 +0000 (20:13 +0000)]
Update comment for AdditionalMembers with a note to avoid using
additional data members in attributes as they'll leak and provide
some guidance as to where they should be allocated if necessary.

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

9 years agoDo not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.
Ivan Krasin [Wed, 2 Sep 2015 20:02:38 +0000 (20:02 +0000)]
Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.

Summary:
Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.

Introduce a frontend option -fdepfile-entry, and only insert them
for the user-defined sanitizer blacklists. In frontend, grab ExtraDeps
from -fdepfile-entry, instead of -fsanitize-blacklist.

Reviewers: rsmith, pcc

Subscribers: cfe-commits

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

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

9 years agoadd __builtin_unpredictable and convert to metadata
Sanjay Patel [Wed, 2 Sep 2015 20:01:30 +0000 (20:01 +0000)]
add __builtin_unpredictable and convert to metadata

This patch depends on r246688 (D12341).

The goal is to make LLVM generate different code for these functions for a target that
has cheap branches (see PR23827 for more details):

int foo();

int normal(int x, int y, int z) {
   if (x != 0 && y != 0) return foo();
   return 1;
}

int crazy(int x, int y) {
   if (__builtin_unpredictable(x != 0 && y != 0)) return foo();
   return 1;
}

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

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

9 years ago[modules] Don't waste time reading in the names the module file writer gave to blocks...
Richard Smith [Wed, 2 Sep 2015 17:45:54 +0000 (17:45 +0000)]
[modules] Don't waste time reading in the names the module file writer gave to blocks. We don't need these names, and decoding the corresponding bitcode has a significant cost.

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

9 years ago[MS ABI] Number unnamed TagDecls which aren't externally visible
David Majnemer [Wed, 2 Sep 2015 15:50:38 +0000 (15:50 +0000)]
[MS ABI] Number unnamed TagDecls which aren't externally visible

TagDecls (structs, enums, etc.) may have the same name for linkage
purposes of one another; to disambiguate, we add a number to the mangled
named.  However, we didn't do this if the TagDecl has a pseudo-name for
linkage purposes (it was defined alongside a DeclaratorDecl or a
TypeNameDecl).

This fixes PR24651.

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

9 years ago[OpenMP] Make helper functoin static. NFC.
Benjamin Kramer [Wed, 2 Sep 2015 15:31:05 +0000 (15:31 +0000)]
[OpenMP] Make helper functoin static. NFC.

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

9 years ago[Shave]: pass through more clang options to moviCompile
Douglas Katzman [Wed, 2 Sep 2015 13:42:43 +0000 (13:42 +0000)]
[Shave]: pass through more clang options to moviCompile

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

9 years ago[Sparc]: GCCInstallationDetector should not care if little-endian
Douglas Katzman [Wed, 2 Sep 2015 13:33:42 +0000 (13:33 +0000)]
[Sparc]: GCCInstallationDetector should not care if little-endian

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

9 years agoSilence a -Wsign-compare warning; NFC.
Aaron Ballman [Wed, 2 Sep 2015 12:50:12 +0000 (12:50 +0000)]
Silence a -Wsign-compare warning; NFC.

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

9 years ago[Sema] Avoid crash on tag-type mismatch (Fixes PR24610)
Vedant Kumar [Wed, 2 Sep 2015 03:27:15 +0000 (03:27 +0000)]
[Sema] Avoid crash on tag-type mismatch (Fixes PR24610)

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

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

9 years agoMigrate the target attribute parsing code into an extension off of
Eric Christopher [Wed, 2 Sep 2015 00:12:02 +0000 (00:12 +0000)]
Migrate the target attribute parsing code into an extension off of
the main attribute and cache the results so we don't have to parse
a single attribute more than once.

This reapplies r246596 with a fix for an uninitialized class member,
and a couple of cleanups and formatting changes.

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

9 years agoFix assertion failure in TransformOpaqueValueExpr
Hubert Tong [Tue, 1 Sep 2015 22:50:31 +0000 (22:50 +0000)]
Fix assertion failure in TransformOpaqueValueExpr

Summary:
`OpaqueValueExpr`s may not have a source expression (as in the case when
they are created due to a default argument error).
This can cause an assertion failure in `TransformOpaqueValueExpr` during
template instantiation.

This patch fixes the assertion failure.

Reviewers: hfinkel, rsmith

Subscribers: fraggamuffin, cfe-commits

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

Patch by Rachel Craik!

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

9 years agoRevert "Migrate the target attribute parsing code into an extension off of"
Eric Christopher [Tue, 1 Sep 2015 22:37:03 +0000 (22:37 +0000)]
Revert "Migrate the target attribute parsing code into an extension off of"

This is failing in release mode. Revert while I figure out what's happening.

This reverts commit r246596.

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

9 years agoMigrate the target attribute parsing code into an extension off of
Eric Christopher [Tue, 1 Sep 2015 22:03:58 +0000 (22:03 +0000)]
Migrate the target attribute parsing code into an extension off of
the main attribute and cache the results so we don't have to parse
a single attribute more than once.

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

9 years agoUse hasAttr, not getAttr if we're just checking for presence.
Eric Christopher [Tue, 1 Sep 2015 22:03:56 +0000 (22:03 +0000)]
Use hasAttr, not getAttr if we're just checking for presence.

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

9 years ago[MS ABI] Switch to the CRC implementation in LLVM
David Majnemer [Tue, 1 Sep 2015 21:24:07 +0000 (21:24 +0000)]
[MS ABI] Switch to the CRC implementation in LLVM

We now have an implementation of the CRC in LLVM's libSupport.  Let's
consolidate around that one.

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

9 years agoMake trunk release notes point to 3.7, not 3.6
Nico Weber [Tue, 1 Sep 2015 21:13:14 +0000 (21:13 +0000)]
Make trunk release notes point to 3.7, not 3.6

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

9 years agoRe-commit r246497 (and dependent changes r246524 and r246521), reverted in
Richard Smith [Tue, 1 Sep 2015 20:35:42 +0000 (20:35 +0000)]
Re-commit r246497 (and dependent changes r246524 and r246521), reverted in
r246546, with a workaround for an MSVC 2013 miscompile and an MSVC 2015
rejects-valid.

Original commit message:

[modules] Rework serialized DeclContext lookup table management. Instead of
walking the loaded ModuleFiles looking for lookup tables for the context, store
them all in one place, and merge them together if we find we have too many
(currently, more than 4). If we do merge, include the merged form in our
serialized lookup table, so that downstream readers never need to look at our
imports' tables.

This gives a huge performance improvement to builds with very large numbers of
modules (in some cases, more than a 2x speedup was observed).

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

9 years agoFix typo in test
Eli Bendersky [Tue, 1 Sep 2015 18:56:19 +0000 (18:56 +0000)]
Fix typo in test

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

9 years agoPull initFeatureMap out of line now that it's used in multiple places.
Eric Christopher [Tue, 1 Sep 2015 18:13:20 +0000 (18:13 +0000)]
Pull initFeatureMap out of line now that it's used in multiple places.

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

9 years agoAdd a new frontend warning for referencing members from the handler of a constructor...
Aaron Ballman [Tue, 1 Sep 2015 14:49:24 +0000 (14:49 +0000)]
Add a new frontend warning for referencing members from the handler of a constructor or destructor function-try-block, which is UB in C++.

This corresponds to the CERT secure coding rule ERR53-CPP.

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

9 years agoReverting r246497 (which requires also reverting r246524 and r246521 to avoid merge...
Aaron Ballman [Tue, 1 Sep 2015 13:24:39 +0000 (13:24 +0000)]
Reverting r246497 (which requires also reverting r246524 and r246521 to avoid merge conflicts). It broke the build on MSVC 2015. It also broke an MSVC 2013 bot with testing issues.

llvm\tools\clang\lib\serialization\MultiOnDiskHashTable.h(117):
error C2065: 'Files': undeclared identifier

http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/2917

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

9 years ago[modules] When emitting line tables, only emit filenames that are actually referenced...
Richard Smith [Tue, 1 Sep 2015 07:41:55 +0000 (07:41 +0000)]
[modules] When emitting line tables, only emit filenames that are actually referenced by the entries that we emit.

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

9 years agoDon't use fprintf to emit this diagnostic!
Richard Smith [Tue, 1 Sep 2015 02:35:58 +0000 (02:35 +0000)]
Don't use fprintf to emit this diagnostic!

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

9 years agoUse a more appropriate way of writing 1.
Richard Smith [Tue, 1 Sep 2015 02:02:09 +0000 (02:02 +0000)]
Use a more appropriate way of writing 1.

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

9 years ago[MS ABI] Cleanup get*ForUnnamedTagDecl
David Majnemer [Tue, 1 Sep 2015 01:53:07 +0000 (01:53 +0000)]
[MS ABI] Cleanup get*ForUnnamedTagDecl

Use "lookup" instead of operator[], it will not perform unnecessary
insertions.  No functionality change is intended.

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

9 years ago[modules] Preserve DeclID order when merging lookup tables to give a more
Richard Smith [Tue, 1 Sep 2015 01:37:34 +0000 (01:37 +0000)]
[modules] Preserve DeclID order when merging lookup tables to give a more
predictable diagnostic experience. The hash-of-DeclID order we were using
before gave different results on Win32 due to a different predefined
declaration of __builtin_va_list.

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

9 years agoFix path seperator for Windows.
Yaron Keren [Tue, 1 Sep 2015 01:29:13 +0000 (01:29 +0000)]
Fix path seperator for Windows.

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

9 years ago[PowerPC] Support __builtin_ppc_get_timebase
Hal Finkel [Mon, 31 Aug 2015 23:55:19 +0000 (23:55 +0000)]
[PowerPC] Support __builtin_ppc_get_timebase

GCC 4.8+ has a PowerPC-specific intrinsic, __builtin_ppc_get_timebase, to do
what Clang's __builtin_readcyclecounter does. For compatibility with code that
uses GCC's spelling (including glibc), support it as well.

Partially fixes PR23681.

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

9 years agoRevert "Pull the target attribute parsing out of CGCall and onto TargetInfo."
Eric Christopher [Mon, 31 Aug 2015 23:19:55 +0000 (23:19 +0000)]
Revert "Pull the target attribute parsing out of CGCall and onto TargetInfo."

This reverts commit r246468 while we figure out what to do about Basic and AST.

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

9 years ago[modules] Add some missing blockinfo records.
Richard Smith [Mon, 31 Aug 2015 22:43:10 +0000 (22:43 +0000)]
[modules] Add some missing blockinfo records.

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

9 years ago[modules] Rework serialized DeclContext lookup table management. Instead of
Richard Smith [Mon, 31 Aug 2015 22:17:11 +0000 (22:17 +0000)]
[modules] Rework serialized DeclContext lookup table management. Instead of
walking the loaded ModuleFiles looking for lookup tables for the context, store
them all in one place, and merge them together if we find we have too many
(currently, more than 4). If we do merge, include the merged form in our
serialized lookup table, so that downstream readers never need to look at our
imports' tables.

This gives a huge performance improvement to builds with very large numbers of
modules (in some cases, more than a 2x speedup was observed).

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

9 years agoFix CHECK directives that weren't checking.
Hans Wennborg [Mon, 31 Aug 2015 21:48:52 +0000 (21:48 +0000)]
Fix CHECK directives that weren't checking.

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

9 years agoRevert r246345 until an assertion is fixed.
Gabor Horvath [Mon, 31 Aug 2015 20:10:35 +0000 (20:10 +0000)]
Revert r246345 until an assertion is fixed.

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

9 years agoStop hardcoding GCC paths in crt/ld.so lookup.
Rafael Espindola [Mon, 31 Aug 2015 19:17:51 +0000 (19:17 +0000)]
Stop hardcoding GCC paths in crt/ld.so lookup.

This patch refactors the code to use the GCC installation detector
(modified so that it works in Solaris), and uses
ToolChain::GetFilePath everywhere once it works.

Patch by Xan López <xan@igalia.com>!

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

9 years ago[MS ABI] Correctly mangle classes without names for linkage purposes
David Majnemer [Mon, 31 Aug 2015 18:48:39 +0000 (18:48 +0000)]
[MS ABI] Correctly mangle classes without names for linkage purposes

A class without a name for linkage purposes gets a name along the lines
of <unnamed-type-foo> where foo is either the name of a declarator which
defined it (like a variable or field) or a
typedef-name (like a typedef or alias-declaration).

We handled the declarator case correctly but it would fall down during
template instantiation if the declarator didn't share the tag's type.
We failed to handle the typedef-name case at all.

Instead, keep track of the association between the two and keep it up to
date in the face of template instantiation.

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

9 years agoPull the target attribute parsing out of CGCall and onto TargetInfo.
Eric Christopher [Mon, 31 Aug 2015 18:39:22 +0000 (18:39 +0000)]
Pull the target attribute parsing out of CGCall and onto TargetInfo.

Also:
  - Add a typedef to make working with the result easier.
  - Update callers to use the new function.
  - Make initFeatureMap out of line.

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