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

36244 Коммитов

Автор SHA1 Сообщение Дата
David Blaikie e31b8fb25b Enable warn_impcast_literal_float_to_integer by default.
This diagnostic seems to be production ready, it's just an oversight that it
wasn't turned on by default.

The test changes are a bit of a mixed bag. Some tests that seemed like they
clearly didn't need to use this behavior have been modified not to use it.
Others that I couldn't be sure about, I added the necessary expected-warnings
to.

It's possible the diagnostic message could be improved to make it clearer that
this warning can be suppressed by using a value that won't lose precision when
converted to the target type (but can still be a floating point literal, such
as "bool b = 1.0;").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154068 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05 00:16:44 +00:00
NAKAMURA Takumi 371a0c8bd3 clang/test/Tooling/clang-check.cpp: Mark it as XFAIL also on cygwin.
It seems clang-check doesn't like gcc driver on cygming. Investigating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 23:23:19 +00:00
Douglas Gregor 5b4bf13761 Allow a conversion from the empty initializer list {} to an
std::initializer_list<T> so long as <T> is known. This conversion has
identity rank.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 23:09:20 +00:00
Nico Weber 3953911de1 Honor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.
Review at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055759.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154064 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 23:00:14 +00:00
Chad Rosier 30fe6baf95 [driver] When using the -mfpmath= option, add an error message when trying to
enable neonfp on a CPU that doesn't support NEON.
rdar://11108618


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154061 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 22:13:40 +00:00
Richard Smith 397f327123 Hardcode a triple to prevent the test failing on targets which don't support __thread.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 21:54:03 +00:00
Simon Atanasyan 12093861bb Test commit to check commit access.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 21:22:57 +00:00
Richard Smith b4051e7047 Implement C++11 [temp.arg.nontype]'s permission to use the address of an object
or function with internal linkage as a non-type template argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 21:11:30 +00:00
Dan Gohman 465a8998bd Fix an oversight: don't run ARC optimization cleanup at -O0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 21:04:56 +00:00
Chad Rosier f80f2a5098 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:56:36 +00:00
Chad Rosier 9931727577 [driver] Add a static helper function for handling -mfpu= to remove some code
duplication.  No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:51:35 +00:00
David Blaikie d624a5b43a Reduce variable scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:43:14 +00:00
Chad Rosier 7a938fa66b [driver] Create a new -mfpmath= option, which is used to control whether clang
uses Neon instructions for single-precision FP.

-mfpmath=neon is analogous to passing llc -mattr=+neonfp.
-mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp.

rdar://11108618


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154046 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:39:32 +00:00
Fariborz Jahanian 878f8502eb objc-arc: provide a warning when 'receiver' of a message is 'weak'
in arc mode and opted-in with -Wreceiver-is-weak flag.
// rdar://10225276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154042 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:05:25 +00:00
Ted Kremenek bb811cab1b Look through chains of 'x = y = z' when employing silencing heuristics in the DeadStoresChecker.
Fixes <rdar://problem/11185138>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154040 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 19:58:03 +00:00
Fariborz Jahanian e982cc0ea3 modern objc translator. Add more
rewriter specific option to cc1 with -rewrite-objc.
// rdar://11143173


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154037 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 18:50:28 +00:00
Fariborz Jahanian 15b77319d0 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154035 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 18:28:00 +00:00
Ted Kremenek 07189521a1 Include the "issue context" (e.g. function or method) where a static analyzer issue occurred in the plist output.
Fixes <rdar://problem/11004527>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 18:11:35 +00:00
Douglas Gregor f54486acc1 Move the computation of the lambda mangling information (mangling
number + context) to the point where we initially start defining the
lambda, so that the linkage won't change when that information is made
available. Fixes the assertion in <rdar://problem/11182962>.

Plus, actually mangle the context of lambdas properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 17:40:10 +00:00
Fariborz Jahanian 8e86b2d03e objective-c modern translation. Remove commenting out
of extern "C". // rdar://11169733



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154025 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 17:16:15 +00:00
Bob Wilson e1fde1d8e3 Simplify test a bit now that it's not actually running cc1plus.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154018 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 14:43:40 +00:00
NAKAMURA Takumi e23d0b2a6a clang/test/Tooling/clang-check.cpp: Mark it as XFAIL mingw,msvc for now.
It seems JSON parser doesn't like path separator '\' on Win32 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 14:35:23 +00:00
NAKAMURA Takumi 01b8ca52fe Tooling.cpp: Reorder inclusions according to the conding standards.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154016 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 13:59:41 +00:00
NAKAMURA Takumi b175d0f054 Tooling.cpp: Don't refer to $ENV{PWD}. Use llvm::sys::fs instead.
$ENV{PWD} is not expected to be set on all hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 13:59:36 +00:00
David Chisnall 9595dae5f7 Don't crash (assert failure) when generating blocks for C++ types with a non-const copy constructor.
This was caused by the code deciding the number of fields in the byref structure using a different test to the part of the code creating the GEPs into said structure.  



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 13:07:13 +00:00
Manuel Klimek 92f74097df Updated release notes for tooling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154012 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 12:53:16 +00:00
Benjamin Kramer 29b815cde2 clangFrontend depends on clangEdit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 12:25:11 +00:00
Manuel Klimek 43d5aac4b0 Add the dependency on clang-check to clang-test, so clang-check
can be integration tested.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154009 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 12:18:22 +00:00
Manuel Klimek cb971c6726 Adds a tooling library.
Provides an API to run clang tools (FrontendActions) as standalone tools,
or repeatedly in-memory in a process. This is useful for unit-testing,
map-reduce style applications, source transformation daemons or command line
tools.

