]> granicus.if.org Git - clang/log
clang
13 years agoRename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
John McCall [Mon, 6 Dec 2010 08:20:24 +0000 (08:20 +0000)]
Rename CXXExprWithTemporaries -> ExprWithCleanups;  there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.

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

13 years ago__block variables require us to evaluate the RHS of an assignment before
John McCall [Mon, 6 Dec 2010 06:10:02 +0000 (06:10 +0000)]
__block variables require us to evaluate the RHS of an assignment before
the LHS, or else the pointer might be invalid.  This is kindof dumb, but
go ahead and make sure we're doing that for l-value scalar assignment,
which fixes a miscompile of obj-c++.dg/block-seq.mm.

Leave a FIXME for how to solve this problem for agg __blocks.

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

13 years agoClarify the logic for when to build an overloaded binop. In particular,
John McCall [Mon, 6 Dec 2010 05:26:58 +0000 (05:26 +0000)]
Clarify the logic for when to build an overloaded binop.  In particular,
build one when either of the operands calls itself type-dependent;
previously we were building when one of the operand types was dependent,
which is not always the same thing and which can lead to unfortunate
inconsistencies later.  Fixes PR8739.

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

13 years agoMark SVal constructors 'explicit'.
Ted Kremenek [Sun, 5 Dec 2010 23:36:20 +0000 (23:36 +0000)]
Mark SVal constructors 'explicit'.

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

13 years agoRename Environment::LookupExpr() to
Ted Kremenek [Sun, 5 Dec 2010 23:36:15 +0000 (23:36 +0000)]
Rename Environment::LookupExpr() to
Environment::lookupExpr() and move its implementation
out-of-line.

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

13 years agoRemove unused method GRState::LookupExpr().
Ted Kremenek [Sun, 5 Dec 2010 23:36:01 +0000 (23:36 +0000)]
Remove unused method GRState::LookupExpr().

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

13 years agoFix a bug in the emission of __real/__imag l-values on scalar operands.
John McCall [Sun, 5 Dec 2010 02:00:02 +0000 (02:00 +0000)]
Fix a bug in the emission of __real/__imag l-values on scalar operands.
Fix a bug in the emission of complex compound assignment l-values.
Introduce a method to emit an expression whose value isn't relevant.
Make that method evaluate its operand as an l-value if it is one.
Fixes our volatile compliance in C++.

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

13 years agoPut each test in class-layout.cpp into a separate namespace.
Anders Carlsson [Sun, 5 Dec 2010 00:08:52 +0000 (00:08 +0000)]
Put each test in class-layout.cpp into a separate namespace.

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

13 years agoAdd a LayoutBase member function. No functionality change.
Anders Carlsson [Sat, 4 Dec 2010 23:59:48 +0000 (23:59 +0000)]
Add a LayoutBase member function. No functionality change.

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

13 years agoReplace calls to AppendBytes with calls to AppendPadding when the bytes appended...
Anders Carlsson [Sat, 4 Dec 2010 23:53:18 +0000 (23:53 +0000)]
Replace calls to AppendBytes with calls to AppendPadding when the bytes appended are padding.

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

13 years agoFix rewriter to match recent changes in property ref
Fariborz Jahanian [Sat, 4 Dec 2010 21:22:13 +0000 (21:22 +0000)]
Fix rewriter to match recent changes in property ref
AST.

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

13 years agoSilly special case: never load when dereferencing void*.
John McCall [Sat, 4 Dec 2010 12:43:24 +0000 (12:43 +0000)]
Silly special case:  never load when dereferencing void*.

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

13 years agoFirst pass at implementing the intent of ANSI C DR106.
John McCall [Sat, 4 Dec 2010 12:29:11 +0000 (12:29 +0000)]
First pass at implementing the intent of ANSI C DR106.

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

