]> granicus.if.org Git - clang/log
clang
11 years agoclang-format: Fix bug in style option AlwaysBreakTemplateDeclarations.
Daniel Jasper [Sat, 14 Sep 2013 08:13:22 +0000 (08:13 +0000)]
clang-format: Fix bug in style option AlwaysBreakTemplateDeclarations.

Before:
  template <template <typename>
            class Fooooooo, template <typename>
            class Baaaaaaar>
  struct C {};

After:
  template <template <typename> class Fooooooo,
            template <typename> class Baaaaaaar>
  struct C {};

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

11 years agoParse: Template specializations which aren't dependent needn't have their parsing...
David Majnemer [Sat, 14 Sep 2013 05:46:42 +0000 (05:46 +0000)]
Parse: Template specializations which aren't dependent needn't have their parsing be delayed

Summary:
We should treat a non-dependent template specialization like it wasn't
templated at all.

Reviewers: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1554

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

11 years agoClean up some Triple usage in clang.
Cameron Esfahani [Sat, 14 Sep 2013 01:09:11 +0000 (01:09 +0000)]
Clean up some Triple usage in clang.

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

11 years ago[analyzer] Put more uniqueness in scan-build's temporary directory names.
Jordan Rose [Sat, 14 Sep 2013 00:41:32 +0000 (00:41 +0000)]
[analyzer] Put more uniqueness in scan-build's temporary directory names.

This is necessary when running two scan-build processes in parallel. The
directory naming scheme is now:

  yyyy-MM-dd-HHmmss-PID-N
  2013-09-13-174210-123-1

where "PID" is the scan-build process ID, and "N" is a sequential counter
(not likely to be needed now that seconds are mangled in, but just in case).

PR17196, using a suggested fix from Greg Czajkowski!

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

11 years agoAdd support for -ggnu-pubnames matching the llvm support.
Eric Christopher [Fri, 13 Sep 2013 22:37:55 +0000 (22:37 +0000)]
Add support for -ggnu-pubnames matching the llvm support.

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

11 years agoFix a comment.
Michael Han [Fri, 13 Sep 2013 22:24:50 +0000 (22:24 +0000)]
Fix a comment.

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

11 years agoLex and ignore Microsoft's #pragma warning(...)
Reid Kleckner [Fri, 13 Sep 2013 22:00:30 +0000 (22:00 +0000)]
Lex and ignore Microsoft's #pragma warning(...)

Summary:
This fixes PR17145 and avoids unknown pragma warnings.

This change does not attempt to map MSVC warning numbers to clang
warning flags.  Perhaps in the future we will implement a mapping for
some common subset of Microsoft warnings, but for now we don't.

Reviewers: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1652

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

11 years agoPart three of PR15721: if we have an invalid CXXDefaultInitExpr, don't crash if
Richard Smith [Fri, 13 Sep 2013 20:51:45 +0000 (20:51 +0000)]
Part three of PR15721: if we have an invalid CXXDefaultInitExpr, don't crash if
we try to constant-evaluate it. Patch by Karthik Bhat, test by me.

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

11 years agovector_size cannot be applied to Booleans. Updated the semantic checking logic,...
Aaron Ballman [Fri, 13 Sep 2013 20:43:08 +0000 (20:43 +0000)]
vector_size cannot be applied to Booleans.  Updated the semantic checking logic, as well as the comment and added a test case.  Fixes PR12649

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

11 years agoSwitching the WeakRef attribute to using the new checkStringLiteralArgument helper...
Aaron Ballman [Fri, 13 Sep 2013 19:35:18 +0000 (19:35 +0000)]
Switching the WeakRef attribute to using the new checkStringLiteralArgument helper function.

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

11 years agoUpdate Atom Silvermont (SLM) support by adding enabled features.
Preston Gurd [Fri, 13 Sep 2013 19:27:17 +0000 (19:27 +0000)]
Update Atom Silvermont (SLM) support by adding enabled features.

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

11 years agoDebugInfo: omit debug info for friends
David Blaikie [Fri, 13 Sep 2013 18:45:00 +0000 (18:45 +0000)]
DebugInfo: omit debug info for friends

GCC ToT doesn't do this & it's worth about 3.2% on Clang's DWO file size
with Clang. Some or all of this may be due to things like r190715 which
could have source fixes/improvements, but it's not clear that's the case
and that doesn't help other source bases.

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

11 years agoRemove unnecessary inclusion of Sema.h
David Blaikie [Fri, 13 Sep 2013 18:32:52 +0000 (18:32 +0000)]
Remove unnecessary inclusion of Sema.h

Let me tell you a tale...

Within some twisted maze of debug info I've ended up implementing an
insane man's Include What You Use device. When the debugger emits debug
info it really shouldn't, I find out why & then realize the code could
be improved too.

