Commit Graph

33731 Commits

Author SHA1 Message Date
Eli Friedman 5b08d9adf5 Fix incorrect format string in debug output.
llvm-svn: 143768
2011-11-05 00:38:30 +00:00
Ted Kremenek 5717049d8e Teach LiveVariables to look through OpaqueValueExprs for extending Stmt liveness.
llvm-svn: 143767
2011-11-05 00:26:53 +00:00
Ted Kremenek 04268232df Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.
llvm-svn: 143766
2011-11-05 00:10:15 +00:00
Ted Kremenek f264a20721 serialized diagnostics: pull emission of filenames into diagnostic block.
llvm-svn: 143765
2011-11-05 00:10:11 +00:00
Ted Kremenek 0a49dae7f7 serialized diagnostics: pull emission of diagnostic flag string into diagnostics block.
llvm-svn: 143764
2011-11-05 00:10:07 +00:00
Ted Kremenek 31921506b4 Serialized diagnostics: pull category name serialization into diagnostic blocks. The goal is to remove BLOCK_STRINGS so that the bitcode file can potentially be streamed.
llvm-svn: 143763
2011-11-05 00:10:04 +00:00
Ted Kremenek 59f1025ca0 serialized diagnostics: emit source ranges.
llvm-svn: 143762
2011-11-05 00:10:01 +00:00
Ted Kremenek 337cd2a8e2 Move definition of record/block IDs for serialized diagnostics to public header.
llvm-svn: 143761
2011-11-05 00:09:57 +00:00
Ted Kremenek 868504ab99 Serialized diagnostics: encode a 24 bit version number as part of the "magic number" of serialized diagnostics.
llvm-svn: 143760
2011-11-05 00:09:53 +00:00
Ted Kremenek 2724b1ffc1 serialized diagnostics: unique warning strings when emitting serialized diagnostics.
llvm-svn: 143759
2011-11-05 00:09:50 +00:00
Ted Kremenek f67bbca1a4 Serialized diagnostics: serialize "notes" as sub diagnostics of warnings and errors.
llvm-svn: 143758
2011-11-05 00:09:47 +00:00
Ted Kremenek fce371acb4 Also include file modification time and size in output of SerializedDiagnosticPrinter.
llvm-svn: 143757
2011-11-05 00:09:43 +00:00
Argyrios Kyrtzidis aed9bd7cc1 [arcmt] Fix an assertion hit in rdar://10336125; a bit too complicated to reduce.
llvm-svn: 143754
2011-11-05 00:02:26 +00:00
Chandler Carruth df52783e32 Begin the migration of header search logic to the driver, starting with
Windows. There are still FIXMEs and lots of problems with this code.
Some of them will be addressed shortly by my follow-up patches, but most
are going to wait until we isolate this code and can fix it properly.
This version should be no worse than what we had before.

llvm-svn: 143752
2011-11-04 23:49:05 +00:00
Chandler Carruth 814db37f7d Switch the C++ include interface in the ToolChain to use the same naming
as the system include interface before I start adding implementations of
it to individual ToolChain implementations.

llvm-svn: 143751
2011-11-04 23:49:01 +00:00
Argyrios Kyrtzidis 088789caa6 Check for invalid after calling getSLocEntry, for safety.
llvm-svn: 143748
2011-11-04 23:43:06 +00:00
Argyrios Kyrtzidis 6b2d47d829 [arcmt] In GC, error out when there is a call that returns a pointer to
GC managed non-objc object memory.

llvm-svn: 143747
2011-11-04 23:43:03 +00:00
Argyrios Kyrtzidis d979df9e18 In ARC, when applying an ownership to a non-objc pointer, instead of ignoring it
create an attributed type with same type as the original type.

We effectively retain the source info that an ownership attribute was present but the attribute
is ignored by not modifying the type that it was applied to.

llvm-svn: 143736
2011-11-04 20:37:24 +00:00
Devang Patel 384dfa4f10 Enable -flimit-debug-info by default. Now, clang lazily emits debug info for structs. Original behavior can be restored using -fno-limit-debug-info.
llvm-svn: 143733
2011-11-04 20:05:58 +00:00
Chad Rosier c2bf338d35 [driver] Don't blindly accept all -g options.
rdar://10383444

llvm-svn: 143732
2011-11-04 19:28:44 +00:00
Devang Patel 2ccf84e3a5 Revert r143551. It is causing g++.dg/template/crash52.C test failure.
llvm-svn: 143725
2011-11-04 18:52:43 +00:00
Fariborz Jahanian 37c6417949 objc: fixed enum type is supported in objc mode.
Fixes a bug where enumerator type is not this
fixed type. // rdar://10381507

llvm-svn: 143724
2011-11-04 18:51:24 +00:00
Richard Smith fe5354b945 Clean up C++11 constant expression testing.
llvm-svn: 143720
2011-11-04 18:32:57 +00:00
Devang Patel 45124500bb Add new test.
llvm-svn: 143706
2011-11-04 17:12:03 +00:00
Devang Patel f1faeefb32 Add new test.
llvm-svn: 143704
2011-11-04 16:57:26 +00:00
Argyrios Kyrtzidis d2b9112354 [arcmt] For GC, cleanup and turn -finalize to -dealloc.
llvm-svn: 143701
2011-11-04 15:58:22 +00:00
Argyrios Kyrtzidis d8cdfbc905 [arcmt] In GC, error for use of CFMakeCollectable because it will leak the
object that it receives in ARC.

