Commit Graph

32654 Commits

Author SHA1 Message Date
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
Argyrios Kyrtzidis b573542e10 [PCH] Don't store the source range for each preprocessed entity since
we already have the range in the PPEntityOffsets array.

llvm-svn: 140209
2011-09-20 23:27:41 +00:00
Argyrios Kyrtzidis 86ec600f57 [PCH] Merge ASTReader::LoadPreprocessedEntity with ReadPreprocessedEntity
and don't store the ID for each preprocessed entity.

llvm-svn: 140208
2011-09-20 23:27:38 +00:00
Argyrios Kyrtzidis 45e8cf5732 [libclang] When pointing at a macro expansion inside a macro argument,
return a cursor for the inner macro.

llvm-svn: 140207
2011-09-20 23:27:33 +00:00
Anna Zaks d70da08160 [analyzer] Refactor PathDiagnosticLocation: Remove SourceRange member from PathDiagnosticLocation - FullSourceLoc Loc and PathDiagnosticRange Range are sufficient.
llvm-svn: 140206
2011-09-20 23:27:32 +00:00
Anna Zaks 6422e95c66 [analyzer] Refactor PathDiagnosticLocation: Add comments. Remove the last constructor which could allow invalid locations to slip in.
llvm-svn: 140200
2011-09-20 22:43:32 +00:00
Anna Zaks 6800ab437c [analyzer] Remove dead code. (This code is trying to implement the idea that PathDiagnosticClient could implement DiagnosticClient and has been dead for a while).
llvm-svn: 140198
2011-09-20 22:30:48 +00:00
Argyrios Kyrtzidis 7c2b28a16f In SourceManager::translateLineCol, handle the case where we are pointing
directly at the end of the source file.

llvm-svn: 140192
2011-09-20 22:14:54 +00:00
Argyrios Kyrtzidis b89327ec84 Remove PreprocessingDirectiveKind since it's not necessary.
llvm-svn: 140191
2011-09-20 22:14:52 +00:00
Argyrios Kyrtzidis 0d48fb89c0 The location of the name in MacroDefinition is the beginning of its range,
don't store an extra location for it.

llvm-svn: 140190
2011-09-20 22:14:48 +00:00
Francois Pichet b3642c2c7a Move Microsoft access specifier bug emulation from -fms-extensions to -fm-compatibility.
llvm-svn: 140189
2011-09-20 22:08:26 +00:00
Bob Wilson 3e42bc55db For i386 kext fallback to llvm-gcc, search paths for several Darwin versions.
This replaces the hack to read UNAME_RELEASE from the environment when
identifying the OS version on Darwin, and it's more flexible.  It's also
horribly ugly, but at least this consolidates the ugliness to touch less of
the code so that it will be easier to rip out later.

llvm-svn: 140187
2011-09-20 22:00:38 +00:00