In this instance CIndexDiagnostics.cpp had a lot more debug info with
Clang than GCC. Upon inspection a major culprit was all the debug info
describing clang::Sema. This was emitted because clang::Sema is
befriended by DiagnosticEngine which was rightly required, but GCC
doesn't emit debug info for friends so it never emitted anything for
Clang. Clang does emit debug info for friends (will be fixed/changed to
reduce debug info size).

But why didn't Clang just emit a declaration of Sema if this entire TU
didn't require a definition?

1) Diagnostic.h did the right thing, only using a declaration of Sema
and not including Sema.h at all.
2) Some other dependency of CIndexDiagnostics.cpp didn't do the right
thing. ASTUnit.h, only needing a declaration, still included Sema.h
(hence this commit which removes that include and adds the necessary
includes to the cpp files that were relying on this)
3) -flimit-debug-info didn't save us because of
EnterExpressionEvaluationContext, defined inline in Sema.h which fires
the "requiresCompleteType" check/flag (since it uses nested types from
Sema and calls Sema member functions) and thus, if debug info is ever
emitted for the type, the whole type is emitted and not just a
declaration.

Improving -flimit-debug-info to account for this would be... hard.
Modifying the code so that's not 'required to be complete' might be
possible, but probably only by moving EnterExpressionEvaluationContext
either into Sema, or out of Sema.h. That might be a bit too much of a
contortion to be bothered with.

Also, this is only one of the cases where emitting debug info for
friends caused us to emit a lot more debug info (this change reduces
Clang's DWO size by 0.93%, dropping friends entirely reduces debug info
by 3.2%) - I haven't hunted down the other cases, but I assume they
might be similar (Sema or something like it). IWYU or a similar tool
might help us reduce build times a bit, but analyzing debug info to find
these differences isn't worthwhile. I'll take the 3.2% win, provide this
small improvement to the code itself, and move on.

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

11 years agoFix indentation of closing };
David Blaikie [Fri, 13 Sep 2013 17:56:13 +0000 (17:56 +0000)]
Fix indentation of closing };

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

11 years agoUpdated the PCS calling convention to use the new checkStringLiteralArgument helper...
Aaron Ballman [Fri, 13 Sep 2013 17:48:25 +0000 (17:48 +0000)]
Updated the PCS calling convention to use the new checkStringLiteralArgument helper function.

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

11 years agoAs Aaron pointed out it's simpler to reject wide string availability attr messages...
Benjamin Kramer [Fri, 13 Sep 2013 17:31:48 +0000 (17:31 +0000)]
As Aaron pointed out it's simpler to reject wide string availability attr messages in the parser.

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

11 years agoASTContext.cpp: Fix a warning in r190684. [-Wcovered-switch-default]
NAKAMURA Takumi [Fri, 13 Sep 2013 17:12:09 +0000 (17:12 +0000)]
ASTContext.cpp: Fix a warning in r190684. [-Wcovered-switch-default]

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

11 years agoMoving Cortex-R cores to armv7r arch
Renato Golin [Fri, 13 Sep 2013 17:02:59 +0000 (17:02 +0000)]
Moving Cortex-R cores to armv7r arch

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

11 years agoAdd more Cortex CPUs and tests
Renato Golin [Fri, 13 Sep 2013 17:02:54 +0000 (17:02 +0000)]
Add more Cortex CPUs and tests

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

11 years agoFix Neon detection for Cortex-A class, plus adds some more CPUs to default features
Renato Golin [Fri, 13 Sep 2013 17:02:45 +0000 (17:02 +0000)]
Fix Neon detection for Cortex-A class, plus adds some more CPUs to default features

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

11 years agoGuard availability and thread safety attributes against wide strings.
Benjamin Kramer [Fri, 13 Sep 2013 16:30:12 +0000 (16:30 +0000)]
Guard availability and thread safety attributes against wide strings.

Found by inspection.

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

11 years agoUnify handling of string literal arguments for attributes and add fixits.
Benjamin Kramer [Fri, 13 Sep 2013 15:35:43 +0000 (15:35 +0000)]
Unify handling of string literal arguments for attributes and add fixits.

This fixes a couple of latent crashes for invalid attributes and also adds a
fixit hint to turn identifiers into string literals if one was expected. It then
proceeds recovery as if the identifier was a literal. Diagnostic locations are
also changed to point at the literal instead of the attribute if the error
concerns the argument. PR17175.

For example:
hidden.c:1:40: error: 'visibility' attribute requires a string
extern int x __attribute__((visibility(hidden)));
                                       ^
                                       "     "
hidden.c:2:29: error: visibility does not match previous declaration
extern int x __attribute__((visibility("default")));
                            ^
hidden.c:1:29: note: previous attribute is here
extern int x __attribute__((visibility(hidden)));
                            ^

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

11 years ago[ARMv8] Change the naming of some options to be more consistent.
Joey Gouly [Fri, 13 Sep 2013 13:48:33 +0000 (13:48 +0000)]
[ARMv8] Change the naming of some options to be more consistent.