13 years agodyn_cast else unreachable -> cast
John McCall [Sat, 4 Dec 2010 09:57:16 +0000 (09:57 +0000)]
dyn_cast else unreachable -> cast

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

13 years agoMore anonymous struct/union redesign. This one deals with anonymous field used in...
Francois Pichet [Sat, 4 Dec 2010 09:14:42 +0000 (09:14 +0000)]
More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:

struct X {
  X() : au_i1(123) {}
  union {
    int au_i1;
    float au_f1;
  };
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

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

13 years agoDon't crash when initializing a subaggregate in C from a property r-value.
John McCall [Sat, 4 Dec 2010 09:03:57 +0000 (09:03 +0000)]
Don't crash when initializing a subaggregate in C from a property r-value.

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

13 years agoMake IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().
John McCall [Sat, 4 Dec 2010 08:24:19 +0000 (08:24 +0000)]
Make IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().
Abramo noticed this.

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

13 years agoSilence "comparison between signed and unsigned integer expressions" warnings.
Benjamin Kramer [Sat, 4 Dec 2010 08:16:05 +0000 (08:16 +0000)]
Silence "comparison between signed and unsigned integer expressions" warnings.

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

13 years agoRemove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
John McCall [Sat, 4 Dec 2010 08:14:53 +0000 (08:14 +0000)]
Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
be required, and then fix up some missing loads on overloaded-operator
paths which that exposed.

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

13 years agoWhen deciding whether to complain about the type of a boolean condition, use
John McCall [Sat, 4 Dec 2010 06:09:13 +0000 (06:09 +0000)]
When deciding whether to complain about the type of a boolean condition, use
the type of the expression *after* array/function decay.

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

13 years agoApparently properties.m does not always fail; make it.
John McCall [Sat, 4 Dec 2010 05:22:10 +0000 (05:22 +0000)]
Apparently properties.m does not always fail;  make it.

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

13 years agoFix this test case on no-asserts builds by not trying to match the basic
John McCall [Sat, 4 Dec 2010 05:19:12 +0000 (05:19 +0000)]
Fix this test case on no-asserts builds by not trying to match the basic
block line.

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

13 years agoAlthough we currently have explicit lvalue-to-rvalue conversions, they're
John McCall [Sat, 4 Dec 2010 03:47:34 +0000 (03:47 +0000)]
Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ.  So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.

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

13 years agoTest case for the l-value base only being evaluated once.
John McCall [Sat, 4 Dec 2010 03:11:00 +0000 (03:11 +0000)]
Test case for the l-value base only being evaluated once.

Also, move the l-value emission code into CGObjC.cpp and teach it, for
completeness, to store away self for a super send.

Also, inline the super cases for property gets and sets and make them
use the correct result type for implicit getter/setter calls.

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

13 years agoKill the KVC l-value kind and calculate the base expression when emitting
John McCall [Sat, 4 Dec 2010 02:32:38 +0000 (02:32 +0000)]
Kill the KVC l-value kind and calculate the base expression when emitting
the l-value.

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

13 years agoImplement -cl-std=
Peter Collingbourne [Sat, 4 Dec 2010 01:51:40 +0000 (01:51 +0000)]
Implement -cl-std=

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

13 years agoImplement -cl-mad-enable
Peter Collingbourne [Sat, 4 Dec 2010 01:51:33 +0000 (01:51 +0000)]
Implement -cl-mad-enable

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

13 years agoImplement -cl-fast-relaxed-math
Peter Collingbourne [Sat, 4 Dec 2010 01:51:23 +0000 (01:51 +0000)]
Implement -cl-fast-relaxed-math

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

13 years agoImplement -cl-unsafe-math-optimizations
Peter Collingbourne [Sat, 4 Dec 2010 01:51:14 +0000 (01:51 +0000)]
Implement -cl-unsafe-math-optimizations

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

13 years agoImplement -cl-finite-math-only
Peter Collingbourne [Sat, 4 Dec 2010 01:51:05 +0000 (01:51 +0000)]
Implement -cl-finite-math-only

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

13 years agoImplement -cl-single-precision-constant
Peter Collingbourne [Sat, 4 Dec 2010 01:50:56 +0000 (01:50 +0000)]
Implement -cl-single-precision-constant

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

13 years agoImplement -cl-opt-disable
Peter Collingbourne [Sat, 4 Dec 2010 01:50:45 +0000 (01:50 +0000)]
Implement -cl-opt-disable

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

13 years agoRefactor optimisation level code
Peter Collingbourne [Sat, 4 Dec 2010 01:50:36 +0000 (01:50 +0000)]
Refactor optimisation level code

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

13 years agoIntroduce CompilerInvocation::setLangDefaults function
Peter Collingbourne [Sat, 4 Dec 2010 01:50:27 +0000 (01:50 +0000)]
Introduce CompilerInvocation::setLangDefaults function

This patch refactors the CompilerInvocation code to introduce a
CompilerInvocation::setLangDefaults function, which can set up a
LangOptions with the defaults for a given language and language
standard.  This function is useful for non-command line based Clang
clients which need to set up a CompilerInvocation manually for a
specific language.

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

13 years agoMinor refactoring; have BugReport::getRanges return a pair of iterator, no functional...
Argyrios Kyrtzidis [Sat, 4 Dec 2010 01:12:15 +0000 (01:12 +0000)]
Minor refactoring; have BugReport::getRanges return a pair of iterator, no functionality change.

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

13 years agoMark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293
Argyrios Kyrtzidis [Sat, 4 Dec 2010 01:12:11 +0000 (01:12 +0000)]
Mark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293

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

13 years agoDiagnose when accessing property in a class method and
Fariborz Jahanian [Fri, 3 Dec 2010 23:37:08 +0000 (23:37 +0000)]
Diagnose when accessing property in a class method and
no property accessor class method to be found, instead of
crashing in IRGen. // rdar://8703553

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

13 years agoFixed typo.
Abramo Bagnara [Fri, 3 Dec 2010 21:39:42 +0000 (21:39 +0000)]
Fixed typo.

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

13 years agoAdded struct/class syntactic info for c++0x scoped enum.
Abramo Bagnara [Fri, 3 Dec 2010 18:54:17 +0000 (18:54 +0000)]
Added struct/class syntactic info for c++0x scoped enum.

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

13 years agoAdd missing vext_f32 and vextq_f32 Neon intrinsics (Radar 8592601).
Bob Wilson [Fri, 3 Dec 2010 17:50:54 +0000 (17:50 +0000)]
Add missing vext_f32 and vextq_f32 Neon intrinsics (Radar 8592601).
For some reason these were not included in the list of Neon intrinsics in
ARM's documentation, so they didn't make it into Clang either.

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

13 years agoAdd support for vmul_p8 Neon intrinsic. Radar 8446141.
Bob Wilson [Fri, 3 Dec 2010 17:29:39 +0000 (17:29 +0000)]
Add support for vmul_p8 Neon intrinsic.  Radar 8446141.

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

13 years agoImplement caching for the linkage and visibility calculations of
Douglas Gregor [Fri, 3 Dec 2010 17:11:42 +0000 (17:11 +0000)]
Implement caching for the linkage and visibility calculations of
declarations.

The motivation for this patch is that linkage/visibility computations
are linear in the number of redeclarations of an entity, and we've run
into a case where a single translation unit has > 6500 redeclarations
of the same (unused!) external variable. Since each redeclaration
involves a linkage check, the resulting quadratic behavior makes Clang
slow to a crawl. With this change, a simple test with 512
redeclarations of a variable syntax-checks ~20x faster than
before.

That said, I hate this change, and will probably end up reverting it
in a few hours. Reasons to hate it:
  - It makes NamedDecl larger, since we don't have enough free bits in
  Decl to squeeze in the extra information about caching.
  - There are way too many places where we need to invalidate this
  cache, because the visibility of a declaration can change due to
  redeclarations (!). Despite self-hosting and passing the testsuite,
  I have no confidence that I've found all of places where this cache
  needs to be invalidated.

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

13 years agoAdd a separate name field to the Neon intrinsic table.
Bob Wilson [Fri, 3 Dec 2010 17:10:24 +0000 (17:10 +0000)]
Add a separate name field to the Neon intrinsic table.
This is currently the same as a lowercase version of the record name, but
it will allow us to have multiple records with the same name, which is
needed for intrinsics (e.g., vmul and vmull) that are implemented
differently depending on the type.

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

13 years agoAdd a separate rightShift flag instead of reusing the existing "poly" variable
Bob Wilson [Fri, 3 Dec 2010 17:10:22 +0000 (17:10 +0000)]
Add a separate rightShift flag instead of reusing the existing "poly" variable
to distinguish vsri/vsli.

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

13 years agoUpdate analyzer build.
Ted Kremenek [Fri, 3 Dec 2010 07:52:43 +0000 (07:52 +0000)]
Update analyzer build.

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

13 years agoAdd some warning messages about invalid use of common/nocommon attributes.
Eric Christopher [Fri, 3 Dec 2010 06:58:14 +0000 (06:58 +0000)]
Add some warning messages about invalid use of common/nocommon attributes.

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

13 years agoAdd test case for r120795.
Ted Kremenek [Fri, 3 Dec 2010 06:53:12 +0000 (06:53 +0000)]
Add test case for r120795.

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

13 years agoFix an insidious bug in BugReporter where
Ted Kremenek [Fri, 3 Dec 2010 06:52:30 +0000 (06:52 +0000)]
Fix an insidious bug in BugReporter where
a node in the trimmed graph might not always
correctly map back to the original error node.
This could cause a crash in some cases when
flagging memory leaks.

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

13 years agoAlso include the pointer address of the ExplodedNode
Ted Kremenek [Fri, 3 Dec 2010 06:52:26 +0000 (06:52 +0000)]
Also include the pointer address of the ExplodedNode
when generating DOT output for an ExplodedGraph.

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

13 years agoAlso show notes about the taken path in TextPathDiagnostics.
Argyrios Kyrtzidis [Fri, 3 Dec 2010 02:03:26 +0000 (02:03 +0000)]
Also show notes about the taken path in TextPathDiagnostics.

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

13 years agoRemove leftover code and use the text path diagnostic client even without a specified...
Argyrios Kyrtzidis [Fri, 3 Dec 2010 01:17:19 +0000 (01:17 +0000)]
Remove leftover code and use the text path diagnostic client even without a specified output file since
it just uses diagnostic notes.

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

13 years agoAdd a flag to control the "indirection of non-volatile null pointer will be
Nick Lewycky [Fri, 3 Dec 2010 01:10:02 +0000 (01:10 +0000)]
Add a flag to control the "indirection of non-volatile null pointer will be
deleted, not trap" warning. Fixed PR8729. Patch by Elias Pipping!

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

13 years agoIntroduce TextPathDiagnostics, a simple PathDiagnosticClient that outputs as diagnost...
Argyrios Kyrtzidis [Fri, 3 Dec 2010 00:58:14 +0000 (00:58 +0000)]
Introduce TextPathDiagnostics, a simple PathDiagnosticClient that outputs as diagnostic notes
the sequence of events; useful for testing.

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

13 years agoHandle any number of SourceRanges inside BugReporter::FlushReport.
Argyrios Kyrtzidis [Fri, 3 Dec 2010 00:58:10 +0000 (00:58 +0000)]
Handle any number of SourceRanges inside BugReporter::FlushReport.

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

13 years agoRename Create[*]DiagnosticClient -> create[*]DiagnosticClient.
Argyrios Kyrtzidis [Fri, 3 Dec 2010 00:58:08 +0000 (00:58 +0000)]
Rename Create[*]DiagnosticClient -> create[*]DiagnosticClient.

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

13 years agoAdd support for "_lane" variants of VMUL, VMLA, and VMLS Neon intrinsics.
Bob Wilson [Fri, 3 Dec 2010 00:34:21 +0000 (00:34 +0000)]
Add support for "_lane" variants of VMUL, VMLA, and VMLS Neon intrinsics.

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

13 years agoFix diagnostic for reporting bad escape sequence.
Ted Kremenek [Fri, 3 Dec 2010 00:09:56 +0000 (00:09 +0000)]
Fix diagnostic for reporting bad escape sequence.
Patch by Paul Curtis!

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

13 years agoReflow to a style doug prefers, increasing indentation :-)
Chris Lattner [Thu, 2 Dec 2010 22:52:04 +0000 (22:52 +0000)]
Reflow to a style doug prefers, increasing indentation :-)

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

