]> granicus.if.org Git - clang/log
clang
11 years agoConstify the ASTContext& passed to Stmt creation functions. Also constify the context...
Craig Topper [Thu, 22 Aug 2013 05:28:54 +0000 (05:28 +0000)]
Constify the ASTContext& passed to Stmt creation functions. Also constify the context in couple other functions that are called from creation functions.

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

11 years agoConstify the ASTContext& passed to Expr creation functions. Also constify the context...
Craig Topper [Thu, 22 Aug 2013 04:58:56 +0000 (04:58 +0000)]
Constify the ASTContext& passed to Expr creation functions. Also constify the context in couple other functions that are called from creation functions.

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

11 years agoAdd test cases for avx512 feature flags. Fix typo in avx512pf options.
Craig Topper [Thu, 22 Aug 2013 04:32:55 +0000 (04:32 +0000)]
Add test cases for avx512 feature flags. Fix typo in avx512pf options.

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

11 years agoRemove some unused variables identified by Juergen Ributzka *I need to turn on this...
Faisal Vali [Thu, 22 Aug 2013 02:13:38 +0000 (02:13 +0000)]
Remove some unused variables identified by Juergen Ributzka *I need to turn on this warning in Visual C++ - sorry!*

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

11 years agoImplement a rudimentary form of generic lambdas.
Faisal Vali [Thu, 22 Aug 2013 01:49:11 +0000 (01:49 +0000)]
Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
  - any sort of capturing within generic lambdas
  - nested lambdas
  - conversion operator for captureless lambdas
  - ensuring all visitors are generic lambda aware