Clang side changes for LLVM r190692.

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

11 years agoclang-format: Add -assume-filename option for editor integrations.
Daniel Jasper [Fri, 13 Sep 2013 13:40:24 +0000 (13:40 +0000)]
clang-format: Add -assume-filename option for editor integrations.

With -style=file, clang-format now starts to search for a .clang-format
file starting at the file given with -assume-filename if it reads from
stdin. Otherwise, it would start searching from the current directory,
which is not helpful for editor integrations.

Also changed vim, emacs and sublime integrations to actually make use of
this flag.

This fixes llvm.org/PR17072.

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

11 years agoAdded missing field comparisons to the FormatStyle::operator==
Alexander Kornienko [Fri, 13 Sep 2013 12:54:40 +0000 (12:54 +0000)]
Added missing field comparisons to the FormatStyle::operator==

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

11 years agoA buildbot compiling with strict error on unused variables pointed out a
David Tweed [Fri, 13 Sep 2013 12:51:05 +0000 (12:51 +0000)]
A buildbot compiling with strict error on unused variables pointed out a
historical remnant in r190684; remove it.

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

11 years agoCertain multi-platform languages, such as OpenCL, have the concept of
David Tweed [Fri, 13 Sep 2013 12:04:22 +0000 (12:04 +0000)]
Certain multi-platform languages, such as OpenCL, have the concept of
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.

Patch by Michele Scandale!

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

11 years agoAdd "native" to config.available_features, to make it easier to disable non-x-compile...
Amaury de la Vieuville [Fri, 13 Sep 2013 11:02:31 +0000 (11:02 +0000)]
Add "native" to config.available_features, to make it easier to disable non-x-compile-safe tests

Patch by Artyom Skrobov!

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

11 years agoclang-format: Detect braced lists in subscript expressions.
Daniel Jasper [Fri, 13 Sep 2013 10:55:31 +0000 (10:55 +0000)]
clang-format: Detect braced lists in subscript expressions.

Before (even with Style.Cpp11BracedListStyle):
  f(MyMap[{ composite, key }]);

After:
  f(MyMap[{composite, key}]);

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

11 years ago[-cxx-abi microsoft] Mangle user defined entry points properly
David Majnemer [Fri, 13 Sep 2013 09:40:55 +0000 (09:40 +0000)]
[-cxx-abi microsoft] Mangle user defined entry points properly

Summary:
Functions named "main", "wmain", "WinMain", "wWinMain", and "DllMain"
are never mangled regardless of linkage, even when compiling for kernel
mode.
Depends on D1655

Reviewers: timurrrr, pcc, rnk, whunt

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1670

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

11 years agoclang-format: Fix incorrect enum parsing / layouting.
Daniel Jasper [Fri, 13 Sep 2013 09:20:45 +0000 (09:20 +0000)]
clang-format: Fix incorrect enum parsing / layouting.

Before:
  enum {
    Bar = Foo < int,
    int > ::value
  };

After:
  enum {
    Bar = Foo<int, int>::value
  };

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

11 years ago[-cxx-abi microsoft] Mangle declarations inside extern "C"
David Majnemer [Fri, 13 Sep 2013 09:03:14 +0000 (09:03 +0000)]
[-cxx-abi microsoft] Mangle declarations inside extern "C"

Summary:
This is a first step to getting extern "C" working properly inside
clang.  There are a number of quirks but mangling declarations inside
such a function are a good first step.

Reviewers: timurrrr, pcc, cdavis5x

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1655

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

11 years agoCHECK -> CHECK-DAG
David Majnemer [Fri, 13 Sep 2013 08:59:19 +0000 (08:59 +0000)]
CHECK -> CHECK-DAG

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

11 years agoRefactor the uninitialized field visitor. Also moved the calls to the visitor
Richard Trieu [Fri, 13 Sep 2013 03:20:53 +0000 (03:20 +0000)]
Refactor the uninitialized field visitor.  Also moved the calls to the visitor
later in the code so that the expressions will have addition processing first.
This catches a few additional cases of uninitialized uses of class fields.

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

11 years agoDocumentation: Doxygen-ification of existing docs for Sema/DelayedDiagnostic.h.
James Dennett [Fri, 13 Sep 2013 02:58:19 +0000 (02:58 +0000)]
Documentation: Doxygen-ification of existing docs for Sema/DelayedDiagnostic.h.

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

11 years agoDocumentation cleanup: Fixing \brief comments, migrating away from old style
James Dennett [Fri, 13 Sep 2013 02:46:09 +0000 (02:46 +0000)]
Documentation cleanup: Fixing \brief comments, migrating away from old style
that duplicated the name of the entity being documented at the start of its
comment, and other minor tidyups.

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

11 years agoFix two incorrect comments.
Jordan Rose [Fri, 13 Sep 2013 00:45:22 +0000 (00:45 +0000)]
Fix two incorrect comments.

Patch by Jared Grubb!

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