The ability to run over multiple translation units with different command
line arguments enables building up refactoring tools that need to apply
transformations across translation unit boundaries.

See tools/clang-check/ClangCheck.cpp for an example.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 12:07:46 +00:00
Benjamin Kramer c9aa9c00fc Don't actually execute gcc during testing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 09:05:21 +00:00
Bob Wilson 6fb522ef3e Add a testcase for svn r153854.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154001 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 07:06:30 +00:00
Richard Smith 9033092415 Fix diagnostic typos: "non-template arguments" vs "non-type template arguments".
No test updates: we don't appear to have any test coverage for these diagnostics!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 06:47:16 +00:00
Richard Smith 5a5a971908 For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to
be used with clang in c++98 mode.

Several other changes are still required for libstdc++4.7 to work with clang in
c++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 06:24:32 +00:00
Douglas Gregor d280389b42 When performing template argument deduction for an initializer list,
be sure to perform the argument type adjustments in
[temp.deduct.call]p2, e.g., array decay.

And, when performing these deductions in the context of 'auto', make
sure that we're deducing the P' in std::initializer_list<P'> rather
than the whole initializer list.

Together, this makes code like

  for( auto s : {"Deferred", "New", "Open", "Review"}) { }

work properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 05:10:53 +00:00
Douglas Gregor a9b55a499a Dependent-sequence initialization of a single element can be direct
list-initialization. Loosen an over-eager assertion to fix PR12453.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 04:06:51 +00:00
Argyrios Kyrtzidis a06642a3a3 [preprocessor] In Preprocessor::CachingLex() check whether there were more tokens
cached during the non-cached lex, otherwise we are going to drop them.

Fixes a bogus "_Pragma takes a parenthesized string literal" error when
expanding consecutive _Pragmas in a macro argument.

Part of rdar://11168596

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153994 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 02:57:01 +00:00
John McCall e14ba2cec3 When computing the conversion sequence in overload resolution
for converting an empty list to a scalar, be sure to initialize
the source and destination types so that comparison of conversion
sequences will work in case there are multiple viable candidates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153993 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 02:40:27 +00:00
Nick Lewycky 95e3872918 If something already instantiated is reinstantiated as an explicit definition,
keep the latter.

No test. This was noticed when poking around something else with GDB. I'm not
able to figure out a testcase that would break due to this bug. Sorry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153992 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 02:38:36 +00:00
John McCall beeb460aa5 ErrorUnsupported on array cookies in the MS C++ ABI code;
patch by Timur Iskhodzhanov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 01:33:45 +00:00
John McCall 73f428cf2c Enter an expression evaluation context when parsing
statement-expressions.  Prevents cleanups and such from being
claimed by the first full-expression in the block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 01:27:53 +00:00
Ted Kremenek 8e59838ed6 Fix dead store warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153988 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 00:55:33 +00:00
Ted Kremenek 88fc18120c Change BugReporter's usage of IsCachedDiagnostic to only impact pruning diagnostics emitted to the
console, and leave it up to PathDiagnosticConsumer to unique reports with the shortest path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 00:55:29 +00:00
Ted Kremenek 74a1a1f0b6 Silence dead store warning, and fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 00:55:25 +00:00
Ted Kremenek 6c656c3d89 Remove dead assignment to local variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153985 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 00:55:21 +00:00
Douglas Gregor 7b156ddae8 Add feature check "cxx_local_type_template_args" describing support
for templates with local template arguments, from Michel Morin! Fixes
PR12337.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153983 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 00:48:39 +00:00
Douglas Gregor b0d06e2e6b Eliminate obvious use-after-free. Fixes PR12433 / <rdar://problem/11168333>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153982 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 00:34:49 +00:00
Nick Lewycky 173a37a57b Remove more redundant lookups. Add a new "all_lookups_iterator" which provides
a view over the contents of a DeclContext without exposing the implementation
details of the StoredDeclsMap. Use this in LookupVisibleDecls to find the
visible declarations. Fixes PR12339!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 21:44:08 +00:00
Nick Lewycky 893a6eaf52 Don't treat synthesized ivars as being in the base class for the purpose of
looking up visible decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 20:26:45 +00:00
Kaelyn Uhrain 6d858d96ea Replace the workaround from r153445 with a proper fix.
Infinite recursion was happening when DiagnoseInvalidRedeclaration
called ActOnFunctionDeclarator to check if a typo correction works when
the correction was just to the nested-name-specifier because the wrong
DeclContext was being passed in. Unlike a number of functions
surrounding typo correction, the DeclContext passed in for a function is
the context of the function name after applying any nested name
specifiers, not the lexical DeclContext where the
function+nested-name-specifier appears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 18:20:11 +00:00
Fariborz Jahanian b3f904f79b modern objective-c translator: rewriter linkage spec.
// rdar://11169733


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153960 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 17:35:38 +00:00