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

32763 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth 7ffa0325bd Sink the handling of -fobjc-arc-cxxlib to live with the other -fobjc-arc
implementation in the driver. This cleans up the signature and semantics
of the include flag adding component of the toolchain. Another step to
ready it for holding all the InitHeaderSearch logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143686 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 07:34:47 +00:00
Chandler Carruth b5870e77a9 Add a FIXME to cleanup the CPATH handling. It's currently burried with
the rest of the mess in InitHeaderSearch.cpp. We could hoist it into the
driver profitably, removing more noise from the driver -> frontend
communication.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 07:12:58 +00:00
Chandler Carruth 88491fc6df Add a system include management interface to the toolchain, and call it
and the C++ include management routine from the proper place when
forming preprocessor options in the driver. This is the first step to
teaching the driver to manage all of the header search paths. Currently,
these methods remain just stubs in the abstract toolchain. Subsequent
patches will flesh them out with implementations for various toolchains
based on the current code in InitHeaderSearch.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 07:12:53 +00:00
Richard Smith 69c2c50498 Constant expression evaluation: refactor to start the groundwork for coping with
initializations which refer indirectly to elements of the object being
initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 05:33:44 +00:00
Richard Smith 0a3bdb646e Constant expression evaluation: track the manner in which an lvalue was written,
to allow us to implement the C++11 rule that a non-active union member can't be
read, and use it to implement subobject access for string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143677 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 02:25:55 +00:00
Richard Smith 74f4634781 Constant expression evaluation: although we don't know whether a literal will
be at the same address as another object, we do know it won't alias a null
pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143674 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 01:10:57 +00:00
Richard Trieu 49cf8847ef In the AST dump, add a space between the type and value for CharacterLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143667 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 23:56:23 +00:00
Akira Hatanaka b49d5a6606 Use a single integer type for a sub-doubleword part of a byval structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143666 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 23:31:00 +00:00
Eli Friedman 1bb94a417a Fix alignment on alloca's for parameters using ABIArgInfo::Expand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143658 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 21:39:02 +00:00
Chad Rosier 05272a6594 Parse the warning options twice. The first pass sets diagnostic state, while
the second pass reports warnings/errors.  This has the effect that we follow 
the more canonical "last option wins" paradigm when there are conflicting 
options.
rdar://10383776

Previously, we parsed the warning options in order.  This caused non-intuitive
behavior:

1) clang test.c -Wnosuchwarning -Wno-unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
[0 warning generated.]

2) clang test.c -Wnosuchwarning -Werror=unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

3) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
After:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
2 warnings generated.

4) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wno-unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

After:
[0 warning generated.]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 21:23:39 +00:00
Argyrios Kyrtzidis 27368f9f19 After resetting the diagnostic state, set the number of warning occurring in the preamble.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 20:57:33 +00:00
Eli Friedman ddfb8d1026 Fix the alignment on scalar parameter variables so that it matches what the AST thinks it should be. Per report on cfe-dev.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143645 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 20:31:28 +00:00
Argyrios Kyrtzidis e6825d39e8 [libclang] Fix crash when a #pragma diagnostic is included in the preamble.
A PCH file keeps track of #pragma diagnostics state; when loading the preamble, they conflicted
with the #pragma diagnostic state already present in the DiagnosticsEngine object due to
parsing the preamble.

Fix this by clearing the state of the DiagnosticsEngine object.
Fixes rdar://10363572 && http://llvm.org/PR11254.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 20:28:19 +00:00
Douglas Gregor 2c628646b8 Force test to use the non-fragile ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:58:50 +00:00
Argyrios Kyrtzidis e397bf1bd9 [libclang] Move CursorVisitor to its own header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:02:34 +00:00
Argyrios Kyrtzidis ea0e4e8466 [libclang] Make sure pointing inside the #include of the fields will return the struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:02:30 +00:00
Argyrios Kyrtzidis ba98617b99 [libclang] Use CursorVisitor::Visit instead of invoking the visitor directly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:02:28 +00:00
Argyrios Kyrtzidis dc35aacba2 [libclang] Add a test for "targeting" a field inside an #include that only
contains fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143636 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:01:07 +00:00
Douglas Gregor f3c02869a7 Extend IsSimplyAccessible to check for Objective-C instance variable
accessibility. Fixes <rdar://problem/3727335>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:00:24 +00:00
Douglas Gregor 8a0ace669e Fix grammaro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:33:01 +00:00
Douglas Gregor 27c72d8ca8 Teach the ASTImporter to import DefinitionData bits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:07:07 +00:00
Douglas Gregor a885dce496 Class can't be null in this context
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 17:41:55 +00:00
Douglas Gregor 17015eff2b Refactor Sema::IsSimplyAccessible slightly, to work on a DeclContext rather than a class
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 16:51:37 +00:00
Douglas Gregor fb35e8f497 When we're checking a friend function template in an out-of-line class
definition, we may not have a scope corresponding to the namespace
where that friend function template actually lives. Work around this
issue by faking up a scope with the appropriate DeclContext.

