Граф коммитов

26015 Коммитов

Автор SHA1 Сообщение Дата
Peter Collingbourne 4400cb8c54 Implement -cl-mad-enable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:51:33 +00:00
Peter Collingbourne f0840820b4 Implement -cl-fast-relaxed-math
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:51:23 +00:00
Peter Collingbourne 5f67e13fcd Implement -cl-unsafe-math-optimizations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:51:14 +00:00
Peter Collingbourne 5d729a3d8e Implement -cl-finite-math-only
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:51:05 +00:00
Peter Collingbourne 0982136cb7 Implement -cl-single-precision-constant
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:50:56 +00:00
Peter Collingbourne 61e07861dd Implement -cl-opt-disable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:50:45 +00:00
Peter Collingbourne 0a3c03cb1f Refactor optimisation level code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 01:50:36 +00:00
Peter Collingbourne 53c92be3b2 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
2010-12-04 01:50:27 +00:00
Argyrios Kyrtzidis 640ccf0710 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
2010-12-04 01:12:15 +00:00
Argyrios Kyrtzidis ae3038c5e8 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
2010-12-04 01:12:11 +00:00
Fariborz Jahanian 74b2756bc1 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
2010-12-03 23:37:08 +00:00
Abramo Bagnara 6c572f1b5b Fixed typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 21:39:42 +00:00
Abramo Bagnara a88cefd266 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
2010-12-03 18:54:17 +00:00
Bob Wilson 4740dabd14 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
2010-12-03 17:50:54 +00:00
Bob Wilson 953d513c7e 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
2010-12-03 17:29:39 +00:00
Douglas Gregor 2357207a57 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
2010-12-03 17:11:42 +00:00
Bob Wilson 96bfa6249f 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
2010-12-03 17:10:24 +00:00
Bob Wilson 7965396d8d 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
2010-12-03 17:10:22 +00:00
Ted Kremenek 8f50014fb3 Update analyzer build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 07:52:43 +00:00
Eric Christopher 722109c1b7 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
2010-12-03 06:58:14 +00:00
Ted Kremenek 83300e884d Add test case for r120795.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 06:53:12 +00:00
Ted Kremenek 40406fe63d 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
2010-12-03 06:52:30 +00:00
Ted Kremenek 8673a68a8a 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
2010-12-03 06:52:26 +00:00
Argyrios Kyrtzidis 774dfbb046 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
2010-12-03 02:03:26 +00:00
Argyrios Kyrtzidis a599ae8826 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
2010-12-03 01:17:19 +00:00
Nick Lewycky a427b49f99 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
2010-12-03 01:10:02 +00:00
Argyrios Kyrtzidis ebd4f52093 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
2010-12-03 00:58:14 +00:00
Argyrios Kyrtzidis b6b7e7bff3 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
2010-12-03 00:58:10 +00:00
Argyrios Kyrtzidis f928dca565 Rename Create[*]DiagnosticClient -> create[*]DiagnosticClient.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:58:08 +00:00
Bob Wilson 96c105c8c3 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
2010-12-03 00:34:21 +00:00
Ted Kremenek 23ef69d197 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
2010-12-03 00:09:56 +00:00
Chris Lattner 8c00ad1e38 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
2010-12-02 22:52:04 +00:00
Douglas Gregor a3998bd364 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
2010-12-02 21:47:04 +00:00
Fariborz Jahanian a9e9144f48 Improve on objc diagnostics. // rdar://8721692
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120737 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 21:00:16 +00:00
Peter Collingbourne f91d7572ee 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
2010-12-02 21:00:06 +00:00
Ted Kremenek 7966297a70 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
2010-12-02 20:57:51 +00:00
Peter Collingbourne b97c403176 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
2010-12-02 20:02:29 +00:00
Douglas Gregor c04d9d1be0 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
2010-12-02 19:33:37 +00:00
Abramo Bagnara a44724d0d6 Fixed source range for MS asm statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 18:34:55 +00:00
Chris Lattner d1d56df188 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
2010-12-02 18:29:00 +00:00
Fariborz Jahanian 2575585b79 Test for // rdar://8594790
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 17:58:10 +00:00
Bob Wilson 550e5ada63 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
2010-12-02 17:31:16 +00:00
Fariborz Jahanian 830937bc11 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
2010-12-02 17:02:11 +00:00
Douglas Gregor fce5656f75 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
2010-12-02 16:19:31 +00:00
Douglas Gregor 6939fff69a 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
2010-12-02 16:14:14 +00:00
John McCall 7bd245b42c Tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 10:37:08 +00:00
John McCall 3bddf5c217 ObjC support in the XML dumper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 10:24:56 +00:00
Ted Kremenek c8413fd03f Merge ValueManager into SValBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 07:49:45 +00:00
Bob Wilson 0608f53744 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
2010-12-02 07:13:31 +00:00
Chris Lattner 1b726771d0 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
2010-12-02 07:07:26 +00:00