11 years ago[analyzer] Fix copy-paste error in internal docs.
Jordan Rose [Fri, 13 Sep 2013 00:44:57 +0000 (00:44 +0000)]
[analyzer] Fix copy-paste error in internal docs.

Patch by Jared Grubb!

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

11 years ago[analyzer] Run post-stmt checks for DeclStmt.
Jordan Rose [Fri, 13 Sep 2013 00:44:47 +0000 (00:44 +0000)]
[analyzer] Run post-stmt checks for DeclStmt.

No tests because no in-tree checkers use this, but that shouldn't stop
out-of-tree checkers.

Found by Aemon Cannon!

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

11 years agoRestore the sqrt -> llvm.sqrt mapping in fast-math mode
Hal Finkel [Thu, 12 Sep 2013 23:57:55 +0000 (23:57 +0000)]
Restore the sqrt -> llvm.sqrt mapping in fast-math mode

This restores the sqrt -> llvm.sqrt mapping, but only in fast-math mode
(specifically, when the UnsafeFPMath or NoNaNsFPMath CodeGen options are
enabled). The @llvm.sqrt* intrinsics have slightly different semantics from the
libm call, specifically, they are undefined when given a non-zero negative
number (the libm calls will always return NaN for any negative number).

This mapping was removed in r100613, and replaced with a TODO, but at that time
the fast-math flags were not yet implemented. Now that we have these, restoring
this mapping is important because it will enable autovectorization of sqrt
calls in loops (at least in fast-math mode).

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

11 years agoFix typo in llvm_unreachable string.
Nick Lewycky [Thu, 12 Sep 2013 23:36:08 +0000 (23:36 +0000)]
Fix typo in llvm_unreachable string.

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

11 years agoPR13657 (and duplicates):
Richard Smith [Thu, 12 Sep 2013 23:28:08 +0000 (23:28 +0000)]
PR13657 (and duplicates):

When a comma occurs in a default argument or default initializer within a
class, disambiguate whether it is part of the initializer or whether it ends
the initializer.

The way this works (which I will be proposing for standardization) is to treat
the comma as ending the default argument or default initializer if the
following token sequence matches the syntactic constraints of a
parameter-declaration-clause or init-declarator-list (respectively).

This is both consistent with the disambiguation rules elsewhere (where entities
are treated as declarations if they can be), and should have no regressions
over our old behavior. I think it might also disambiguate all cases correctly,
but I don't have a proof of that.

There is an annoyance here: because we're performing a tentative parse in a
situation where we may not have seen declarations of all relevant entities (if
the comma is part of the initializer, lookup may find entites declared later in
the class), we need to turn off typo-correction and diagnostics during the
tentative parse, and in the rare case that we decide the comma is part of the
initializer, we need to revert all token annotations we performed while
disambiguating.

Any diagnostics that occur outside of the immediate context of the tentative
parse (for instance, if we trigger the implicit instantiation of a class
template) are *not* suppressed, mirroring the usual rules for a SFINAE context.

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

11 years agoFix regression from r190427.
Eli Friedman [Thu, 12 Sep 2013 22:36:24 +0000 (22:36 +0000)]
Fix regression from r190427.

<rdar://problem/14970968>

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

11 years agoAdd a test case to test RAV visits parameters of implicit copy constructor.
Michael Han [Thu, 12 Sep 2013 20:59:33 +0000 (20:59 +0000)]
Add a test case to test RAV visits parameters of implicit copy constructor.

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

11 years agoPR16054: Slight strengthening for -Wsometimes-uninitialized: if we use a
Richard Smith [Thu, 12 Sep 2013 18:49:10 +0000 (18:49 +0000)]
PR16054: Slight strengthening for -Wsometimes-uninitialized: if we use a
variable uninitialized every time we reach its (reachable) declaration, or
every time we call the surrounding function, promote the warning from
-Wmaybe-uninitialized to -Wsometimes-uninitialized.

This is still slightly weaker than desired: we should, in general, warn
if a use is uninitialized the first time it is evaluated.

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

11 years agoMove the execution code from Compilation::ExecuteCommand to Command::Execute
Hans Wennborg [Thu, 12 Sep 2013 18:35:08 +0000 (18:35 +0000)]
Move the execution code from Compilation::ExecuteCommand to Command::Execute

I think it makes sense that a Command knows how to execute itself.

There's no functionality change but i rewrote the code to avoid the manual
memory management of Argv.

My motivation for this is that I plan to subclass Command to build fall-back
functionality into clang-cl.

Differential Revision: http://llvm-reviews.chandlerc.com/D1654

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

11 years agoMove Compilation::PrintJob and PrintDiagnosticJob into Job::Print.
Hans Wennborg [Thu, 12 Sep 2013 18:23:34 +0000 (18:23 +0000)]
Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.

This moves the code to Job.cpp, which seems like a more natural fit,
and replaces the "is this a JobList? is this a Command?" logic with
a virtual function call.

