Commit Graph

32665 Commits

Author SHA1 Message Date
Douglas Gregor b1fa148837 Don't propagate the 'availability' attribute through declaration
merging for overrides. One might want to make a method's availability
in a superclass different from that of its subclass. Fixes
<rdar://problem/10166223>.

llvm-svn: 140406
2011-09-23 20:23:42 +00:00
Richard Trieu 021baa373f Add a new warning to -Wliteral-conversion to catch cases where a string literal
is cast to a boolean.  An exception has been made for string literals in
logical expressions to allow the common case of use in assert statements.

bool x;
x = "hi";  // Warn here
void foo(bool x);
foo("hi");  // Warn here
assert(0 && "error");
assert("error);  // Warn here

llvm-svn: 140405
2011-09-23 20:10:00 +00:00
Douglas Gregor 0c254a00c1 Clean up parsing the category names in interfaces slightly, using
MatchRHSPunctuation appropriately and giving a useful source location
for the complaint about attributes being added to a category.

llvm-svn: 140404
2011-09-23 19:19:41 +00:00
Anna Zaks ff7da05670 Move immutable map canonization out of the removeDeadBindings loop (via using ImmutableMapRef). Gives ~2% speedup.
llvm-svn: 140403
2011-09-23 19:14:09 +00:00
Douglas Gregor 34bc6e5ee4 When checking for weak vtables, check whether the actual definition of
the key function is inline, rather than the original
declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes
<rdar://problem/9979458>. 

llvm-svn: 140400
2011-09-23 19:04:03 +00:00
Fariborz Jahanian c367b8f8cc objc-gc: Fix a corner case where clang fails to generate GC
write barrier with captured pointer to object. // rdar://10150823

llvm-svn: 140399
2011-09-23 18:57:30 +00:00
Douglas Gregor 0745ac8016 Fix up comment now that 'new' is no longer a virt-specifier, from Aaron Ballman
llvm-svn: 140389
2011-09-23 16:58:49 +00:00
Douglas Gregor 4c2e38fe1e Eliminate an MSVC comparison warning, from Aaron Ballman
llvm-svn: 140388
2011-09-23 16:57:55 +00:00
Francois Pichet 44bb90d9d9 Fix wrong comment about reentering template scope for -fdelayed-template-parsing.
llvm-svn: 140382
2011-09-23 16:02:49 +00:00
David Blaikie 7900020616 More missing header inclusions from llvm_unreachable migration.
llvm-svn: 140369
2011-09-23 05:57:42 +00:00
David Blaikie 76bd3c80d4 Fix missing includes for llvm_unreachable
llvm-svn: 140368
2011-09-23 05:35:21 +00:00
David Blaikie 83d382b1ca Switch assert(0/false) llvm_unreachable.
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Benjamin Kramer 559865c89d Reenable -cxx-isystem for Objective C++, until I come up with a better solution
llvm-svn: 140365
2011-09-23 02:25:14 +00:00
NAKAMURA Takumi 7d7d1afeb7 unittests/Basic/FileManagerTest.cpp: Suppress warnings on gcc.
llvm-svn: 140364
2011-09-23 01:53:05 +00:00
NAKAMURA Takumi b2e55aeb45 CMake: Define ${LLVM_TABLEGEN_EXE} with explicit ${CMAKE_EXECUTABLE_SUFFIX} on standalone build. Or build might fail with NMake.
Thanks to Nicolas Le Gland!

llvm-svn: 140360
2011-09-23 00:52:55 +00:00
Douglas Gregor 5223529b27 Don't finalize checking of base and member initializers for a
constructor template. Fixes PR10457.

llvm-svn: 140350
2011-09-22 23:04:35 +00:00
Francois Pichet 8134518331 [microsoft] Fix a bug in -fdelayed-template-parsing mode where we were not reentering the delayed function context correctly. The problem was that all template params were reintroduced inside the same scope. So if we had a situation where we had 2 template params with the same name at different scope then clang would generate an error about ambiguous name.
The solution is to create a new ParseScope(Scope::TemplateParamScope) for each template scope that we want to reenter. (from the outmost to the innermost scope)

This fixes some errors when parsing MFC code with clang.

llvm-svn: 140344
2011-09-22 22:14:56 +00:00
Benjamin Kramer dcae044a10 Don't test unix path seperators, that will fail on windows.
llvm-svn: 140343
2011-09-22 22:14:48 +00:00
Benjamin Kramer e3faaaba79 See if going through env pacifies the windows buildbots.
llvm-svn: 140342
2011-09-22 22:08:09 +00:00
Benjamin Kramer 8404eb0bad Add support for CPATH and friends.
This moves the existing code for CPATH into the driver and adds the environment lookup and path splitting there.
The paths are then passed down to cc1 with -I options (CPATH), added after the normal user-specified include dirs.
Language specific paths are passed via -LANG-isystem and the actual filtering is performed in the frontend.

I tried to match GCC's behavior as close as possible

Fixes PR8971.

llvm-svn: 140341
2011-09-22 21:41:16 +00:00
Argyrios Kyrtzidis e523e389b2 Do manual binary search for preprocessing entities because their end locations
may be unordered and MSVC's debug-mode doesn't like it.

llvm-svn: 140337
2011-09-22 21:17:02 +00:00
Bill Wendling 8c4b716352 Don't remove filters.
It's not valid to remove filters from landingpad instructions, even if we catch
the type. The metadata won't be set up correctly.

Testcase is projects/llvm-test/SingleSource/UnitTests/EH/filter-2.cpp.

llvm-svn: 140335
2011-09-22 20:32:54 +00:00
Douglas Gregor eb4089ad01 Only trigger the initialize-an-array-via-elementwise-copy/move code
generation when we're dealing with an implicitly-defined copy or move
constructor. And, actually set the implicitly-defined bit for
implicitly-defined constructors and destructors. Should fix self-host.

llvm-svn: 140334
2011-09-22 20:32:43 +00:00
Argyrios Kyrtzidis e9a24435c6 Don't use TemplateArgumentListInfo inside AST nodes because it may leak.
Use ASTTemplateArgumentListInfo instead.

llvm-svn: 140331
2011-09-22 20:07:09 +00:00
Argyrios Kyrtzidis de6aa08013 Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality change.
llvm-svn: 140330
2011-09-22 20:07:03 +00:00
Ted Kremenek 34a1d37ba3 Place diagnostic warn_ivar_use_hidden under the flag -Wshadow-ivar.
llvm-svn: 140329
2011-09-22 19:24:22 +00:00
Anna Zaks 9db35a8750 ST->scanReachableSymbols() is creating a SubRegionMap (SRM) on every call since one SRM is created in each ScanReachableSymbols instance. Creating the object just once and calling only scan inside the loop gives ~ 14% speed up of the StaticAnalyzer run (Release+Asserts).
Pull out the declaration of the ScanReachableSymbols so that it can be used directly. Document ProgramState::scanReachableSymbols() methods.

llvm-svn: 140323
2011-09-22 18:10:41 +00:00
Justin Holewinski 0542df5198 PTX: Clean up target options code
llvm-svn: 140320
2011-09-22 17:57:40 +00:00
Douglas Gregor da9740061b Fix the ASTImporter's lookup for anonymous structs/unions that get a
linkage name via typedef. Patch from/fixes PR10958.

llvm-svn: 140317
2011-09-22 17:51:56 +00:00
Douglas Gregor 4ea5dec0e5 Don't allow template argument deduction to deduce a placeholder type,
ever. Fixes PR10939.

llvm-svn: 140304
2011-09-22 15:57:07 +00:00
Douglas Gregor 8a556ce512 Explicitly-defaulted copy/move constructors are not "implicit", but
they still need the logic to cope with array member
initialization. Fixes PR10720.

llvm-svn: 140302
2011-09-22 15:15:51 +00:00
Tobias Grosser 766bcc27dc In OpenCL, conversions between different vector types are disallowed
OpenCL 6.2.1 says: "Implicit conversions between built-in vector data types are
disallowed."  OpenCL 6.2.2 says: "Explicit casts between vector types are not
legal."  For example:

uint4 u = (uint4)(1);
int4 i = u; // invalid implicit conversion
int4 e = (int4)u; // invalid explicit conversion

Fixes PR10967. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

llvm-svn: 140300
2011-09-22 13:03:14 +00:00
David Blaikie 751c558d8e ArrayRef-ifying the fields passed to Sema::ActOnFields
llvm-svn: 140293
2011-09-22 02:58:26 +00:00
David Blaikie b9c168a265 ArrayRef-ifying the UnexpandedParameterPacks passed to Sema::CheckParameterPacksForExpansion
llvm-svn: 140290
2011-09-22 02:34:54 +00:00
David Blaikie 319b738e17 ArrayRef-ifying MacroArgs::create's arguments argument.
llvm-svn: 140288
2011-09-22 02:03:12 +00:00
David Blaikie 441417a954 Simplify the last character check.
llvm-svn: 140287
2011-09-22 01:35:49 +00:00
Tobias Grosser 0a3a22fe66 In the OpenCL mode, the AltiVec mode must be off and checks must be strict
OpenCL is different from AltiVec in the way it supports vector literals.  OpenCL
is strict with regards to semantic checks.  For example, implicit conversions
and explicit casts between vectors of different types are disallowed.

Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

llvm-svn: 140270
2011-09-21 18:28:29 +00:00
David Blaikie 9c70e04bec ArrayRef-ifying Function/BlockDecl's setParams
llvm-svn: 140268
2011-09-21 18:16:56 +00:00
Benjamin Kramer 2e9d9cfc39 More MSVC9 unbreaking.
llvm-svn: 140256
2011-09-21 16:58:20 +00:00
Douglas Gregor 7c26c04ba9 Diagnose attempts to write a templated data member, from Stepan
Dyatkovskiy! Fixes PR10896.

llvm-svn: 140250
2011-09-21 14:40:46 +00:00
John McCall 30909031a7 Enforce access control for conversion operators used in contextual
conversions (rather than just call-arguments).

llvm-svn: 140244
2011-09-21 08:36:56 +00:00
John McCall 9cb88ec8d1 I had meant to locally revert this test.
llvm-svn: 140243
2011-09-21 08:34:49 +00:00
John McCall cbc038a6c3 ANSI C requires that a call to an unprototyped function type succeed
if the definition has a non-variadic prototype with compatible
parameters.  Therefore, the default rule for such calls must be to
use a non-variadic convention.  Achieve this by casting the callee to
the function type with which it is required to be compatible, unless
the target specifically opts out and insists that unprototyped calls
should use the variadic rules.  The only case of that I'm aware of is
the x86-64 convention, which passes arguments the same way in both
cases but also sets a small amount of extra information;  here we seek
to maintain compatibility with GCC, which does set this when calling
an unprototyped function.

Addresses PR10810 and PR10713.

llvm-svn: 140241
2011-09-21 08:08:30 +00:00
Francois Pichet 3b4de99158 [microsoft] Move missing typename warning from -fms-extensions to -fms-compatibility. Also allow the missing typename warning at function scope.
llvm-svn: 140240
2011-09-21 07:59:49 +00:00
Benjamin Kramer 5ce7f109cf Fix MSVC9 build by providing a full comparator object to lower_bound.
llvm-svn: 140238
2011-09-21 06:42:26 +00:00
Richard Trieu cf24656ea4 Change:
assert(!"error message");

To:

  assert(0 && "error message");

which is more consistant across the code base.

llvm-svn: 140232
2011-09-21 02:50:14 +00:00
Richard Trieu e4f3180fec Change "ivar" to true for a boolean function argument. Since string literals are cast to true, this should no effect on behavior.
llvm-svn: 140231
2011-09-21 02:46:06 +00:00
Akira Hatanaka 94ab554749 Add case labels for Mips64 architectures.
llvm-svn: 140226
2011-09-21 02:13:07 +00:00
Anna Zaks 15ca5e7a21 [analyzer] Fix a bug where PathDiagnosticLocation did not generate a valid range and add asserts to check validity of locations early on. Ignore invalid ranges in PathDiagnosticPiece (they could be added by checker writers).
Addresses radar://10124836 and radar://radar10102244.

llvm-svn: 140218
2011-09-21 00:35:58 +00:00
Argyrios Kyrtzidis 712512bb36 [ARC] Allow forming 'id*' in an unevaluated context. Fixes rdar://10148540.
llvm-svn: 140212
2011-09-20 23:49:22 +00:00