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

43459 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis 04f5db699e Revert "[lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__."
Per feedback by Doug, we should avoid platform-specific implementations
in lib/Headers as much as possible.

This reverts commit r178110.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178181 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:22:45 +00:00
Fariborz Jahanian 7e35274df4 Objective-C: Issue more precise warning when user
is accessing 'isa' as an object pointer.
// rdar://13503456. FixIt to follow in another patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178179 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:19:25 +00:00
Rafael Espindola e81fdb1fdd Cleanup clang's specializations of simplify_type.
Now that the basic implementation in llvm has been fixed, simplify the
specializations in clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178173 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 19:38:14 +00:00
Chad Rosier 9083628fec Update the error handing static functions for r178161.
Part of rdar://13296693


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178162 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 18:28:23 +00:00
Jordan Rose b061720ddf [analyzer] Use evalBind for C++ new of scalar types.
These types will not have a CXXConstructExpr to do the initialization for
them. Previously we just used a simple call to ProgramState::bindLoc, but
that doesn't trigger proper checker callbacks (like pointer escape).

Found by Anton Yartsev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 18:10:35 +00:00
Anna Zaks 3655119ab1 [analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:36:01 +00:00
Anna Zaks 4a49df3be9 [analyzer] Ensure that the node NilReceiverBRVisitor is looking for is not reclaimed
The visitor should look for the PreStmt node as the receiver is nil in the PreStmt and this is the node. Also, tag the nil
receiver nodes with a special tag for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:35:58 +00:00
Argyrios Kyrtzidis ea744ab5f3 [modules] Make sure enabled diagnostic pragmas inside the module don't affect the translation unit that
imports the module.

Getting diagnostic sections from modules properly working is a fixme.

rdar://13516663

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:17:23 +00:00
Alexander Kornienko 94b748ff16 Insert extra new line before access specifiers.
Summary: Insert extra new line before access specifiers.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178149 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:08:02 +00:00
Douglas Gregor c544ba0969 <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file.
This option can be useful for end users who want to know why they
ended up with a ton of different variants of the "std" module in their
module cache. This problem should go away over time, as we reduce the
need for module variants, but it will never go away entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178148 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 16:47:18 +00:00
Rafael Espindola 8343f8e00a Add const in preparation for a simplify_type change in llvm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178146 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 15:37:54 +00:00
Tim Northover 3d91ddb9a9 Add another expected note. Two errors => two notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 13:50:57 +00:00
Evgeniy Stepanov 6ddfe4e067 Disable ASan/MSan symbolization of reports in tests.
It was using an instrumented symbolizer binary, which is a potential fork bomb.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 13:11:46 +00:00
Evgeniy Stepanov c528aa2e23 Mark comment-to-html-xml-conversion test as XFAIL:msan, in addition to valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 13:05:40 +00:00
Douglas Gregor 6bed88e9d2 <rdar://problem/13317030> Consider using directives when performing unqualified name lookup into declarations contexts represented by the qualified-id but not in the actual scope hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 12:51:49 +00:00
Alexander Kornienko 5262dd909a Split line comments
Summary:
Split line comments that exceed column limit + fixed leading whitespace
handling when splitting block comments.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178133 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 11:52:18 +00:00
Bill Wendling f2ff5bdef0 Fix testcase to add expected note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178122 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 06:45:37 +00:00
Bill Wendling d835d9496c Pass the diagnostic in for better error messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178120 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 06:06:26 +00:00
Argyrios Kyrtzidis 08aba1bc55 [lib/Headers] Break the module import cycle between _Builtin_intrinsics.sse and _Builtin_intrinsics.sse2
Module "sse" implicitly exports module "sse2".
This is bad because we also have module "sse2" export module "sse" (as intended) so we end up with a cycle
in the module import graph:
1. sse2 -> (also imports) sse
2. sse -> (also imports) sse2

To eliminate the cycle remove 2.; importing module "sse2" will also import module "sse", but just importing
module "sse" will not also import module "sse2".

rdar://13240552

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178117 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 05:12:34 +00:00
Joao Matos 9ef9875bbe Implement compiler intrinsics needed for compatibility with MSVC 2012 <type_traits>.
Patch by me and Ryan Molden.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178111 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:34:16 +00:00
Argyrios Kyrtzidis 07ffbd74e2 [lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__.
This makes it identical with the system definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178110 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:25:37 +00:00
Argyrios Kyrtzidis 52151fd57e [modules] Before marking the module imported macros as ambiguous, check if this is a case where
the system macro uses a not identical definition compared to a macro from the clang headers.

For example (these come from different modules):
   \#define LONG_MAX __LONG_MAX__ (clang's limits.h)
   \#define LONG_MAX 0x7fffffffffffffffL (system's limits.h)
in which case don't mark them ambiguous to avoid the "ambiguous macro expansion" warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:25:34 +00:00
Argyrios Kyrtzidis 7ca8e9160a Remove IdentifierInfo::setHadMacroDefinition()
It's not used anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178108 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:25:31 +00:00
Argyrios Kyrtzidis 89b8f06ed7 [PCH/modules] Remove HiddenName::MacroUndef
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178107 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:25:28 +00:00
Argyrios Kyrtzidis d560ce3b66 [Preprocessor] Remove PPMutationListener.
It's not used anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178106 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:25:24 +00:00
Argyrios Kyrtzidis 35803282ef [modules] Re-enable the "ambiguous expansion of macro" warning.
Also update "test/Modules/macros.c" to test modified semantics:
-When there is an ambiguous macro, expand using the latest introduced version, not the first one.
-#undefs in submodules cause the macro to not be exported by that submodule, it doesn't cause
 undefining of macros in the translation unit that imported that submodule.
 This reduces macro namespace interference across modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178105 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 01:25:19 +00:00
Richard Smith 12fef490dc PR15597: Fix a confusion between the implicit exception specification and the
uninstantiated exception specification when a special member within a class
template is both defaulted and given an exception specification on its first
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178103 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 00:22:47 +00:00
Chad Rosier a03fc6e249 If we're unable to create the TargetMachine, then just quit producing the
backend output; there's no need to report a fatal error.  This reverts r178042.
Part of rdar://13295753 and rdar://13401547


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178102 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 00:14:35 +00:00
David Blaikie 5035c483b7 Update debug info test for schema change made to LLVM.
This accounts for the addition of another field to DIScopes that will be used
to store a list of DIImportedModules in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178100 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 00:08:24 +00:00
John McCall fdb468fc8a Make the -Wreinterpret-base-class logic safe against invalid
declarations at any point. Patch by Alexander Zinenko, and
report by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178098 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 00:03:48 +00:00
Ted Kremenek 8b43d2b0ea Split "incomplete implementation" warnings for ObjC into separate warnings.
Previously all unimplemented methods for a class were grouped under
a single warning, with all the unimplemented methods mentioned
as notes.  Based on feedback from users, most users would like
a separate warning for each method, with a note pointing back to
the original method declaration.

Implements <rdar://problem/13350414>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178097 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 00:02:21 +00:00
Douglas Gregor defa32ef4f <rdar://problem/13278115> Improve diagnostic when failing to bind an rvalue reference to an lvalue of compatible type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178095 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:59:23 +00:00
Anna Zaks ddb61764ab [analyzer] Better test for r178063.
Jordan pointed out that my previously committed test was bogus.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178094 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:58:52 +00:00
Anna Zaks 1533833e21 [analyzer] Make sure IDC works for ‘NSContainer value/key is nil’ checks.
Register the nil tracking visitors with the region and refactor trackNullOrUndefValue a bit.

Also adds the cast and paren stripping before checking if the value is an OpaqueValueExpr
or ExprWithCleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:58:49 +00:00
David Blaikie 2fcadbeecb Remove magic number usage from CGDebugInfo with new DICompositeType::setContainingType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178092 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:47:35 +00:00
Chad Rosier c48d575f2e [driver] Do not generate crash diagnostics if the compilation command failed
to execute as the crash will surely reoccur while generating the diagnostics.
rdar://13362359


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:41:30 +00:00
Douglas Gregor 0162c1ce29 <rdar://problem/13267210> Ensure that Sema::CompareReferenceRelationship returns consistent results with invalid types.
When Sema::RequireCompleteType() is given a class template
specialization type that then fails to instantiate, it returns
'true'. On subsequent invocations, it can return false. Make sure that
this difference doesn't change the result of
Sema::CompareReferenceRelationship, which is expected to remain stable
while we're checking an initialization sequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178088 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:36:30 +00:00
Chad Rosier 7020346e41 Remove a FIXME that's not planned to be fixed. We only generated crash
diagnostics for the first failing command.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178086 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 23:25:41 +00:00
Douglas Gregor e79ce292d9 <rdar://problem/13473493> Handle 'this->' insertion recovery within trailing return types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178081 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 22:43:55 +00:00
David Blaikie d74505e985 Debug Info: remove use of magic numbers to tweak specific debug info metadata fields
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178079 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 22:09:53 +00:00
Anna Zaks 8a660eb108 [analyzer] Change inlining policy to inline small functions when reanalyzing ObjC methods as top level.
This allows us to better reason about(inline) small wrapper functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178063 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:57:58 +00:00
Anna Zaks df5f80f8a3 [analyzer] micro optimization as per Jordan’s feedback on r177905.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178062 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:57:51 +00:00
NAKAMURA Takumi 4e493bd968 clang/test/CodeGenCXX/debug-info-namespace.cpp: Disable it on non-bash lit for now.
With dosish filename, it misgenerates an improper extra entry.

!1 = metadata !{metadata !"E:\5Cllvm\5Cllvm-project\5Cclang\5Ctest\5CCodeGenCXX/debug-info-namespace.cpp", metadata !"E:\5Cllvm\5Cbuild\5Cninja-win32-vs11\5Ctools\5Cclang\5Ctest\5CCodeGenCXX"}

!8 = metadata !{metadata !"E:\5Cllvm\5Cllvm-project\5Cclang\5Ctest\5CCodeGenCXX\5Cdebug-info-namespace.cpp", metadata !"E:\5Cllvm\5Cbuild\5Cninja-win32-vs11\5Ctools\5Cclang\5Ctest\5CCodeGenCXX"}

!8 is unexpected.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178061 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:57:40 +00:00
Rafael Espindola 6c82fc65e4 Remove useGlobalsForAutomaticVariables.
It is unused since pic support went away.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178055 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:41:47 +00:00
Reid Kleckner 852e3d7143 [ms-cxxabi] Give the MS inheritance attributes a base class
Required making a handful of changes to the table generator.  Also adds
an unspecified inheritance attribute.  This opens the path for us to
apply these attributes to C++ records implicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178054 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:30:28 +00:00
Manman Ren 94d46b5510 Fix uninitialized read of CalleeWithThisReturn.
Initialize CalleeWithThisReturn to 0 in the constructor.
Also revert r170815 since checking CalleeWithThisReturn is faster.

PR15598


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178053 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:29:15 +00:00
Chad Rosier e2359e2132 Fix a crasher by reporting a fatal error if we're unable to create the target
machine and one is required.
Part of rdar://13295753


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178042 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 18:01:48 +00:00
Michael Liao 72339a0d16 Add PRFCHW intrinsic support
- Add head 'prfchwintrin.h' to define '_m_prefetchw' which is mapped to
  LLVM/clang prefetch builtin
- Add option '-mprfchw' to enable PRFCHW feature and pre-define '__PRFCHW__'
  macro



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 17:52:08 +00:00
Argyrios Kyrtzidis c56fff7fd2 [Preprocessor/Modules] Separate the macro directives kinds into their own MacroDirective's subclasses.
For each macro directive (define, undefine, visibility) have a separate object that gets chained
to the macro directive history. This has several benefits:

-No need to mutate a MacroDirective when there is a undefine/visibility directive. Stuff like
 PPMutationListener become unnecessary.
-No need to keep extra source locations for the undef/visibility locations for the define directive object
 (which is the majority of the directives)
-Much easier to hide/unhide a section in the macro directive history.
-Easier to track the effects of the directives across different submodules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178037 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 17:17:01 +00:00
Reid Kleckner 1232e279b4 [ms-cxxabi] Mangle vector types
Summary:
The only vector types a user can pass from MSVC code to clang code are
the ones from *mmintrin.h, so we only have to match the MSVC mangling
for these types.  MSVC mangles the __m128 family of types as tag types,
which we match.  For other vector types, we emit a unique tag type
mangling that won't match anything produced by MSVC.

Reviewers: rjmccall

CC: chandlerc, timurrrr, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 16:56:59 +00:00