13 years agoWhen we're performing an explicit cast of some sort, don't complain
Douglas Gregor [Thu, 2 Dec 2010 21:47:04 +0000 (21:47 +0000)]
When we're performing an explicit cast of some sort, don't complain
about deprecated Objective-C pointer conversions. Plus, make sure to
actually set an appropriate AssignmentAction when performing an
implicit conversion from an InitializationSequence. Fixes regressions
in the GCC DejaGNU testsuite.

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

13 years agoImprove on objc diagnostics. // rdar://8721692
Fariborz Jahanian [Thu, 2 Dec 2010 21:00:16 +0000 (21:00 +0000)]
Improve on objc diagnostics. // rdar://8721692

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

13 years agoMerge transparent union types using member's unqualified type
Peter Collingbourne [Thu, 2 Dec 2010 21:00:06 +0000 (21:00 +0000)]
Merge transparent union types using member's unqualified type

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

13 years agoFix range in printf warnings for invalid conversion specifiers.
Ted Kremenek [Thu, 2 Dec 2010 20:57:51 +0000 (20:57 +0000)]
Fix range in printf warnings for invalid conversion specifiers.

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

13 years agoMerge transparent union types using member's canonical param type
Peter Collingbourne [Thu, 2 Dec 2010 20:02:29 +0000 (20:02 +0000)]
Merge transparent union types using member's canonical param type

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