It also removes the code duplication between PrintJob and
PrintDiagnosticJob and simplifies the code a little.

There's no functionality change here, except that the Executable is
now always printed within quotes, whereas it would previously not be
quoted in crash reports, which I think was a bug.

Differential Revision: http://llvm-reviews.chandlerc.com/D1653

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

11 years ago[CMake] Put controversial always-recheck-revision-number behind an option.
Jordan Rose [Thu, 12 Sep 2013 16:17:41 +0000 (16:17 +0000)]
[CMake] Put controversial always-recheck-revision-number behind an option.

CMake does not have the ability to perform actions before calculating
dependencies, so it can't know whether it needs to rebuild clangBasic
to update for a new revision number. CLANG_ALWAYS_CHECK_VC_REV (off by
default) will cause clangBasic to always be dirty by deleting the
generated SVNVersion.inc after use; otherwise, SVNVersion.inc will
always be updated, but only included in the final binary when clangBasic
is rebuilt.

It'd be great to find a better way to do this, but hopefully this is
still an improvement over the complete lack of version information before.

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

11 years agoFix the MCTargetAsmParser API change.
Joey Gouly [Thu, 12 Sep 2013 10:59:24 +0000 (10:59 +0000)]
Fix the MCTargetAsmParser API change.

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

11 years ago[libclang] In clang_getLocation, check that the provided line/column is valid.
Argyrios Kyrtzidis [Thu, 12 Sep 2013 01:10:36 +0000 (01:10 +0000)]
[libclang] In clang_getLocation, check that the provided line/column is valid.

rdar://14971432

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

11 years agoFix the end-location of a CXXTemporaryObjectExpr when it is created with a initialize...
Argyrios Kyrtzidis [Wed, 11 Sep 2013 23:23:27 +0000 (23:23 +0000)]
Fix the end-location of a CXXTemporaryObjectExpr when it is created with a initializer_list.

rdar://14887351

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

11 years ago[CMake] Fix repository version checking dependencies harder.
Jordan Rose [Wed, 11 Sep 2013 23:12:55 +0000 (23:12 +0000)]
[CMake] Fix repository version checking dependencies harder.

Just always regenerate SVNVersion.inc. Don't worry about it not changing.

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

11 years agoclang/test/FixIt/fixit-unicode-with-utf8-output.c: Remove XFAIL.
NAKAMURA Takumi [Wed, 11 Sep 2013 23:09:22 +0000 (23:09 +0000)]
clang/test/FixIt/fixit-unicode-with-utf8-output.c: Remove XFAIL.

It'd be another issue that the terminal and stdout(including redirects) with utf8. This test XPASSed on Win32, at least on Lit.

FYI, we don't use a triplet like "-win64" anywhere.

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

11 years ago[CMake] Always include the Clang repo version, just like the autoconf build.
Jordan Rose [Wed, 11 Sep 2013 22:46:46 +0000 (22:46 +0000)]
[CMake] Always include the Clang repo version, just like the autoconf build.

Now that LLVM's helper script GetSVN.cmake actually works consistently,
there's no reason not to use it. This does mean that the clangBasic target
is potentially always dirty, because CMake-generated projects do not
necessarily recalculate dependencies after running each target.

This should end the issues of the AST format changing and breaking old
module files; CMake-Clang should now detect that the version changed just
like Autoconf-Clang has.

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

11 years agoObjectiveC migration. NS_RETURNS_NOT_RETAINED is the default for
Fariborz Jahanian [Wed, 11 Sep 2013 22:46:09 +0000 (22:46 +0000)]
ObjectiveC migration. NS_RETURNS_NOT_RETAINED is the default for
unknown methods which return Cocoa objects. No need to annotate
such methods.

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

11 years agoclang-format: Fix bug in pointer detection
Daniel Jasper [Wed, 11 Sep 2013 20:37:10 +0000 (20:37 +0000)]
clang-format: Fix bug in pointer detection

Before:
  for (int i = 0; i* 2 < z; i *= 2) {}
After:
  for (int i = 0; i * 2 < z; i *= 2) {}

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

11 years agoTablegen now generates a StringSwitch for attributes containing enumeration arguments...
Aaron Ballman [Wed, 11 Sep 2013 19:47:58 +0000 (19:47 +0000)]
Tablegen now generates a StringSwitch for attributes containing enumeration arguments to map strings to the proper enumeration value.  This makes error checking more consistent and reduces the amount of hand-written code required.

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

11 years agoObjectiveC migrator. Modify inferred property name
Fariborz Jahanian [Wed, 11 Sep 2013 18:27:16 +0000 (18:27 +0000)]
ObjectiveC migrator. Modify inferred property name
such that it does not lower case the staring property
name if getter name (after "get" prefix) starts with
two upper case letters.

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