llvm-svn: 143700
2011-11-04 15:58:17 +00:00
Argyrios Kyrtzidis 3eaa22af57 In C++ keep unavailable function calls in the AST, like in C/ObjC.
This allows the migrator to visit and fix them.

llvm-svn: 143699
2011-11-04 15:58:13 +00:00
Argyrios Kyrtzidis d208ef95aa [arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.
llvm-svn: 143698
2011-11-04 15:58:08 +00:00
Benjamin Kramer 62144477eb Remove unused variables.
llvm-svn: 143696
2011-11-04 15:05:51 +00:00
Chandler Carruth 4c81dfacbb Sink the strange '-stdlib=...' flag handling into the C++ include
handling logic of the generic ToolChain. This flag, despite its name,
has *nothing* to do with the GCC flag '-nostdlib' that relates
(exclusively) to the linking behavior. It is a most unfortunate name in
that regard...

It is used to tell InitHeaderSearch.cpp *which* set of C++ standard
library header search paths to use -- those for libstdc++ from GCC's
installation, or those from a libc++ installation. As this logic is
hoisted out of the Frontend, and into the Driver as part of this
ToolChain, the generic method will be overridden for the platform, where
it can implement this logic directly. As such, hiding the CC1 option
passing in the generic space is a natural fit despite the odd naming.

Also, expand on the comments to clarify whats going on, and tidy up the
Tools.cpp code now that its simpler.

llvm-svn: 143687
2011-11-04 07:43:33 +00:00
Chandler Carruth 491db32444 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.

llvm-svn: 143686
2011-11-04 07:34:47 +00:00
Chandler Carruth 9802c1406f 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.

llvm-svn: 143685
2011-11-04 07:12:58 +00:00
Chandler Carruth 6bfd84f25d 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.

llvm-svn: 143684
2011-11-04 07:12:53 +00:00
Richard Smith ed5165ff52 Constant expression evaluation: refactor to start the groundwork for coping with
initializations which refer indirectly to elements of the object being
initialized.

llvm-svn: 143680
2011-11-04 05:33:44 +00:00
Richard Smith 96e0c101fe 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.

llvm-svn: 143677
2011-11-04 02:25:55 +00:00
Richard Smith e9e20dd302 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.

llvm-svn: 143674
2011-11-04 01:10:57 +00:00
Richard Trieu 364ee42ee8 In the AST dump, add a space between the type and value for CharacterLiteral.
llvm-svn: 143667
2011-11-03 23:56:23 +00:00
Akira Hatanaka f3879ee666 Use a single integer type for a sub-doubleword part of a byval structure.
llvm-svn: 143666
2011-11-03 23:31:00 +00:00
Eli Friedman 3d9f47fe6f Fix alignment on alloca's for parameters using ABIArgInfo::Expand.
llvm-svn: 143658
2011-11-03 21:39:02 +00:00
Chad Rosier 52d00e4815 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.]

llvm-svn: 143657
2011-11-03 21:23:39 +00:00
Argyrios Kyrtzidis 462ff35d44 After resetting the diagnostic state, set the number of warning occurring in the preamble.
llvm-svn: 143647
2011-11-03 20:57:33 +00:00
Eli Friedman eadd3e81a0 Fix the alignment on scalar parameter variables so that it matches what the AST thinks it should be. Per report on cfe-dev.
llvm-svn: 143645
2011-11-03 20:31:28 +00:00
Argyrios Kyrtzidis f50f7b2c65 [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.

llvm-svn: 143644
2011-11-03 20:28:19 +00:00
Douglas Gregor 7f763f1018 Force test to use the non-fragile ABI
llvm-svn: 143642
2011-11-03 19:58:50 +00:00
Argyrios Kyrtzidis 52d87a6f82 [libclang] Move CursorVisitor to its own header.
llvm-svn: 143639
2011-11-03 19:02:34 +00:00
Argyrios Kyrtzidis 04cf92fe7c [libclang] Make sure pointing inside the #include of the fields will return the struct.
llvm-svn: 143638
2011-11-03 19:02:30 +00:00
Argyrios Kyrtzidis 3cefc9d742 [libclang] Use CursorVisitor::Visit instead of invoking the visitor directly.
llvm-svn: 143637
2011-11-03 19:02:28 +00:00
Argyrios Kyrtzidis deb47d17dd [libclang] Add a test for "targeting" a field inside an #include that only
contains fields.

llvm-svn: 143636
2011-11-03 19:01:07 +00:00
Douglas Gregor 21ceb18429 Extend IsSimplyAccessible to check for Objective-C instance variable
accessibility. Fixes <rdar://problem/3727335>.

llvm-svn: 143635
2011-11-03 19:00:24 +00:00