13 years agoFix inverted return value in the ASTImporter. No matter how much LLVM
Douglas Gregor [Thu, 2 Dec 2010 19:33:37 +0000 (19:33 +0000)]
Fix inverted return value in the ASTImporter. No matter how much LLVM
code I wrote, returning "true" on error is still unnatural.

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

13 years agoFixed source range for MS asm statement.
Abramo Bagnara [Thu, 2 Dec 2010 18:34:55 +0000 (18:34 +0000)]
Fixed source range for MS asm statement.

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

13 years agofix PR8726 by teaching the aggregate init optimization code to handle
Chris Lattner [Thu, 2 Dec 2010 18:29:00 +0000 (18:29 +0000)]
fix PR8726 by teaching the aggregate init optimization code to handle
structs with references in them correctly.

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

13 years agoTest for // rdar://8594790
Fariborz Jahanian [Thu, 2 Dec 2010 17:58:10 +0000 (17:58 +0000)]
Test for // rdar://8594790

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

13 years agoAttempt to fix linux buildbots by adding -ffreestanding for arm_neon tests.
Bob Wilson [Thu, 2 Dec 2010 17:31:16 +0000 (17:31 +0000)]
Attempt to fix linux buildbots by adding -ffreestanding for arm_neon tests.
The arm_neon.h header includes stdint.h and it picks up the system header
without -ffreestanding.

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