This is a bit of a hack, but it fixes <rdar://problem/10204947>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 16:37:14 +00:00
Argyrios Kyrtzidis b4efaa0a14 [libclang] Add missing return in clang_getExpansionLocation that resulted in that function
always returning a null file/line/column.

Also add at least one use of clang_getExpansionLocation inside c-index-test that would have
made the tests to catch that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 02:20:36 +00:00
Argyrios Kyrtzidis dfb332d008 [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 02:20:32 +00:00
Argyrios Kyrtzidis dcaca015a2 [libclang] For c-index-test disable caching of code completion results if
the CINDEXTEST_COMPLETION_NO_CACHING environment variable is present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 02:20:25 +00:00
Jan Wen Voung 90306934bc Do not add "byval" attribute to records with non-trivial copy constructors
and destructors in the DefaultABIInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143601 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:59:44 +00:00
Douglas Gregor 25270b6e6a Add a printing policy flag to suppress printing "<anonymous>::" prior
to types. Enable this flag for code completion, where knowing whether
something is in an anonymous or inline namespace is actually not
useful, since you don't have to type it anyway. Fixes
<rdar://problem/10208818>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:16:13 +00:00
Akira Hatanaka b551dd31f6 Set MinABIStackAlignInBytes to 8 if ABI is N32/64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:05:50 +00:00
Akira Hatanaka d5a257f39b Convert the type of a structure passed by value if it has double precision
fields in order to ease handling of such structures in backend. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143596 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:54:49 +00:00
Douglas Gregor 3dd0f76fd7 Test code completion for constructor initializers within the class
definition. This already worked; <rdar://problem/10208871>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:39:56 +00:00
Akira Hatanaka c0e3b66534 Return function results whose size is smaller than 128-bits in registers if ABI
is N32/64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143589 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:14:57 +00:00
Eli Friedman caf1f26777 Use native endianness for writing out character escapes to the result buffer for string literal parsing. No functional change on little-endian architectures; should fix test failures on PPC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143585 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:06:23 +00:00
Douglas Gregor ddb21473ef Don't build member initializers for zero-length or incomplete arrays,
and don't try to destroy them, either. Fixes
<rdar://problem/10228639>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143584 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:04:16 +00:00
Fariborz Jahanian c637d73889 back out changes in r143399 and r143475.
rvale-references are captured by reference
in blocks. // rdar://9971124.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 22:53:43 +00:00
Douglas Gregor 3c24cab407 Don't encourage bug reports to the Clang mailing list. We have a bug
report link for that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 22:49:47 +00:00
Chad Rosier ce50c55f8c In addition to dumping preprocessed source, dump a script with the command line
arguments that caused clang to crash.
rdar://8314451

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143573 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 21:29:05 +00:00
Douglas Gregor 21a25167b8 Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 20:52:01 +00:00
Anna Zaks 5fa3f1309b [analyzer] Tweak the test script
Rename the pre_run_static_analyzer script into cleanup_run_static_analyzer
and use it to clean up after the reference build - which is done as part of
adding a new project to the system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 20:46:50 +00:00
Chandler Carruth 27e66ad42e Add the newest Gentoo GCC version based on the reported installed
version in PR11298.

I hear-by apologize for adding yet more code to this monstrosity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 20:09:56 +00:00
Anna Zaks d67fc49da9 [analyzer] Start writing Checker Developer Manual.
So far added the skeleton + several more or less complete sections:
Getting Started
Idea for a Checker
AST Visitors
Useful Commands/Debugging Hints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143554 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 17:49:20 +00:00
Douglas Gregor 0b1beb7a29 Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case). 

Fixes <rdar://problem/9676205>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143551 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 17:38:53 +00:00
Douglas Gregor 38738fcace Use StringLiteral::getBytes(), not StringLiteral::getString(), when profiling the expression, so that it works for non-UTF8 strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143550 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 17:26:05 +00:00
David Blaikie b09a33c14c Fixing some dead links. Patch by Jean-Daniel Dupas!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143539 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 15:13:40 +00:00
Benjamin Kramer 2eba859d43 Remove virtually empty file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 12:04:24 +00:00
Michael J. Spencer 45b636aea7 Add colors to the C++11 status page.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 06:29:37 +00:00
Bob Wilson 591ff15d4a Invoke the Darwin assembler with -g instead of --gdwarf2.
The -g and --gdwarf2 options are currently synonyms to the Darwin assembler.
But clang itself does not recognize --gdwarf2, so if we want to experiment
with using clang, with its integrated assembler, to replace the default
assembler, it is necessary to use -g.  <rdar://problem/10349486>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 05:10:45 +00:00
Chandler Carruth d4e85faaf3 Update the CMake build for clang-tblgen to reflect that it directly
depends on the Support library rather than relying on TableGen's
transitive dependency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 05:04:43 +00:00
Bob Wilson 3b694fab31 Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 04:51:36 +00:00