11 years agoTest for correct usage of columnWidth in clang fixit hints.
Alexander Kornienko [Wed, 11 Sep 2013 18:10:30 +0000 (18:10 +0000)]
Test for correct usage of columnWidth in clang fixit hints.

Summary:
This test only works on systems capable of outputting UTF-8 encoded
text on the standard output (tested on linux and OS X, should XFAIL on windows,
if I haven't messed up the XFAIL line).

Reviewers: jordan_rose

Reviewed By: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1607

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

11 years agoClarify the status of PowerPC support.
Roman Divacky [Wed, 11 Sep 2013 17:12:49 +0000 (17:12 +0000)]
Clarify the status of PowerPC support.

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

11 years agoObjectiveC migrator. methods which look like a getter and
Fariborz Jahanian [Wed, 11 Sep 2013 17:05:15 +0000 (17:05 +0000)]
ObjectiveC migrator. methods which look like a getter and
start with "get" are inferreed as a readonly properties.

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

11 years agoAdded regression tests.
Serge Pavlov [Wed, 11 Sep 2013 17:04:24 +0000 (17:04 +0000)]
Added regression tests.

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

11 years ago[analyzer] Handle zeroing constructors for fields of structs with empty bases.
Jordan Rose [Wed, 11 Sep 2013 16:46:50 +0000 (16:46 +0000)]
[analyzer] Handle zeroing constructors for fields of structs with empty bases.

RegionStore tries to protect against accidentally initializing the same
region twice, but it doesn't take subregions into account very well. If
the outer region being initialized is a struct with an empty base class,
the offset of the first field in the struct will be 0. When we initialize
the base class, we may invalidate the contents of the struct by providing
a default value of Unknown (or some new symbol). We then go to initialize
the member with a zeroing constructor, only to find that the region at
that offset in the struct already has a value. The best we can do here is
to invalidate that value and continue; neither the old default value nor
the new 0 is correct for the entire struct after the member constructor call.

The correct solution for this is to track region extents in the store.

<rdar://problem/14914316>

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

11 years agoclang-cl: Warn about overriding /MD with /MT etc.
Hans Wennborg [Wed, 11 Sep 2013 16:38:41 +0000 (16:38 +0000)]
clang-cl: Warn about overriding /MD with /MT etc.

This also bakes the /M options into a separate option group to make
them easier to refer to from the code.

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

11 years agoTeach RAV to visit parameter variable declarations of implicit functions. Fixes PR16182.
Michael Han [Wed, 11 Sep 2013 15:53:29 +0000 (15:53 +0000)]
Teach RAV to visit parameter variable declarations of implicit functions. Fixes PR16182.

Normally RAV visits parameter variable declarations of a function by traversing the TypeLoc of
the parameter declarations. However, for implicit functions, their parameters don't have any
TypeLoc, because they are implicit.

So for implicit functions, we visit their parameter variable declarations by traversing them through
the function declaration, and visit them accordingly.

Reviewed by Richard Smith and Manuel Klimek.

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

11 years agofix xcore-opts.c test
Robert Lytton [Wed, 11 Sep 2013 15:14:38 +0000 (15:14 +0000)]
fix xcore-opts.c test

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

11 years agoAdding some additional test cases for the cleanup attribute.
Aaron Ballman [Wed, 11 Sep 2013 13:43:47 +0000 (13:43 +0000)]
Adding some additional test cases for the cleanup attribute.

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

11 years agoFix 2 cases of uninitialized reads of an invalid PresumedLoc.
Evgeniy Stepanov [Wed, 11 Sep 2013 12:33:58 +0000 (12:33 +0000)]
Fix 2 cases of uninitialized reads of an invalid PresumedLoc.

The code in CGExpr was added back in 2012 (r165536) but not exercised in tests
until recently.

Detected on the MemorySanitizer bootstrap bot.

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

11 years agoSupport for CR LF newlines.
Alexander Kornienko [Wed, 11 Sep 2013 12:25:57 +0000 (12:25 +0000)]
Support for CR LF newlines.

Summary:
reformat() tries to determine the newline style used in the input
(either LF or CR LF), and uses it for the output. Maybe not every single case is
supported, but at least the bug described in http://llvm.org/PR17182 should be
resolved.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1643

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

11 years agoFix the ASan dll_thunk path
Timur Iskhodzhanov [Wed, 11 Sep 2013 11:45:31 +0000 (11:45 +0000)]
Fix the ASan dll_thunk path

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

11 years agoSimplify code with the in place path::native. No functionality change.
Benjamin Kramer [Wed, 11 Sep 2013 11:23:15 +0000 (11:23 +0000)]
Simplify code with the in place path::native. No functionality change.

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

11 years agoSplit -Wunused-variable warning.
Daniel Jasper [Wed, 11 Sep 2013 10:37:35 +0000 (10:37 +0000)]
Split -Wunused-variable warning.

With r190382, -Wunused-variable warns about unused const variables when
appropriate. For codebases that use -Werror, this poses a problem as
existing unused const variables need to be cleaned up first. To make the
transistion easier, this patch splits -Wunused-variable by pulling out
an additional -Wunused-const-variable (by default activated along with
-Wunused-variable).

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

11 years ago[mips][msa] Corrected the definition of the dotp_[su].[hwd] intrinsics
Daniel Sanders [Wed, 11 Sep 2013 09:59:17 +0000 (09:59 +0000)]
[mips][msa] Corrected the definition of the dotp_[su].[hwd] intrinsics

The elements of the operands should be half the width of the elements of
the result.

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

11 years agoSemaTemplateDeduction.cpp: Prune two stray \param(s), TPOC and NumCallArguments in...
NAKAMURA Takumi [Wed, 11 Sep 2013 09:41:51 +0000 (09:41 +0000)]
SemaTemplateDeduction.cpp: Prune two stray \param(s), TPOC and NumCallArguments in Sema::getMostSpecialized(). They were removed since r190444. [-Wdocumentation]

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

11 years agoRemove unused diagnostics.
Benjamin Kramer [Wed, 11 Sep 2013 09:35:04 +0000 (09:35 +0000)]
Remove unused diagnostics.

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

11 years agoSupport for modular module-map-files
Daniel Jasper [Wed, 11 Sep 2013 07:20:44 +0000 (07:20 +0000)]
Support for modular module-map-files

This patch is the first step to make module-map-files modular (instead
of requiring a single "module.map"-file per include directory). This
step adds a new "extern module" declaration that enables
module-map-files to reference one another along with a very basic
implementation.

The next steps are:

* Combine this with the use-declaration (from
  http://llvm-reviews.chandlerc.com/D1546) in order to only load module
  map files required for a specific compilation.
* Add an additional flag to start with a specific module-map-file (instead
  of requiring there to be at least one "module.map").

Review: http://llvm-reviews.chandlerc.com/D1637

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

11 years agoFix a bug where -msse followed by -mno-sse would leave MMX enabled.
Craig Topper [Wed, 11 Sep 2013 06:48:53 +0000 (06:48 +0000)]
Fix a bug where -msse followed by -mno-sse would leave MMX enabled.

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

11 years ago[-cxx-abi microsoft] Canonicalize array parameters better
David Majnemer [Wed, 11 Sep 2013 04:44:30 +0000 (04:44 +0000)]
[-cxx-abi microsoft] Canonicalize array parameters better

Summary:
More accurately characterize the nature of array parameters. Doing this
removes false back-reference opportunities.  Remove some hacks now that
we characterize these better.

Reviewers: rnk, timurrrr, whunt, cdavis5x

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1626

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

11 years agoDo not quote YAML plain string myself. Let YAMLIO do that.
Rui Ueyama [Wed, 11 Sep 2013 04:00:35 +0000 (04:00 +0000)]
Do not quote YAML plain string myself. Let YAMLIO do that.

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

11 years agovolatile types are not trivially copyable.
Eli Friedman [Wed, 11 Sep 2013 03:49:34 +0000 (03:49 +0000)]
volatile types are not trivially copyable.

PR17123.

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

11 years agoFix test.
Eli Friedman [Wed, 11 Sep 2013 03:49:30 +0000 (03:49 +0000)]
Fix test.

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

11 years agoFix is_trivially_constructible preconditions.
Eli Friedman [Wed, 11 Sep 2013 02:53:02 +0000 (02:53 +0000)]
Fix is_trivially_constructible preconditions.

Fixes a crash in cases where the first argument was an incomplete type
or an uninstantiated template type.

<rdar://problem/14938471>

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

11 years agoDisable the bool and enum sanitizers when emitting the implicitly-defined copy
Nick Lewycky [Wed, 11 Sep 2013 02:03:20 +0000 (02:03 +0000)]
Disable the bool and enum sanitizers when emitting the implicitly-defined copy
constructor, copy assignment operator and move assignment operator.

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

11 years agoThe cleanup attribute no longer uses an unresolved, simple identifier as its argument...
Aaron Ballman [Wed, 11 Sep 2013 01:37:41 +0000 (01:37 +0000)]
The cleanup attribute no longer uses an unresolved, simple identifier as its argument.  Instead, it takes an expression that is fully resolved.

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

11 years agoPR17075: When performing partial ordering of a member function against a
Richard Smith [Wed, 11 Sep 2013 00:52:39 +0000 (00:52 +0000)]
PR17075: When performing partial ordering of a member function against a
non-member function, the number of arguments in the two candidate calls
will be different (the non-member call will have one extra argument).
We used to get confused by this, and fail to compare the last argument
when testing whether the member is better, resulting in us always
thinking it is, even if the non-member is more specialized in the last
argument.

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

11 years agoAdd -fansi-escape-codes option
Nico Rieck [Wed, 11 Sep 2013 00:38:02 +0000 (00:38 +0000)]
Add -fansi-escape-codes option

Some build systems use pipes for stdin/stderr. On nix-ish platforms colored
output can be forced by -fcolor-diagnostics. On Windows this option has
no effect in these cases because LLVM uses the console API (which only
operates on the console buffer) even if a console wrapper capable of
interpreting ANSI escape codes is used.

The -fansi-escape-codes option allows switching from the console API to
ANSI escape codes. It has no effect on other platforms.

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

11 years agoGet rid of unused isPodLike definition.
Eli Friedman [Wed, 11 Sep 2013 00:37:10 +0000 (00:37 +0000)]
Get rid of unused isPodLike definition.

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

11 years agoRemove unused class.
Eli Friedman [Wed, 11 Sep 2013 00:37:06 +0000 (00:37 +0000)]
Remove unused class.

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

11 years agoFix ICE in consumed analysis when CFG is null.
DeLesley Hutchins [Tue, 10 Sep 2013 23:10:10 +0000 (23:10 +0000)]
Fix ICE in consumed analysis when CFG is null.

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

11 years agoRemove unused variable.
Eli Friedman [Tue, 10 Sep 2013 23:00:03 +0000 (23:00 +0000)]
Remove unused variable.

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

11 years agogetMostSpecialized for function template sets is never used in the context of a
Richard Smith [Tue, 10 Sep 2013 22:59:25 +0000 (22:59 +0000)]
getMostSpecialized for function template sets is never used in the context of a
call; remove its 'number of explicit arguments' and 'what kind of call'
parameters.

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

11 years agoAdd unused markings to suppress warnings.
Eli Friedman [Tue, 10 Sep 2013 22:57:15 +0000 (22:57 +0000)]
Add unused markings to suppress warnings.

trunk clang is a bit more aggressive about emitting unused-declaration
warnings, so adjust some AST code to match.  Specifically, use
LLVM_ATTRIBUTE_UNUSED for declarations which are never supposed to be
referenced, and turn references to declarations which are supposed to be
referenced into odr-uses.

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

11 years agoIgnore noreturn when checking function template specializations
Reid Kleckner [Tue, 10 Sep 2013 22:21:37 +0000 (22:21 +0000)]
Ignore noreturn when checking function template specializations

As requested when applying the same logic to calling conventions.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1634

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

11 years agoPR5683: Issue a warning when subtracting pointers to types of zero size, and
Richard Smith [Tue, 10 Sep 2013 21:34:14 +0000 (21:34 +0000)]
PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.

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

11 years agoFix regression from r190382.
Eli Friedman [Tue, 10 Sep 2013 21:10:25 +0000 (21:10 +0000)]
Fix regression from r190382.

Make sure we perform the correct "referenced-but-not-used" check for
static member constants.

Fixes bug reported on cfe-commits by Alexey Samsonov.

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

11 years agoFix cl-link.c test failure on Mac platforms
Hans Wennborg [Tue, 10 Sep 2013 20:53:34 +0000 (20:53 +0000)]
Fix cl-link.c test failure on Mac platforms

The test filename (%s) is easily confused with an option when
it starts with /Users...

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

11 years ago[ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does
Reid Kleckner [Tue, 10 Sep 2013 20:43:12 +0000 (20:43 +0000)]
[ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does

Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ.

Reviewers: timurrrr

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1477

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

11 years agoRemove Windows line-endings in two clang-cl test files.
Hans Wennborg [Tue, 10 Sep 2013 20:35:58 +0000 (20:35 +0000)]
Remove Windows line-endings in two clang-cl test files.

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

11 years agoclang-cl: Support building DLLs (PR17083)
Hans Wennborg [Tue, 10 Sep 2013 20:18:04 +0000 (20:18 +0000)]
clang-cl: Support building DLLs (PR17083)

This adds driver support for building DLLs (the /LD and /LDd flags).
It basically does two things: runtime selection and passing -dll and
-implib to the linker.

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

11 years ago[ms-cxxabi] Implement guard variables for static initialization
Reid Kleckner [Tue, 10 Sep 2013 20:14:30 +0000 (20:14 +0000)]
[ms-cxxabi] Implement guard variables for static initialization

Static locals requiring initialization are not thread safe on Windows.
Unfortunately, it's possible to create static locals that are actually
externally visible with inline functions and templates.  As a result, we
have to implement an initialization guard scheme that is compatible with
TUs built by MSVC, which makes thread safety prohibitively difficult.

MSVC's scheme is that every function that requires a guard gets an i32
bitfield.  Each static local is assigned a bit that indicates if it has
been initialized, up to 32 bits, at which point a new bitfield is
created.  MSVC rejects inline functions with more than 32 static locals,
and the externally visible mangling (?_B) only allows for one guard
variable per function.

On Eli's recommendation, I used MangleNumberingContext to track which
bit each static corresponds to.

Implements PR16888.

Reviewers: rjmccall, eli.friedman

Differential Revision: http://llvm-reviews.chandlerc.com/D1416

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