13 years agoIR Gen. part of API support for __block cxx
Fariborz Jahanian [Thu, 2 Dec 2010 17:02:11 +0000 (17:02 +0000)]
IR Gen. part of API support for __block cxx
objects imported into blocks. //rdar://8594790.
Will have a test case coming (as well as one
sent to llvm test suite).

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

13 years agoDo not change the size of LookupResult::Filter based on the NDEBUG
Douglas Gregor [Thu, 2 Dec 2010 16:19:31 +0000 (16:19 +0000)]
Do not change the size of LookupResult::Filter based on the NDEBUG
macri; the extra bool fits into padding anyway.

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

13 years agoRemove NDEBUG-controlled extra data from
Douglas Gregor [Thu, 2 Dec 2010 16:14:14 +0000 (16:14 +0000)]
Remove NDEBUG-controlled extra data from
TemplateArgumentLocInfo. Unfortunately, this means that we lose some
internal consistency checking when building a debug Clang. However,
having data structures change size/layout depending on NDEBUG causes
pain for clients of the Clang API.

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

13 years agoTweaks.
John McCall [Thu, 2 Dec 2010 10:37:08 +0000 (10:37 +0000)]
Tweaks.

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

13 years agoObjC support in the XML dumper.
John McCall [Thu, 2 Dec 2010 10:24:56 +0000 (10:24 +0000)]
ObjC support in the XML dumper.

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