As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
    using F1::operator();
    using F2::operator();
    overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
  };

  auto Recursive = [](auto Self, auto h, auto ... rest) {
    return 1 + Self(Self, rest...);
  };
  auto Base = [](auto Self, auto h) {
      return 1;
  };
  overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
  int num_params =  O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

  - Add a new Declarator context => LambdaExprParameterContext to
    clang::Declarator to allow the use of 'auto' in declaring generic
    lambda parameters

  - Augment AutoType's constructor (similar to how variadic
    template-type-parameters ala TemplateTypeParmDecl are implemented) to
    accept an IsParameterPack to encode a generic lambda parameter pack.

  - Add various helpers to CXXRecordDecl to facilitate identifying
    and querying a closure class

  - LambdaScopeInfo (which maintains the current lambda's Sema state)
    was augmented to house the current depth of the template being
    parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
    so that Sema::ActOnLambdaAutoParameter may use it to create the
    appropriate list of corresponding TemplateTypeParmDecl for each
    auto parameter identified within the generic lambda (also stored
    within the current LambdaScopeInfo).  Additionally,
    a TemplateParameterList data-member was added to hold the invented
    TemplateParameterList AST node which will be much more useful
    once we teach TreeTransform how to transform generic lambdas.

  - SemaLambda.h was added to hold some common lambda utility
    functions (this file is likely to grow ...)

  - Teach Sema::ActOnStartOfFunctionDef to check whether it
    is being called to instantiate a generic lambda's call
    operator, and if so, push an appropriately prepared
    LambdaScopeInfo object on the stack.

  - Teach Sema::ActOnStartOfLambdaDefinition to set the
    return type of a lambda without a trailing return type
    to 'auto' in C++1y mode, and teach the return type
    deduction machinery in SemaStmt.cpp to process either
    C++11 and C++14 lambda's correctly depending on the flag.

  - various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,
James Dennett and the ever illuminating Richard Smith.  And
yet I am certain that I have allowed unidentified bugs to creep in;
bugs, that I will do my best to slay, once identified!

Thanks!

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

11 years agoAdd a constexpr functionality test for static data member templates.
Larisse Voufo [Thu, 22 Aug 2013 01:05:27 +0000 (01:05 +0000)]
Add a constexpr functionality test for static data member templates.

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

11 years agoRefactor for clarity and simplicity.
Larisse Voufo [Thu, 22 Aug 2013 00:59:14 +0000 (00:59 +0000)]
Refactor for clarity and simplicity.

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

11 years agoImprove support for static data member templates. This revision still has at least...
Larisse Voufo [Thu, 22 Aug 2013 00:28:27 +0000 (00:28 +0000)]
Improve support for static data member templates. This revision still has at least one bug, as it does not respect the variable template specialization hierarchy well.

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

11 years agoSplit isFromMainFile into two functions.
Eli Friedman [Thu, 22 Aug 2013 00:27:10 +0000 (00:27 +0000)]
Split isFromMainFile into two functions.

Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't.  Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

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

11 years agoDebugInfo: Require only the declaration of types only used as parameter and return...
David Blaikie [Wed, 21 Aug 2013 23:23:07 +0000 (23:23 +0000)]
DebugInfo: Require only the declaration of types only used as parameter and return types

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

11 years agoReduce sizeof(TemplateArgument) from 32 to 24.
Eli Friedman [Wed, 21 Aug 2013 23:05:56 +0000 (23:05 +0000)]
Reduce sizeof(TemplateArgument) from 32 to 24.

No intended functionality change.

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

11 years agoUpdated the consumed analysis warnings to use a more standardized diagnostic.
Aaron Ballman [Wed, 21 Aug 2013 22:07:20 +0000 (22:07 +0000)]
Updated the consumed analysis warnings to use a more standardized diagnostic.

Patch thanks to Christian Wailes!

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

11 years agoMove -mfpmath handling to -cc1 and implement it for x86.
Rafael Espindola [Wed, 21 Aug 2013 21:59:03 +0000 (21:59 +0000)]
Move -mfpmath handling to -cc1 and implement it for x86.

The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

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

11 years agoAnalysis: Add support for MS specific printf format specifiers
David Majnemer [Wed, 21 Aug 2013 21:54:46 +0000 (21:54 +0000)]
Analysis: Add support for MS specific printf format specifiers

Summary: Adds support for %I, %I32 and %I64.

Reviewers: hans, jordan_rose, rnk, majnemer

Reviewed By: majnemer

CC: cfe-commits, cdavis5x
Differential Revision: http://llvm-reviews.chandlerc.com/D1456

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

11 years agoRemoved unnecessary asserts.
Aaron Ballman [Wed, 21 Aug 2013 21:38:46 +0000 (21:38 +0000)]
Removed unnecessary asserts.

Patch thanks to Christian Wailes!

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

11 years agoTBAA: add testing case to check typedef can alias.
Manman Ren [Wed, 21 Aug 2013 21:00:10 +0000 (21:00 +0000)]
TBAA: add testing case to check typedef can alias.

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

11 years agoDon't use mangleCXXRTTIName in TBAA for C code.
Manman Ren [Wed, 21 Aug 2013 20:58:45 +0000 (20:58 +0000)]
Don't use mangleCXXRTTIName in TBAA for C code.

With r185721, calling mangleCXXRTTIName on C code will cause crashes.
This commit fixes crashes on C testing cases when turning on struct-path TBAA.

For C code, we simply use the Decl name without the context. This can
cause two different structs having the same name, and may cause inaccurate but
conservative alias results.

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

11 years agoUpdate testing case to use FileCheck instead of grep.
Manman Ren [Wed, 21 Aug 2013 20:53:05 +0000 (20:53 +0000)]
Update testing case to use FileCheck instead of grep.

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

11 years agoObjectibeC migrator. Annotate cf_consumed arguments,
Fariborz Jahanian [Wed, 21 Aug 2013 19:37:47 +0000 (19:37 +0000)]
ObjectibeC migrator. Annotate cf_consumed arguments,
as reported by static analyer API with CF_CONSUMED.

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

11 years agoFix the end sourcelocation of the call expression in a member access when
Nick Lewycky [Wed, 21 Aug 2013 19:09:44 +0000 (19:09 +0000)]
Fix the end sourcelocation of the call expression in a member access when
recovering by adding empty parenthesis. Fixes PR16676!

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

11 years agoRevert r188863 which could propose wrong fixits for multibyte character literals.
Nick Lewycky [Wed, 21 Aug 2013 18:57:51 +0000 (18:57 +0000)]
Revert r188863 which could propose wrong fixits for multibyte character literals.

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

11 years agoObjectiveC migrator: until we have beter understanding of
Fariborz Jahanian [Wed, 21 Aug 2013 18:49:03 +0000 (18:49 +0000)]
ObjectiveC migrator: until we have beter understanding of
setter/getter implementations, migrate them to
nonatomic properties.

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

11 years agoRemove dead code.
Rafael Espindola [Wed, 21 Aug 2013 18:13:43 +0000 (18:13 +0000)]
Remove dead code.

setFeatureEnabled is never called with "32" or "64". The driver never passes it
and mips' getDefaultFeatures sets the Features map directly.

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

11 years agoMove the logic for selecting the last feature in the command line to the driver.
Rafael Espindola [Wed, 21 Aug 2013 17:34:32 +0000 (17:34 +0000)]
Move the logic for selecting the last feature in the command line to the driver.

This is a partial revert of r188817 now that the driver handles -target-feature
in a single place.

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

11 years ago[CGF] Get rid of passing redundant VTable pointer around in CodeGenFunction::Initiali...
Timur Iskhodzhanov [Wed, 21 Aug 2013 17:33:16 +0000 (17:33 +0000)]
[CGF] Get rid of passing redundant VTable pointer around in CodeGenFunction::InitializeVTablePointer[s]

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

11 years agoCentralize the handling of -target-feature.
Rafael Espindola [Wed, 21 Aug 2013 16:39:20 +0000 (16:39 +0000)]
Centralize the handling of -target-feature.

No functionality change other than changing the order of -target-feature
relative to other -cc1 command line arguments.

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

11 years agoTweak gnu-flags.c test for z, where globals have 2-byte alignment by default
Richard Sandiford [Wed, 21 Aug 2013 16:37:37 +0000 (16:37 +0000)]
Tweak gnu-flags.c test for z, where globals have 2-byte alignment by default

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

11 years agoDon't disable SSE4A when disabling AVX.
Rafael Espindola [Wed, 21 Aug 2013 13:28:02 +0000 (13:28 +0000)]
Don't disable SSE4A when disabling AVX.

Thanks for Craig Topper for noticing it.

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

11 years agoSema: Use the right type for PredefinedExpr when it's in a lambda.
Benjamin Kramer [Wed, 21 Aug 2013 11:45:27 +0000 (11:45 +0000)]
Sema: Use the right type for PredefinedExpr when it's in a lambda.

1. We now print the return type of lambdas and return type deduced functions
as "auto". Trailing return types with decltype print the underlying type.
2. Use the lambda or block scope for the PredefinedExpr type instead of the
parent function. This fixes PR16946, a strange mismatch between type of the
expression and the actual result.
3. Verify the type in CodeGen.
4. The type for blocks is still wrong. They are numbered and the name is not
known until CodeGen.

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

11 years agoclang-format: Indent relative to unary operators.
Daniel Jasper [Wed, 21 Aug 2013 08:39:01 +0000 (08:39 +0000)]
clang-format: Indent relative to unary operators.

Before:
  if (!aaaaaaaaaa(  // break
          aaaaa)) {
  }

After:
  if (!aaaaaaaaaa(  // break
           aaaaa)) {
  }

Also cleaned up formatting using clang-format.

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

11 years agoAbstract out virtual calls and virtual function prologue code generation; implement...
Timur Iskhodzhanov [Wed, 21 Aug 2013 06:25:03 +0000 (06:25 +0000)]
Abstract out virtual calls and virtual function prologue code generation; implement them for -cxx-abi microsoft

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

11 years agoAdd avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.
Craig Topper [Wed, 21 Aug 2013 05:29:10 +0000 (05:29 +0000)]
Add avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.

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

11 years agoIssue fixits replacing invalid character literals with the equivalent \xNN
Nick Lewycky [Wed, 21 Aug 2013 04:10:58 +0000 (04:10 +0000)]
Issue fixits replacing invalid character literals with the equivalent \xNN
escape code.

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

11 years agoRevert accidental commit.
Craig Topper [Wed, 21 Aug 2013 04:01:01 +0000 (04:01 +0000)]
Revert accidental commit.

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

11 years agoRevert accidental commit.
Craig Topper [Wed, 21 Aug 2013 04:00:44 +0000 (04:00 +0000)]
Revert accidental commit.

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

11 years agoReplace avx-512 with avx512f to match llvm side and what gcc patches appear to be...
Craig Topper [Wed, 21 Aug 2013 03:59:22 +0000 (03:59 +0000)]
Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using.

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

11 years agoNo functionality change. Adjust a bunch of formatting issues in this code and
Nick Lewycky [Wed, 21 Aug 2013 02:40:19 +0000 (02:40 +0000)]
No functionality change. Adjust a bunch of formatting issues in this code and
fix a typo in a comment.

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

11 years agoRemove more uses of 'index' as namespace scope.
Argyrios Kyrtzidis [Wed, 21 Aug 2013 01:51:19 +0000 (01:51 +0000)]
Remove more uses of 'index' as namespace scope.

Follow up to r188850.

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

11 years agoIf we find an error in the range expression in a range-based for loop, and the
Richard Smith [Wed, 21 Aug 2013 01:40:36 +0000 (01:40 +0000)]
If we find an error in the range expression in a range-based for loop, and the
loop variable has a type containing 'auto', set the declaration to be invalid
(because we couldn't deduce its type) to prevent follow-on errors.

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

11 years agoAvoid using the 'index' namespace as scope.
Argyrios Kyrtzidis [Wed, 21 Aug 2013 00:49:25 +0000 (00:49 +0000)]
Avoid using the 'index' namespace as scope.

This should fix the bogus ambiguous reference errors reported by gcc 4.2.1 that the FreeBSD bot is using.

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

11 years agoObjectiveC migrator. make sure to embed audited
Fariborz Jahanian [Tue, 20 Aug 2013 23:35:26 +0000 (23:35 +0000)]
ObjectiveC migrator. make sure to embed audited
candidate functions in their CF_IMPLICIT_BRIDGING_ENABLED
pragma before exiting the header file.

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

11 years agoRemove Extension warning for GNU local labels.
Eli Friedman [Tue, 20 Aug 2013 22:44:32 +0000 (22:44 +0000)]
Remove Extension warning for GNU local labels.

We generally don't warn about extensions involving keywords reserved
for the implementation, so we shouldn't warn here either: the
standard doesn't require it, and it doesn't provide useful information
to the user.

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

11 years agoAdd more specific flags for misc GNU extensions.
Eli Friedman [Tue, 20 Aug 2013 22:44:28 +0000 (22:44 +0000)]
Add more specific flags for misc GNU extensions.

This adds the following as subgroups of -Wgnu: -Wgnu-alignof-expression,
-Wgnu-case-range, -Wgnu-complex-integer, -Wgnu-conditional-omitted-operand,
-Wgnu-empty-initializer, -Wgnu-label-as-value, -Wgnu-local-label,
and -Wgnu-statement-expression,

Patch by Peter Lewis.

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

11 years agoObjectiveC migrator: make sure audited pragams are
Fariborz Jahanian [Tue, 20 Aug 2013 22:42:13 +0000 (22:42 +0000)]
ObjectiveC migrator: make sure audited pragams are
dumped for last declarations in the current TU. wip.

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

11 years agoCentralize the handling of -target-cpu (-cc1, -cc1as) and -mcpu (gold plugin).
Rafael Espindola [Tue, 20 Aug 2013 22:12:08 +0000 (22:12 +0000)]
Centralize the handling of -target-cpu (-cc1, -cc1as) and -mcpu (gold plugin).

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

11 years agoTest case for PR16933/r188707.
David Blaikie [Tue, 20 Aug 2013 22:01:44 +0000 (22:01 +0000)]
Test case for PR16933/r188707.

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

11 years agoFix iterator invalidation. PR16935.
Eli Friedman [Tue, 20 Aug 2013 22:01:43 +0000 (22:01 +0000)]
Fix iterator invalidation. PR16935.

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

11 years agoDebugInfo: comment/inlining based on feedback from Eric & Adrian
David Blaikie [Tue, 20 Aug 2013 21:49:21 +0000 (21:49 +0000)]
DebugInfo: comment/inlining based on feedback from Eric & Adrian

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

11 years agoLook at lowercase version of argv[0] when determining driver mode
Hans Wennborg [Tue, 20 Aug 2013 21:47:50 +0000 (21:47 +0000)]
Look at lowercase version of argv[0] when determining driver mode

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

11 years agoDebugInfo: Simplify/clarify propagation of typemembers between declaration and definition
David Blaikie [Tue, 20 Aug 2013 21:03:29 +0000 (21:03 +0000)]
DebugInfo: Simplify/clarify propagation of typemembers between declaration and definition

Based on code review feedback from Eric Christopher (on r188739) and
Adrian Prantl (r188642).

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

11 years agoObjectiveC migrator: More tweaking of heuristics
Fariborz Jahanian [Tue, 20 Aug 2013 20:45:28 +0000 (20:45 +0000)]
ObjectiveC migrator: More tweaking of heuristics
for an audited cf function to not include those
which are annotated by user.

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

11 years agoDuring typo correction, check for an exact match in an unimported module. If we
Richard Smith [Tue, 20 Aug 2013 20:35:18 +0000 (20:35 +0000)]
During typo correction, check for an exact match in an unimported module. If we
find one, then report the error as a missing import instead of as a typo.

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

11 years agoAdding Replacement serialization support
Edwin Vane [Tue, 20 Aug 2013 19:07:21 +0000 (19:07 +0000)]
Adding Replacement serialization support

Adding a new data structure for storing the Replacements generated for a single
translation unit. Structure contains a vector of Replacements as well a field
indicating the main source file of the translation unit. An optional 'Context'
field allows for tools to provide any information they want about the context
the Replacements were generated in. This context is printed, for example, when
detecting conflicts during Replacement deduplication.

YAML serialization for this data structure is implemented in this patch. Tests
are included.

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

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

11 years agoCentralize the logic for handling -m* options and fix pr16943.
Rafael Espindola [Tue, 20 Aug 2013 18:57:55 +0000 (18:57 +0000)]
Centralize the logic for handling -m* options and fix pr16943.

This moves the logic for handling -mfoo -mno-foo from the driver to -cc1. It
also changes -cc1 to apply the options in order, fixing pr16943.

The handling of -mno-mmx -msse is now an explicit special case.

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

11 years agoObjectiveC migrator: More tweaking of heuristics
Fariborz Jahanian [Tue, 20 Aug 2013 18:54:39 +0000 (18:54 +0000)]
ObjectiveC migrator: More tweaking of heuristics
for an audited cf function and addition of
a test case.

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

11 years agoRemove duplicated error checking.
Rafael Espindola [Tue, 20 Aug 2013 15:30:32 +0000 (15:30 +0000)]
Remove duplicated error checking.

The driver validates its options, so we don't need to redo the work in
"clang -cc1".

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

11 years ago[LSan] Add support for building standalone LSan runtime to Make build (clang part)
Alexey Samsonov [Tue, 20 Aug 2013 14:49:36 +0000 (14:49 +0000)]
[LSan] Add support for building standalone LSan runtime to Make build (clang part)

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

11 years agoRemove dead code.
Rafael Espindola [Tue, 20 Aug 2013 14:18:24 +0000 (14:18 +0000)]
Remove dead code.

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

11 years agoRefactor the x86 feature handling.
Rafael Espindola [Tue, 20 Aug 2013 13:44:29 +0000 (13:44 +0000)]
Refactor the x86 feature handling.

This removes the very long chains of
Feature["avx"] = Feature["sse42"] = ... = true;

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

11 years agoARM: add test for last commit
Tim Northover [Tue, 20 Aug 2013 13:19:43 +0000 (13:19 +0000)]
ARM: add test for last commit

This time I managed to forget the test.

Patch still by Stephen Kelly.

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

11 years agoARM: default to arm1176jzf-s for hard-float platforms.
Tim Northover [Tue, 20 Aug 2013 13:13:38 +0000 (13:13 +0000)]
ARM: default to arm1176jzf-s for hard-float platforms.

It makes no sense to try and compile for arm7tdmi when we're targeting
something like gnueabihf. Although not strictly the most basic hardware
conceivable, I believe arm1176jzf-s is a reasonable compromise (that can always
be overridden explicitly if needed) since it's still in reasonably common use
unlike earlier cores.

Patch by Stephen Kelly.

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

11 years agoclang-format: Format enum struct/class like enum.
Daniel Jasper [Tue, 20 Aug 2013 12:42:50 +0000 (12:42 +0000)]
clang-format: Format enum struct/class like enum.

Patch by Joe Hermaszewski. Thank you!

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

11 years agoclang-format: Additional options for spaces around parentheses.
Daniel Jasper [Tue, 20 Aug 2013 12:36:34 +0000 (12:36 +0000)]
clang-format: Additional options for spaces around parentheses.

This patch adds four new options to control:
- Spaces after control keyworks (if(..) vs if (..))
- Spaces in empty parentheses (f( ) vs f())
- Spaces in c-style casts (( int )1.0 vs (int)1.0)
- Spaces in other parentheses (f(a) vs f( a ))

Patch by Joe Hermaszewski. Thank you for working on this!

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

11 years agoARCMigrate depends on the static analyzer.
Benjamin Kramer [Tue, 20 Aug 2013 12:33:59 +0000 (12:33 +0000)]
ARCMigrate depends on the static analyzer.

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

11 years agoclang/test/Driver/cl-options.c: Remove the feature "clang-driver". It has been workin...
NAKAMURA Takumi [Tue, 20 Aug 2013 12:16:48 +0000 (12:16 +0000)]
clang/test/Driver/cl-options.c: Remove the feature "clang-driver". It has been working since r188331.

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

11 years agoclang/test/Driver: Remove the feature "clang-driver" since gcc-as has not been used...
NAKAMURA Takumi [Tue, 20 Aug 2013 12:16:42 +0000 (12:16 +0000)]
clang/test/Driver: Remove the feature "clang-driver" since gcc-as has not been used with -integrated-as since r177360.

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

11 years agoclang/test/Driver: Remove the feature "clang-driver" in three tests since they might...
NAKAMURA Takumi [Tue, 20 Aug 2013 12:16:35 +0000 (12:16 +0000)]
clang/test/Driver: Remove the feature "clang-driver" in three tests since they might work as expected since their first commit.

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

11 years ago[mips][msa] Added fexdo, fexup[lr] builtins
Daniel Sanders [Tue, 20 Aug 2013 09:47:12 +0000 (09:47 +0000)]
[mips][msa] Added fexdo, fexup[lr] builtins

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

11 years agoRename __AVX512__ to __AVX512F__
Craig Topper [Tue, 20 Aug 2013 07:52:37 +0000 (07:52 +0000)]
Rename __AVX512__ to __AVX512F__

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

11 years ago[autotools->cmake] Added support for building clang with an order file.
Michael Gottesman [Tue, 20 Aug 2013 07:41:18 +0000 (07:41 +0000)]
[autotools->cmake] Added support for building clang with an order file.

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

11 years agoChange 'avx512' to 'avx-512' to match llvm backend.
Craig Topper [Tue, 20 Aug 2013 07:39:54 +0000 (07:39 +0000)]
Change 'avx512' to 'avx-512' to match llvm backend.

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

11 years ago[autotools->cmake] Move add_subdirectory(test) inside CLANG_INCLUDE_TESTS to match...
Michael Gottesman [Tue, 20 Aug 2013 07:09:54 +0000 (07:09 +0000)]
[autotools->cmake] Move add_subdirectory(test) inside CLANG_INCLUDE_TESTS to match the behavior of the LLVM where LLVM_INCLUDE_TESTS controls whether tests is included.

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

11 years ago[autotools->cmake] Added support for creating the clang driver plist for OS X.
Michael Gottesman [Tue, 20 Aug 2013 07:09:51 +0000 (07:09 +0000)]
[autotools->cmake] Added support for creating the clang driver plist for OS X.

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

11 years agoAdd AVX-512 feature flag and knl cpu to clang.
Craig Topper [Tue, 20 Aug 2013 07:09:39 +0000 (07:09 +0000)]
Add AVX-512 feature flag and knl cpu to clang.

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

11 years agoRevert r188756 because some other changes snuck in with it.
Craig Topper [Tue, 20 Aug 2013 07:07:29 +0000 (07:07 +0000)]
Revert r188756 because some other changes snuck in with it.

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

11 years agoAdd AVX-512 feature flag and knl cpu to clang.
Craig Topper [Tue, 20 Aug 2013 07:05:05 +0000 (07:05 +0000)]
Add AVX-512 feature flag and knl cpu to clang.

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

11 years agoRevert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in...
David Blaikie [Tue, 20 Aug 2013 01:28:15 +0000 (01:28 +0000)]
Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class""""

This reverts commit r188687 (reverts r188642 (reverts 188600 (reverts
188576))).

With added test coverage & fix for -gline-tables-only.

Thanks Michael Gottesman for reverting this patch when it demonstrated
problems & providing a reproduction/details to help me track this down.

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

11 years agoFix name lookup with dependent using decls.
Eli Friedman [Tue, 20 Aug 2013 00:39:40 +0000 (00:39 +0000)]
Fix name lookup with dependent using decls.

We previously mishandled UnresolvedUsingValueDecls in
NamedDecl::declarationReplaces, which caused us to forget decls
when there are multiple dependent using decls for the same name.

Fixes PR16936.

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

11 years agoObjectiveC migrator: More work towards
Fariborz Jahanian [Tue, 20 Aug 2013 00:07:23 +0000 (00:07 +0000)]
ObjectiveC migrator: More work towards
insertion of ObjC audit pragmas.

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

11 years agoclang-cl: Ignore the /wd n flag for disabling a warning
Reid Kleckner [Mon, 19 Aug 2013 23:57:44 +0000 (23:57 +0000)]
clang-cl: Ignore the /wd n flag for disabling a warning

Clang doesn't have a table mapping cl.exe to clang warnings.  While some
warnings like -Wsign-compare exist in both compilers, the majority do
not correspond and should usually be ignored.

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

11 years ago[analyzer] Note that deadcode.UnmodifiedVariable would be an opt-in checker.
Jordan Rose [Mon, 19 Aug 2013 23:54:35 +0000 (23:54 +0000)]
[analyzer] Note that deadcode.UnmodifiedVariable would be an opt-in checker.

Website-only change.

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

11 years agoclang-cl: Add /MP[n] to the list of unsupported and ignored flags
Reid Kleckner [Mon, 19 Aug 2013 23:52:36 +0000 (23:52 +0000)]
clang-cl: Add /MP[n] to the list of unsupported and ignored flags

This flag tells cl.exe to use up to n processes to compile the provided
source files.  I have no plans to implement this in clang.

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

11 years agoFix last commit.
Juergen Ributzka [Mon, 19 Aug 2013 23:08:53 +0000 (23:08 +0000)]
Fix last commit.

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

11 years agoSimplify code by using CreateMemTemp. No functional change intended.
Juergen Ributzka [Mon, 19 Aug 2013 22:20:37 +0000 (22:20 +0000)]
Simplify code by using CreateMemTemp. No functional change intended.

Reviewer: Eli

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

11 years agoHandle init lists and _Atomic fields.
Eli Friedman [Mon, 19 Aug 2013 22:12:56 +0000 (22:12 +0000)]
Handle init lists and _Atomic fields.

Fixes PR16931.

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

11 years agoPR16727: don't try to evaluate a potentially value-dependent expression when
Richard Smith [Mon, 19 Aug 2013 22:06:05 +0000 (22:06 +0000)]
PR16727: don't try to evaluate a potentially value-dependent expression when
checking for missing parens in &&/|| expressions.

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

11 years agoObjectiveC migrator: Start inserting
Fariborz Jahanian [Mon, 19 Aug 2013 22:00:50 +0000 (22:00 +0000)]
ObjectiveC migrator: Start inserting
CF_IMPLICIT_BRIDGING_ENABLE/CF_IMPLICIT_BRIDGING_DISABLED
pair. wip.

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

11 years agoPR16933: Don't try to codegen things after we've seen errors.
David Blaikie [Mon, 19 Aug 2013 21:02:26 +0000 (21:02 +0000)]
PR16933: Don't try to codegen things after we've seen errors.

Refactor the underlying code a bit to remove unnecessary calls to
"hasErrorOccurred" & make them consistently at all the entry points to
the IRGen ASTConsumer.

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

11 years agoconst'ify Sema::ActOnCompoundStmt by
Robert Wilhelm [Mon, 19 Aug 2013 20:51:20 +0000 (20:51 +0000)]
const'ify Sema::ActOnCompoundStmt by
changing Parameter of Sema::ActOnCompoundStmt from MutableArrayRef to
ArrayRef.
No functionality change intended.

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

11 years agoBump the value of the __APPLE_CC__ predefined macro up to 6000.
Bob Wilson [Mon, 19 Aug 2013 20:23:37 +0000 (20:23 +0000)]
Bump the value of the __APPLE_CC__ predefined macro up to 6000.

The previous value was set to match some ancient version of Apple's GCC.
The value should be higher than anything used by Apple's GCC, but we don't
intend for this value to be updated in the future. We have other macros to
identify compiler versions. <rdar://problem/14749599>

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

11 years agoObjectiveC migrator. Start auditing CF functions
Fariborz Jahanian [Mon, 19 Aug 2013 19:13:34 +0000 (19:13 +0000)]
ObjectiveC migrator. Start auditing CF functions
for possible use of CF_IMPLICIT_BRIDGING_ENABLE
pragma.

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

11 years agoRevert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that...
Michael Gottesman [Mon, 19 Aug 2013 18:46:16 +0000 (18:46 +0000)]
Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class"""

This reverts commit r188642.

This change is causing LTO builds to cause our 16 GB machines to swap and OOM
all weekend. I am going to work with Dave Blaikie to resolve the issue.

Sorry Dave =(.

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

11 years agoSimplify assert-neutral matching in test case.
David Blaikie [Mon, 19 Aug 2013 18:35:25 +0000 (18:35 +0000)]
Simplify assert-neutral matching in test case.

Originally committed in r188651, improved/fixed to be assert-neutral by
Takumi in r188661.

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

11 years agoclang-cl: Expose the -Xclang option
Hans Wennborg [Mon, 19 Aug 2013 18:32:59 +0000 (18:32 +0000)]
clang-cl: Expose the -Xclang option

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

11 years ago[analyzer] Add a triple to test/Analysis/cfg.cpp
Jordan Rose [Mon, 19 Aug 2013 17:46:55 +0000 (17:46 +0000)]
[analyzer] Add a triple to test/Analysis/cfg.cpp

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

11 years ago[analyzer] Don't run unreachable code checker on inlined functions.
Jordan Rose [Mon, 19 Aug 2013 17:03:12 +0000 (17:03 +0000)]
[analyzer] Don't run unreachable code checker on inlined functions.

This is still an alpha checker, but we use it in certain tests to make sure
something is not being executed.

This should fix the buildbots.

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

11 years ago[analyzer] Add "unmodified variable" checker to the Potential Checkers.
Jordan Rose [Mon, 19 Aug 2013 16:27:37 +0000 (16:27 +0000)]
[analyzer] Add "unmodified variable" checker to the Potential Checkers.

This is PR16890.

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

11 years ago[analyzer] Assume that strings are no longer than SIZE_MAX/4.
Jordan Rose [Mon, 19 Aug 2013 16:27:34 +0000 (16:27 +0000)]
[analyzer] Assume that strings are no longer than SIZE_MAX/4.

This keeps the analyzer from making silly assumptions, like thinking
strlen(foo)+1 could wrap around to 0. This fixes PR16558.

Patch by Karthik Bhat!

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

11 years agoOmit arguments of __builtin_object_size from the CFG.
Jordan Rose [Mon, 19 Aug 2013 16:27:28 +0000 (16:27 +0000)]
Omit arguments of __builtin_object_size from the CFG.

This builtin does not actually evaluate its arguments for side effects,
so we shouldn't include them in the CFG. In the analyzer, rely on the
constant expression evaluator to get the proper semantics, at least for
now. (In the future, we could get ambitious and try to provide path-
sensitive size values.)

In theory, this does pose a problem for liveness analysis: a variable can
be used within the __builtin_object_size argument expression but not show
up as live. However, it is very unlikely that such a value would be used
to compute the object size and not used to access the object in some way.

<rdar://problem/14760817>

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

11 years agoUse cstdio instead of stdio.h
Dmitri Gribenko [Mon, 19 Aug 2013 16:14:33 +0000 (16:14 +0000)]
Use cstdio instead of stdio.h

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