]> granicus.if.org Git - clang/log
clang
10 years agoFix 'unkown' typo in test -target from r198321
Alp Toker [Tue, 7 Jan 2014 02:47:19 +0000 (02:47 +0000)]
Fix 'unkown' typo in test -target from r198321

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

10 years agoupdate comment.
Adrian Prantl [Tue, 7 Jan 2014 02:40:59 +0000 (02:40 +0000)]
update comment.

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

10 years agoBring back magic constants in the digraph diagnostic
Alp Toker [Tue, 7 Jan 2014 02:35:33 +0000 (02:35 +0000)]
Bring back magic constants in the digraph diagnostic

This backs out changes in commit r198605 and part of r198604, replacing the
original tok::kw_template with a slightly more obvious placeholder
tok::unknown.

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

10 years agoImplement a new -fstandalone-debug option. rdar://problem/15685848
Adrian Prantl [Tue, 7 Jan 2014 01:19:08 +0000 (01:19 +0000)]
Implement a new -fstandalone-debug option. rdar://problem/15685848
It controls everything that -flimit-debug-info used to, plus the
vtable type optimization. The old -fno-limit-debug-info option is now an
alias to -fstandalone-debug and vice versa.

Standalone is the default on Darwin until dtrace is updated to work with
non-standalone debug info (rdar://problem/15758808).

Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind
because NoStandaloneDebugInfo sounded even more confusing.

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

10 years agoObjectiveC. Computation of offsets when doing @encode type encoding
Fariborz Jahanian [Tue, 7 Jan 2014 01:02:50 +0000 (01:02 +0000)]
ObjectiveC. Computation of offsets when doing @encode type encoding
is only used in an assert. Do not do it if assert is not on.

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

10 years agoclang/test/CodeGenCXX/instr-profile.cpp: Appease -Asserts.
NAKAMURA Takumi [Tue, 7 Jan 2014 00:59:39 +0000 (00:59 +0000)]
clang/test/CodeGenCXX/instr-profile.cpp: Appease -Asserts.

FIXME: Don't seek bb labels, like "if.else"

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

10 years agoCodeGen: Sentences end with a period
Justin Bogner [Tue, 7 Jan 2014 00:20:28 +0000 (00:20 +0000)]
CodeGen: Sentences end with a period

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

10 years agoProperly sort CMake list. NFC.
Ted Kremenek [Mon, 6 Jan 2014 23:20:52 +0000 (23:20 +0000)]
Properly sort CMake list.  NFC.

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

10 years agoCodeGen: Initial instrumentation based PGO implementation
Justin Bogner [Mon, 6 Jan 2014 22:27:43 +0000 (22:27 +0000)]
CodeGen: Initial instrumentation based PGO implementation

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

10 years agoDriver: Accept -fprofile-instr-use and -fprofile-instr-generate
Justin Bogner [Mon, 6 Jan 2014 22:27:36 +0000 (22:27 +0000)]
Driver: Accept -fprofile-instr-use and -fprofile-instr-generate

These flags will be used for instrumentation based PGO.

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

10 years agoProspective MSVC 2010 build fix
Alp Toker [Mon, 6 Jan 2014 15:52:13 +0000 (15:52 +0000)]
Prospective MSVC 2010 build fix

Try to fix Compiler Error C2011 following r198607 by removing enum from 'enum
TokenKind' parameter types.

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

10 years agoCorrect underlying integer type of enum TokenKind
Alp Toker [Mon, 6 Jan 2014 12:54:51 +0000 (12:54 +0000)]
Correct underlying integer type of enum TokenKind

This matches up the underlying type against the actual storage type 'unsigned
short' and lets us get rid of some casts while we're at it.

Effort is made to keep this building in pre-C++11 but as with other features
Token will be less efficiently packed in in legacy configurations.

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

10 years agoSimplify diagnostic tag type using the token kind formatter
Alp Toker [Mon, 6 Jan 2014 12:54:41 +0000 (12:54 +0000)]
Simplify diagnostic tag type using the token kind formatter

As far as the parser is concerned the tag type is always a keyword.

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

10 years agoDon't use magic constants in the digraph diagnostic
Alp Toker [Mon, 6 Jan 2014 12:54:32 +0000 (12:54 +0000)]
Don't use magic constants in the digraph diagnostic

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

10 years agoSupport diagnostic formatting of keyword tokens
Alp Toker [Mon, 6 Jan 2014 12:54:18 +0000 (12:54 +0000)]
Support diagnostic formatting of keyword tokens

Implemented with a new getKeywordSpelling() accessor. Unlike getTokenName() the
result of this function is stable and may be used in diagnostic output.

Uses of this feature are split out into the subsequent commit.

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

10 years agoRename getTokenSimpleSpelling() to getPunctuatorSpelling()
Alp Toker [Mon, 6 Jan 2014 12:54:07 +0000 (12:54 +0000)]
Rename getTokenSimpleSpelling() to getPunctuatorSpelling()

That's what it does, what the documentation says it does and what callers
expect it to do.

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

10 years agoHighlight the previous underlying enum type when diagnosing a mismatch
Alp Toker [Mon, 6 Jan 2014 11:31:18 +0000 (11:31 +0000)]
Highlight the previous underlying enum type when diagnosing a mismatch

enum-scoped.cpp:93:6: error: enumeration redeclared with different underlying type 'short' (was 'int')
  enum Redeclare6 : short;
       ^
enum-scoped.cpp:92:6: note: previous declaration is here
  enum Redeclare6 : int;
       ^            ~~~

The redeclaration source range is still missing but this is a step forward,
potentially edging towards a FixIt.

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

10 years agoDiagnose enum redeclarations properly
Alp Toker [Mon, 6 Jan 2014 11:31:06 +0000 (11:31 +0000)]
Diagnose enum redeclarations properly

In all three checks, the note indicates a previous declaration and never a 'use'.

Before:

  enum-scoped.cpp:92:6: note: previous use is here
    enum Redeclare6 : int;
         ^

After:

  enum-scoped.cpp:92:6: note: previous declaration is here
    enum Redeclare6 : int;
         ^

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

10 years agoUse token kind instead of '%select{.|->}0' in diagnostic
Alp Toker [Mon, 6 Jan 2014 11:30:41 +0000 (11:30 +0000)]
Use token kind instead of '%select{.|->}0' in diagnostic

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

10 years agoApply some LLVM_READONLY / LLVM_READNONE on diagnostic functions
Alp Toker [Mon, 6 Jan 2014 11:30:15 +0000 (11:30 +0000)]
Apply some LLVM_READONLY / LLVM_READNONE on diagnostic functions

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

10 years ago[OpenCL] Produce an error if an address space is used on the return
Joey Gouly [Mon, 6 Jan 2014 11:26:18 +0000 (11:26 +0000)]
[OpenCL] Produce an error if an address space is used on the return
type of a function.

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

10 years agoThis helper method isn't needed, and it's unsafe for it to use StringRef in the first...
Aaron Ballman [Sun, 5 Jan 2014 21:08:29 +0000 (21:08 +0000)]
This helper method isn't needed, and it's unsafe for it to use StringRef in the first place. Replaced the unsafe code with the proper accessor.

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

10 years agoclang-format: Spacing inside enum braces.
Daniel Jasper [Sun, 5 Jan 2014 13:23:23 +0000 (13:23 +0000)]
clang-format: Spacing inside enum braces.

Before (in Google style):
  enum ShortEnum {A, B, C};

After:
  enum ShortEnum { A, B, C };

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

10 years agoclang-format: Allow formatting short enums on a single line.
Daniel Jasper [Sun, 5 Jan 2014 12:38:10 +0000 (12:38 +0000)]
clang-format: Allow formatting short enums on a single line.

Before:
  enum ShortEnum {
    A,
    B,
    C
  };

After:
  enum ShortEnum { A, B, C };

This seems to be the predominant choice in LLVM/Clang as well as in
Google style.

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

10 years agoFix 'declartion' typos
Alp Toker [Sun, 5 Jan 2014 06:38:57 +0000 (06:38 +0000)]
Fix 'declartion' typos

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

10 years agoPre-declare '::type_info' in MicrosoftMode only, not MicrosoftExt
Alp Toker [Sun, 5 Jan 2014 06:38:18 +0000 (06:38 +0000)]
Pre-declare '::type_info' in MicrosoftMode only, not MicrosoftExt

It was previously enabled in both but should only have been part of the drop-in
quirks mode that is 'MicrosoftMode' given that it's only useful for
compatibility with the Microsoft headers/runtime.

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

10 years agoTweak the parse recovery in r198540
Alp Toker [Sun, 5 Jan 2014 04:17:27 +0000 (04:17 +0000)]
Tweak the parse recovery in r198540

Cover a hypothetical case when we might not have reached the final argument
declaration for some reason during recovery, and split out for readability.

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

10 years agoFix bungled parse recovery in K&R function declarations
Alp Toker [Sun, 5 Jan 2014 03:27:57 +0000 (03:27 +0000)]
Fix bungled parse recovery in K&R function declarations

  void knrNoSemi(i) int i { }

Adherents of The C Programming Language unfortunate enough to miss a semicolon
as above would be met with a cascade of errors spanning the remainder of the
TU.

This patch introduces a beautiful parse error recovery, complete with helpful
FixIt to restore sanity.

Before (output redacted for brevity):

  error: 'error' diagnostics seen but not expected:
    File declarators.c Line 119: declaration does not declare a parameter
    File declarators.c Line 123: declaration does not declare a parameter
    File declarators.c Line 127: parameter named 'func_E12' is missing
    File declarators.c Line 127: expected ';' at end of declaration
    File declarators.c Line 133: parameter named 'func_E13' is missing
    File declarators.c Line 133: expected ';' at end of declaration
    File declarators.c Line 139: parameter named 'func_E14' is missing
    File declarators.c Line 139: expected ';' at end of declaration
    File declarators.c Line 145: parameter named 'func_E15' is missing
    File declarators.c Line 145: expected ';' at end of declaration
    File declarators.c Line 150: expected function body after function declarator
    File declarators.c Line 119: declaration of 'enum E11' will not be visible outside of this function
    File declarators.c Line 123: declaration of 'enum E12' will not be visible outside of this function
    File declarators.c Line 133: ISO C forbids forward references to 'enum' types
    File declarators.c Line 133: declaration of 'enum E13' will not be visible outside of this function
    File declarators.c Line 139: ISO C forbids forward references to 'enum' types
    File declarators.c Line 139: declaration of 'enum E14' will not be visible outside of this function
    File declarators.c Line 145: ISO C forbids forward references to 'enum' types
    File declarators.c Line 145: declaration of 'enum E15' will not be visible outside of this function
    ...

After:

  declarators.c:103:24: error: expected ';' at end of declaration
  void knrNoSemi(i) int i { }
                         ^
                         ;

Patch found in a sealed envelope dated 1978 with the message "Do not open until
January 2014"

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

10 years agoParse: Token consumption modernization and loop de-nesting
Alp Toker [Sun, 5 Jan 2014 03:27:11 +0000 (03:27 +0000)]
Parse: Token consumption modernization and loop de-nesting

Cleanup only.

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

10 years agoRevert "ToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode...
Alp Toker [Sat, 4 Jan 2014 15:58:28 +0000 (15:58 +0000)]
Revert "ToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode on msvc. LangOpts.MicrosoftExt still appends "class type_info;"."

type_info has been made an implicitly predeclared type in r198497 and will no
longer appear as a user-declared type so we can remove this old hack.

This reverts commit r158595.

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

10 years agoMove MS predefined type_info out of InitializePredefinedMacros
Alp Toker [Sat, 4 Jan 2014 15:25:02 +0000 (15:25 +0000)]
Move MS predefined type_info out of InitializePredefinedMacros

Instead of keeping it in amongst the macros, build the declaration at Sema init
the same way we do with other predeclared and builtin types.

In practice this means the declaration is marked implicit and therefore won't
show up as an unwanted user-declared type in tooling which has been a
frequently reported issue (though I haven't been able to cook up a test).

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

10 years agoOnly mark dump() function definitions 'used' in debug builds
Alp Toker [Sat, 4 Jan 2014 13:47:14 +0000 (13:47 +0000)]
Only mark dump() function definitions 'used' in debug builds

This has the dual effect of (1) enabling more dead-stripping in release builds
and (2) ensuring that debug helper functions aren't stripped away in debug
builds, as they're intended to be called from the debugger.

Note that the attribute is applied to definitions rather than declarations in
headers going forward because it's now conditional on NDEBUG:

  /// \brief Mark debug helper function definitions like dump() that should not be
  /// stripped from debug builds.

Requires corresponding macro added in LLVM r198456.

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

10 years agoAdd an additional check in test/Sema/ext_vector_casts.c
Argyrios Kyrtzidis [Sat, 4 Jan 2014 06:27:45 +0000 (06:27 +0000)]
Add an additional check in test/Sema/ext_vector_casts.c

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

10 years ago[analyzer] Remove IdempotentOperations checker.
Ted Kremenek [Sat, 4 Jan 2014 05:52:11 +0000 (05:52 +0000)]
[analyzer] Remove IdempotentOperations checker.

This checker has not been updated to work with interprocedural analysis,
and actually contains both logical correctness issues but also
memory bugs.  We can resuscitate it from version control once there
is focused interest in making it a real viable checker again.

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

10 years ago[Sema] When checking if a bitcast is appropriate between vector types, take into
Argyrios Kyrtzidis [Sat, 4 Jan 2014 03:31:22 +0000 (03:31 +0000)]
[Sema] When checking if a bitcast is appropriate between vector types, take into
consideration the num-of-elements*width-of-element width.

Disallow casts when such width is not equal between the vector types otherwise
we may end up with an invalid LLVM bitcast.

rdar://15722308.

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

10 years agoIgnore qualified templated functions for -Winfinite-recursion. This treats
Richard Trieu [Sat, 4 Jan 2014 01:57:42 +0000 (01:57 +0000)]
Ignore qualified templated functions for -Winfinite-recursion.  This treats
functions like Foo<5>::run() the same way as run<5>() for this warning.

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

10 years ago[ms-cxxabi] Improve vbtable name mangling accuracy
Reid Kleckner [Fri, 3 Jan 2014 23:42:00 +0000 (23:42 +0000)]
[ms-cxxabi] Improve vbtable name mangling accuracy

Summary:
This makes us more compatible with MSVC 2012+ and fixes PR17748 where we
would give two tables the same name.

Rather than doing a fresh depth-first traversal of the inheritance graph
for every record's vbtables, now we memoize vbtable paths for each
record.  By doing memoization, we end up considering virtual bases of
subobjects that come later in the depth-first traversal.  Where
previously we would have ignored a virtual base that we'd already seen,
we now consider it for name mangling purposes without emitting a
duplicate vbtable for it.

Reviewers: majnemer

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

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

10 years agoDebug info: Ensure that the last stop point in a function is still within
Adrian Prantl [Fri, 3 Jan 2014 23:34:30 +0000 (23:34 +0000)]
Debug info: Ensure that the last stop point in a function is still within
the lexical block formed by the compound statement that is the function
body.

rdar://problem/15010825

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

10 years agoRefactored Builtin::Context::isPrintfLike and isScanfLike into a helper function...
Aaron Ballman [Fri, 3 Jan 2014 20:10:54 +0000 (20:10 +0000)]
Refactored Builtin::Context::isPrintfLike and isScanfLike into a helper function. The implementations are identical, except for the format arguments being searched for.

No functional changes intended.

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

10 years agoFix 80 col violation.
Argyrios Kyrtzidis [Fri, 3 Jan 2014 19:53:09 +0000 (19:53 +0000)]
Fix 80 col violation.

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

10 years agoPass the decl directly to the diagnostic, no need to call getDeclName().
Argyrios Kyrtzidis [Fri, 3 Jan 2014 19:39:23 +0000 (19:39 +0000)]
Pass the decl directly to the diagnostic, no need to call getDeclName().

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

10 years agoFixing a FIXME; the RetTy template parameter is always bool in practice, and so it...
Aaron Ballman [Fri, 3 Jan 2014 19:26:43 +0000 (19:26 +0000)]
Fixing a FIXME; the RetTy template parameter is always bool in practice, and so it has been removed. No functional changes intended.

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

10 years agoUpdate for llvm's DataLayout including mangling information.
Rafael Espindola [Fri, 3 Jan 2014 19:22:05 +0000 (19:22 +0000)]
Update for llvm's DataLayout including mangling information.

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

10 years agoMarked the default constructor as an LLVM_DELETED_FUNCTION.
Aaron Ballman [Fri, 3 Jan 2014 18:51:47 +0000 (18:51 +0000)]
Marked the default constructor as an LLVM_DELETED_FUNCTION.

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

10 years agoRemoved one of the string versions of getQualifiedNameAsString, and switched over...
Aaron Ballman [Fri, 3 Jan 2014 18:42:48 +0000 (18:42 +0000)]
Removed one of the string versions of getQualifiedNameAsString, and switched over to using printQualifiedName where possible. No functional changes intended.

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

10 years ago[objc] Refactor and improve functionality for the -Wunused-property-ivar warning.
Argyrios Kyrtzidis [Fri, 3 Jan 2014 18:32:18 +0000 (18:32 +0000)]
[objc] Refactor and improve functionality for the -Wunused-property-ivar warning.

- Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate
  all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor
- Don't check immediately after the method body is finished, check when the @implementation is finished.
  This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor.
- Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self.

rdar://15727325

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

10 years agoReformat the description strings. No functionality change.
Rafael Espindola [Fri, 3 Jan 2014 18:13:17 +0000 (18:13 +0000)]
Reformat the description strings. No functionality change.

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

10 years agoWe haven't cared about VS 2005 in a long time, and VS 2003 in even longer.
Aaron Ballman [Fri, 3 Jan 2014 18:10:25 +0000 (18:10 +0000)]
We haven't cared about VS 2005 in a long time, and VS 2003 in even longer.

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

10 years agoFixed a FIXME; created a print method for Selectors that accepts a raw_ostream, and...
Aaron Ballman [Fri, 3 Jan 2014 17:59:55 +0000 (17:59 +0000)]
Fixed a FIXME; created a print method for Selectors that accepts a raw_ostream, and started using it in places it made sense.

No functional changes intended, just API cleanliness.

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

10 years agoMake clang::ento::CreateAnalysisConsumer a part of a public interface of the static...
Alexander Kornienko [Fri, 3 Jan 2014 17:23:10 +0000 (17:23 +0000)]
Make clang::ento::CreateAnalysisConsumer a part of a public interface of the static analyzer.

Summary:
This allows for a better alternative to the FrontendAction hack used in
clang-tidy in order to get static analyzer's ASTConsumer.

Reviewers: jordan_rose, krememek

Reviewed By: jordan_rose

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

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

10 years agoSimplifying the mutual exclusion check now that the diagnostics engine knows how...
Aaron Ballman [Fri, 3 Jan 2014 16:23:46 +0000 (16:23 +0000)]
Simplifying the mutual exclusion check now that the diagnostics engine knows how to handle Attr objects directly. Updates an associated test case due to the attribute name being properly quoted again.

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

10 years ago[OpenCL] Add test case for previous commit.
Joey Gouly [Fri, 3 Jan 2014 15:11:57 +0000 (15:11 +0000)]
[OpenCL] Add test case for previous commit.

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

10 years agoUsing the proper helper function instead of manually doing this work. No functional...
Aaron Ballman [Fri, 3 Jan 2014 15:02:58 +0000 (15:02 +0000)]
Using the proper helper function instead of manually doing this work. No functional changes intended.

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

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 14:54:10 +0000 (14:54 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

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

10 years agoRemoving an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.
Aaron Ballman [Fri, 3 Jan 2014 14:48:20 +0000 (14:48 +0000)]
Removing an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.

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

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 14:23:03 +0000 (14:23 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

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

10 years ago[OpenCL] Variables in the constant address space must be initialized.
Joey Gouly [Fri, 3 Jan 2014 14:16:55 +0000 (14:16 +0000)]
[OpenCL] Variables in the constant address space must be initialized.

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

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 14:06:37 +0000 (14:06 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

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

10 years agoIt turns out the problem was a bit more wide-spread. Removing a lot of unneeded typec...
Aaron Ballman [Fri, 3 Jan 2014 13:56:08 +0000 (13:56 +0000)]
It turns out the problem was a bit more wide-spread. Removing a lot of unneeded typecasts. getScopeRep() already returns a NestedNameSpecifier.

No functional changes intended.

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

10 years agoRemoving an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.
Aaron Ballman [Fri, 3 Jan 2014 13:45:46 +0000 (13:45 +0000)]
Removing an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.

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

10 years agoRemoving some more unnecessary manual quotes from diagnostics. Updated the related...
Aaron Ballman [Fri, 3 Jan 2014 13:34:55 +0000 (13:34 +0000)]
Removing some more unnecessary manual quotes from diagnostics. Updated the related test case to ensure correctness.

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

10 years agoclang-format: Recognize single-line macro usages inside macros.
Daniel Jasper [Fri, 3 Jan 2014 11:50:46 +0000 (11:50 +0000)]
clang-format: Recognize single-line macro usages inside macros.

Before:
  #define LIST(L)                                                     \
    L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
        L(FifthElement)

After:
  #define LIST(L)    \
    L(FirstElement)  \
    L(SecondElement) \
    L(ThirdElement)  \
    L(FourthElement) \
    L(FifthElement)

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

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 02:20:27 +0000 (02:20 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

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

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 02:14:08 +0000 (02:14 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

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

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 02:07:43 +0000 (02:07 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

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

10 years ago[analyzer] Don't track return value of NSNull +null for retain/release tracking.
Ted Kremenek [Fri, 3 Jan 2014 01:19:28 +0000 (01:19 +0000)]
[analyzer] Don't track return value of NSNull +null for retain/release tracking.

Fixes <rdar://problem/12858915>.

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

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 01:09:27 +0000 (01:09 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

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

10 years agoRemove unused variable to fix clang warning
Reid Kleckner [Fri, 3 Jan 2014 00:36:32 +0000 (00:36 +0000)]
Remove unused variable to fix clang warning

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

10 years ago[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp
Reid Kleckner [Fri, 3 Jan 2014 00:14:35 +0000 (00:14 +0000)]
[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp

Summary:
No functionality change.

This code should live here long-term because we should be able to use it
to compute correct vftable names.

It turns out that the most natural way to implement the naming algorithm
is to use a caching layer similar to what we already have for virtual
table info in VTableContext.  Subsequent changes will take advantage of
this to fix PR17748, where we have a vbtable name collision.

Reviewers: majnemer

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

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

10 years agoRemoved an unnecessary %select from the alignas diagnostics. The attribute already...
Aaron Ballman [Thu, 2 Jan 2014 23:39:11 +0000 (23:39 +0000)]
Removed an unnecessary %select from the alignas diagnostics. The attribute already knows how it was spelled.

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

10 years agoThis diagnostic should not have had the manual quotation marks. Its only usage passed...
Aaron Ballman [Thu, 2 Jan 2014 23:22:40 +0000 (23:22 +0000)]
This diagnostic should not have had the manual quotation marks. Its only usage passed in an Attr object, which was already quoted when printing the diagnostic. However, there was no test case that caught this bug -- one has been added.

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

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics. Updated...
Aaron Ballman [Thu, 2 Jan 2014 23:15:58 +0000 (23:15 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics. Updated the associated testcase because QualType pretty printing was an improvement.

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

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Thu, 2 Jan 2014 23:02:01 +0000 (23:02 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

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

10 years agoReworded the NSObject attribute diagnostics to be more consistent with other attribut...
Aaron Ballman [Thu, 2 Jan 2014 22:45:33 +0000 (22:45 +0000)]
Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.

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

10 years agoObjectiveC. Remove false positive warning for missing property
Fariborz Jahanian [Thu, 2 Jan 2014 22:42:09 +0000 (22:42 +0000)]
ObjectiveC. Remove false positive warning for missing property
backing ivar by not issuing this warning if ivar is referenced
somewhere and accessor makes method calls. // rdar://15727325

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

10 years agoRemoving some manual quotes from this diagnostic, since the AST diagnostics engine...
Aaron Ballman [Thu, 2 Jan 2014 22:29:41 +0000 (22:29 +0000)]
Removing some manual quotes from this diagnostic, since the AST diagnostics engine knows how to handle NamedDecl objects.

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

10 years agoUpdated the wording of two attribute-related diagnostics so that they print the offen...
Aaron Ballman [Thu, 2 Jan 2014 21:26:14 +0000 (21:26 +0000)]
Updated the wording of two attribute-related diagnostics so that they print the offending attribute name. Also updates the associated test cases.

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

10 years agoObjective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.
Douglas Gregor [Thu, 2 Jan 2014 19:42:02 +0000 (19:42 +0000)]
Objective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.

Fixes <rdar://problem/15713945>.

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

10 years agoCMake separate projects: finish output-directory changes.
Douglas Gregor [Thu, 2 Jan 2014 18:37:47 +0000 (18:37 +0000)]
CMake separate projects: finish output-directory changes.

Make sure clang-tblgen, clang++, and clang-cl get created in the Clang
binary build directory.

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

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 18:28:32 +0000 (18:28 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

In a standalone build, Clang binaries should end up in Clang's build folder,
not LLVM's.

Xcode still has a few issues finding auxiliary tools and libraries in the
build folders. I'll fix those next.

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

10 years agoUsing the quoted version of an attribute name for consistency with other attribute...
Aaron Ballman [Thu, 2 Jan 2014 18:10:17 +0000 (18:10 +0000)]
Using the quoted version of an attribute name for consistency with other attribute diagnostics.

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

10 years agoObjectiveC. Class methods must be ignored when looking for
Fariborz Jahanian [Thu, 2 Jan 2014 17:24:32 +0000 (17:24 +0000)]
ObjectiveC. Class methods must be ignored when looking for
property accessor's missing backing ivar. This eliminates
the bogus warning being issued. // rdar://15728901

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

10 years agoAdd test for r198311.
Roman Divacky [Thu, 2 Jan 2014 17:18:03 +0000 (17:18 +0000)]
Add test for r198311.

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

10 years agoCMake: Unbreak separated LLVM/Clang project builds for Xcode.
Douglas Gregor [Thu, 2 Jan 2014 17:11:02 +0000 (17:11 +0000)]
CMake: Unbreak separated LLVM/Clang project builds for Xcode.

The separate Xcode project generated for Clang is putting the clang
executables into the same location where the LLVM executables are
going. This is wrong, and breaks the Clang build because we try to
create clang++ and clang-cl symlinks in the wrong place and to the
wrong place.

As a stop-gap to get these builds working again, teach the symlink
generation to point into the LLVM executable directory instead.

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

10 years agoRemove a tab that snuck in.
Roman Divacky [Thu, 2 Jan 2014 15:34:59 +0000 (15:34 +0000)]
Remove a tab that snuck in.

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

10 years agoIn the FreeBSD assembler driver, inform the sparc assembler that we're producing
Roman Divacky [Thu, 2 Jan 2014 15:13:18 +0000 (15:13 +0000)]
In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.

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

10 years agoAdded an option to avoid splitting certain kinds of comments into lines.
Alexander Kornienko [Thu, 2 Jan 2014 15:13:14 +0000 (15:13 +0000)]
Added an option to avoid splitting certain kinds of comments into lines.

Summary: Added CommentPragmas option for this.

Reviewers: djasper, klimek

Reviewed By: klimek

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

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

10 years agoVerify that clang TargetInfo descriptions match DataLayout strings from LLVM
Alp Toker [Thu, 2 Jan 2014 15:08:04 +0000 (15:08 +0000)]
Verify that clang TargetInfo descriptions match DataLayout strings from LLVM

The backend string is only verified when available as it's possible to run
clang IRGen for targets that haven't been built or don't exist in LLVM.

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

10 years agoRemove the now unused 's' specifications.
Rafael Espindola [Thu, 2 Jan 2014 14:06:59 +0000 (14:06 +0000)]
Remove the now unused 's' specifications.

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

10 years agoPass the aapcs and apcs features down to llvm.
Rafael Espindola [Thu, 2 Jan 2014 13:57:18 +0000 (13:57 +0000)]
Pass the aapcs and apcs features down to llvm.

No functionality change, but unblocks asserting that llvm's and clang's
datalayout strings are the same.

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

10 years ago[OpenCL] The kernel attribute can only be used on functions.
Joey Gouly [Thu, 2 Jan 2014 12:04:42 +0000 (12:04 +0000)]
[OpenCL] The kernel attribute can only be used on functions.

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

10 years agoUpdate the copyright credits -- Happy new year 2014!
NAKAMURA Takumi [Wed, 1 Jan 2014 08:27:31 +0000 (08:27 +0000)]
Update the copyright credits -- Happy new year 2014!

FIXME: Dragonegg may be updated at non-trivial changes.

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

10 years agoRemove an unused diag left over from r198046
Alp Toker [Wed, 1 Jan 2014 06:07:48 +0000 (06:07 +0000)]
Remove an unused diag left over from r198046

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

10 years agoEliminate UnaryTypeTraitExpr
Alp Toker [Wed, 1 Jan 2014 05:57:51 +0000 (05:57 +0000)]
Eliminate UnaryTypeTraitExpr

Remove UnaryTypeTraitExpr and switch all remaining type trait related handling
over to TypeTraitExpr.

The UTT/BTT/TT enum prefix and evaluation code is retained pending further
cleanup.

This is part of the ongoing work to unify type traits following the removal of
BinaryTypeTraitExpr in r197273.

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

10 years agoExpectAndConsume: Diagnose errors automatically
Alp Toker [Wed, 1 Jan 2014 03:08:43 +0000 (03:08 +0000)]
ExpectAndConsume: Diagnose errors automatically

 1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics
    using the generic diagnostic descriptions added in r197972, eliminating another
    set of trivial err_expected_* variations while maintaining existing behaviour.

 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume
    family of functions are primitive parser operations that now have the
    well-defined property of operating on single tokens. Factoring out recovery
    exposes opportunities for more consistent and tailored error recover at the
    call sites instead of just relying on a bottled SkipUntil formula.

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

10 years ago[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.
Joey Gouly [Tue, 31 Dec 2013 15:47:49 +0000 (15:47 +0000)]
[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.

Patch by joey.gouly@arm.com

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

10 years agoRecover from errors in enum definition
Serge Pavlov [Tue, 31 Dec 2013 06:26:03 +0000 (06:26 +0000)]
Recover from errors in enum definition

Previously any error in enum definition body stopped parsing it. With this
change parser tries to recover from errors.
The patch fixes PR10982.

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

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

10 years agoSilence g++ 4.9 build issue
Alp Toker [Tue, 31 Dec 2013 03:16:57 +0000 (03:16 +0000)]
Silence g++ 4.9 build issue

lib/ASTMatchers/ASTMatchFinder.cpp:276:28: error: typedef 'traverse_can_only_be_instantiated_with_base_type' locally defined but not used [-Werror=unused-local-typedefs]
                            traverse_can_only_be_instantiated_with_base_type);

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

10 years agoSwitch over more of the parser to err_expected
Alp Toker [Mon, 30 Dec 2013 23:29:50 +0000 (23:29 +0000)]
Switch over more of the parser to err_expected

Includes a fix for a missing highlight range caused by a ',' typo in the PP
diagnostics.

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

10 years agoUpdate DataRecursiveASTVisitor so that it visits attributes.
DeLesley Hutchins [Mon, 30 Dec 2013 21:03:02 +0000 (21:03 +0000)]
Update DataRecursiveASTVisitor so that it visits attributes.

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