13 years agoMerge ValueManager into SValBuilder.
Ted Kremenek [Thu, 2 Dec 2010 07:49:45 +0000 (07:49 +0000)]
Merge ValueManager into SValBuilder.

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

13 years agoAdd a test for calling a Neon intrinsic macro with the wrong vector type.
Bob Wilson [Thu, 2 Dec 2010 07:13:31 +0000 (07:13 +0000)]
Add a test for calling a Neon intrinsic macro with the wrong vector type.
This does not work so well with the -fno-lax-vector-conversions option for
testing the arm_neon.h header but that is a really useful test, so I split
this out to a separate Sema test to check for the warning.

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

13 years agoImprove codegen for initializer lists to use memset more aggressively
Chris Lattner [Thu, 2 Dec 2010 07:07:26 +0000 (07:07 +0000)]
Improve codegen for initializer lists to use memset more aggressively
when an initializer is variable (I handled the constant case in a previous
patch).  This has three pieces:

1. Enhance AggValueSlot to have a 'isZeroed' bit to tell CGExprAgg that
   the memory being stored into has previously been memset to zero.
2. Teach CGExprAgg to not emit stores of zero to isZeroed memory.
3. Teach CodeGenFunction::EmitAggExpr to scan initializers to determine
   whether they are profitable to emit a memset + inividual stores vs
   stores for everything.

The heuristic used is that a global has to be more than 16 bytes and
has to be 3/4 zero to be candidate for this xform.  The two testcases
are illustrative of the scenarios this catches.  We now codegen test9 into:

 call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 400, i32 4, i1 false)
 %.array = getelementptr inbounds [100 x i32]* %Arr, i32 0, i32 0
 %tmp = load i32* %X.addr, align 4
 store i32 %tmp, i32* %.array

and test10 into:

  call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 392, i32 8, i1 false)
  %tmp = getelementptr inbounds %struct.b* %S, i32 0, i32 0
  %tmp1 = getelementptr inbounds %struct.a* %tmp, i32 0, i32 0
  %tmp2 = load i32* %X.addr, align 4
  store i32 %tmp2, i32* %tmp1, align 4
  %tmp5 = getelementptr inbounds %struct.b* %S, i32 0, i32 3
  %tmp10 = getelementptr inbounds %struct.a* %tmp5, i32 0, i32 4
  %tmp11 = load i32* %X.addr, align 4
  store i32 %tmp11, i32* %tmp10, align 4

Previously we produced 99 stores of zero for test9 and also tons for test10.
This xforms should substantially speed up -O0 builds when it kicks in as well
as reducing code size and optimizer heartburn on insane cases.  This resolves
PR279.

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

13 years agoattempt to fix a buildbot failure, apparently apache fails to build.
Chris Lattner [Thu, 2 Dec 2010 04:27:29 +0000 (04:27 +0000)]
attempt to fix a buildbot failure, apparently apache fails to build.

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

13 years agoAdd support for the common and nocommon attributes.
Eric Christopher [Thu, 2 Dec 2010 02:45:55 +0000 (02:45 +0000)]
Add support for the common and nocommon attributes.

rdar://8560647

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

13 years agoFileCheckize.
Eric Christopher [Thu, 2 Dec 2010 02:30:43 +0000 (02:30 +0000)]
FileCheckize.

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

13 years agoFileCheckize.
Eric Christopher [Thu, 2 Dec 2010 02:13:27 +0000 (02:13 +0000)]
FileCheckize.

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

13 years agoPerform lvalue-to-rvalue at the end of an expression statement in C.
John McCall [Thu, 2 Dec 2010 02:07:15 +0000 (02:07 +0000)]
Perform lvalue-to-rvalue at the end of an expression statement in C.

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

13 years agoEnhance the init generation logic to emit a memset followed by a few stores when
Chris Lattner [Thu, 2 Dec 2010 01:58:41 +0000 (01:58 +0000)]
Enhance the init generation logic to emit a memset followed by a few stores when
a global is larger than 32 bytes and has fewer than 6 non-zero values in the
initializer.  Previously we'd turn something like this:

char test8(int X) {
  char str[10000] = "abc";

into a 10K global variable which we then memcpy'd from.  Now we generate:

  %str = alloca [10000 x i8], align 16
  %tmp = getelementptr inbounds [10000 x i8]* %str, i64 0, i64 0
  call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 10000, i32 16, i1 false)
  store i8 97, i8* %tmp, align 16
  %0 = getelementptr [10000 x i8]* %str, i64 0, i64 1
  store i8 98, i8* %0, align 1
  %1 = getelementptr [10000 x i8]* %str, i64 0, i64 2
  store i8 99, i8* %1, align 2

Which is much smaller in space and also likely faster.

This is part of PR279

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

13 years agoSimplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
John McCall [Thu, 2 Dec 2010 01:19:52 +0000 (01:19 +0000)]
Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.

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

13 years agoTest use of arm_neon.h with -fno-lax-vector-conversions.
Bob Wilson [Thu, 2 Dec 2010 01:18:30 +0000 (01:18 +0000)]
Test use of arm_neon.h with -fno-lax-vector-conversions.

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

13 years agoAdd a testcase for Radar 8228022.
Bob Wilson [Thu, 2 Dec 2010 00:25:18 +0000 (00:25 +0000)]
Add a testcase for Radar 8228022.
Make sure the -Wvector-conversions does not cause unnecessary warnings when
using Neon intrinsics with the correct types.

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

13 years agoSwap order of checking for compatible vector types.
Bob Wilson [Thu, 2 Dec 2010 00:25:15 +0000 (00:25 +0000)]
Swap order of checking for compatible vector types.
Check for compatible gcc, Altivec and Neon vectors before handling the
lax-vector-conversions case.  Otherwise there is no way to avoid the
warnings from -Wvector-conversions.

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

13 years agoEliminate two uses of NDEBUG in headers that cause different symbols
Douglas Gregor [Thu, 2 Dec 2010 00:22:25 +0000 (00:22 +0000)]
Eliminate two uses of NDEBUG in headers that cause different symbols
to be available in debug vs. release builds.

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

13 years agoMake TypeLocBuilder an implementation detail of Sema. Nobody else should be using it
Douglas Gregor [Thu, 2 Dec 2010 00:05:49 +0000 (00:05 +0000)]
Make TypeLocBuilder an implementation detail of Sema. Nobody else should be using it

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

13 years agoExtend ExternalASTSource with the ability to lazily complete the
Douglas Gregor [Wed, 1 Dec 2010 23:49:52 +0000 (23:49 +0000)]
Extend ExternalASTSource with the ability to lazily complete the
definition of an Objective-C class. Unlike with C/C++ classes, we
don't have a well-defined point in Sema where Objective-C classes are
checked for completeness, nor do we need to involve Sema when
completing a class. Therefore, we take the appropriate of having the
external AST source mark a particular Objective-C class as having an
external declaration; when using one of the accessors of an
Objective-C class that has an external declaration, we request that
the external AST source fill in the Objective-C class definition.

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

13 years agoSema/AST work for capturing copy init expression
Fariborz Jahanian [Wed, 1 Dec 2010 22:29:46 +0000 (22:29 +0000)]
Sema/AST work for capturing copy init expression
to be used in copy helper synthesis of __block
variables. wip.

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

13 years agoRename all 'AssumeXXX' methods in libChecker
Ted Kremenek [Wed, 1 Dec 2010 22:16:56 +0000 (22:16 +0000)]
Rename all 'AssumeXXX' methods in libChecker
to 'assumeXXX'.

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

13 years ago80-col fixups.
Eric Christopher [Wed, 1 Dec 2010 22:13:54 +0000 (22:13 +0000)]
80-col fixups.

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

13 years agoOptimized IR for vec_splat
Anton Yartsev [Wed, 1 Dec 2010 21:59:31 +0000 (21:59 +0000)]
Optimized IR for vec_splat

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

13 years agoRename all 'EvalXXX' methods in libChecker to
Ted Kremenek [Wed, 1 Dec 2010 21:57:22 +0000 (21:57 +0000)]
Rename all 'EvalXXX' methods in libChecker to
'evalXXX'.

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

13 years agoImprove our handling of cv-qualifiers in Objective-C pointer
Douglas Gregor [Wed, 1 Dec 2010 21:43:58 +0000 (21:43 +0000)]
Improve our handling of cv-qualifiers in Objective-C pointer
conversions. Previously, we would end up collapsing qualification
conversions into the Objective-C pointer conversion step, including
(possibly) stripping qualifiers that shouldn't be removed.

This generalizes BuildSimilarlyQualifiedPointerType() to also work on
Objective-C object pointers, then eliminates the (redundant, not
totally correct) BuildSimilarlyQualifiedObjCObjectPointerType()
function.

Fixes <rdar://problem/8714395>.

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

13 years agoRename 'SValuator' to 'SValBuilder'. The new name
Ted Kremenek [Wed, 1 Dec 2010 21:28:31 +0000 (21:28 +0000)]
Rename 'SValuator' to 'SValBuilder'.  The new name
reflects what the class actually does.

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

13 years agoFix build of in-tree libcxx. libcxx doesn't actually
Shantonu Sen [Wed, 1 Dec 2010 20:38:11 +0000 (20:38 +0000)]
Fix build of in-tree libcxx. libcxx doesn't actually
need any of the LLVM support libraries. Reviewed
by Daniel Dunbar.

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

13 years agoNot content to implement just "extern" explicit template
Douglas Gregor [Wed, 1 Dec 2010 20:32:20 +0000 (20:32 +0000)]
Not content to implement just "extern" explicit template
instantiations, GCC also supports "inline" and "static" explicit
template instantiations. Parse and warn about such constructs, but
don't implement the semantics of either "inline" or "static". They
don't seem to be widely used.

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

13 years agoAdd some comments.
Bob Wilson [Wed, 1 Dec 2010 19:50:20 +0000 (19:50 +0000)]
Add some comments.

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

13 years agoSerialization: support for CUDA language extensions
Peter Collingbourne [Wed, 1 Dec 2010 19:14:57 +0000 (19:14 +0000)]
Serialization: support for CUDA language extensions

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