]> granicus.if.org Git - clang/log
clang
13 years agoDon't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!
Douglas Gregor [Fri, 23 Sep 2011 23:43:36 +0000 (23:43 +0000)]
Don't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140435 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDriver: Use sys::Process::SetWorkingDirectory, for consistency.
Daniel Dunbar [Fri, 23 Sep 2011 23:32:02 +0000 (23:32 +0000)]
Driver: Use sys::Process::SetWorkingDirectory, for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140434 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc - fixes a crash when undefined typed property
Fariborz Jahanian [Fri, 23 Sep 2011 23:11:38 +0000 (23:11 +0000)]
objc - fixes a crash when undefined typed property
followed by it implementation crashes when attempt
is made to access the synthesized ivar.
// rdar://10177744

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140432 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a crash-on-invalid.
Matt Beaumont-Gay [Fri, 23 Sep 2011 22:39:23 +0000 (22:39 +0000)]
Fix a crash-on-invalid.

The token stream was not getting properly reset when leaving
ParseLexedMethodDef in some error cases. In the testcase, that caused later
accesses to the token stream to touch memory which had been freed as we
finished parsing the class definition. Major hat-tip to AddressSanitizer for
helping pinpoint the use-after-free, including the allocation and deallocation
points:

==21510== ERROR: AddressSanitizer heap-use-after-free on address 0x7feb3de87848 at pc 0x249f4e2 bp 0x7fff15a89df0 sp 0x7fff15a89ce0
READ of size 1 at 0x7feb3de87848 thread T0
  #0 0x249f4e2 clang::TokenLexer::Lex()
  #1 0x1c834a0 clang::Parser::ConsumeToken()
  #2 0x1c7dc0f clang::Parser::ParseDeclarationOrFunctionDefinition()
  #3 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
0x7feb3de87848 is located 1992 bytes inside of 3816-byte region [0x7feb3de87080,0x7feb3de87f68)
freed by thread T0 here:
  #0 0x3a22c19 free
  #1 0x1d136a1 clang::Parser::LexedMethod::~LexedMethod()
  #2 0x1cef528 clang::Parser::DeallocateParsedClasses()
  #3 0x1cef676 clang::Parser::PopParsingClass()
  #4 0x1cea094 clang::Parser::ParseCXXMemberSpecification()
  #5 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
  #6 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
  #7 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
  #8 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
previously allocated by thread T0 here:
  #0 0x3a2302d realloc
  #1 0x39d7c97 llvm::SmallVectorBase::grow_pod()
  #2 0x1ac588e llvm::SmallVectorImpl<>::push_back()
  #3 0x1d12d8b clang::Parser::ConsumeAndStoreUntil()
  #4 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
  #5 0x1d12c1e clang::Parser::ConsumeAndStoreUntil()
  #6 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
  #7 0x1d10042 clang::Parser::ParseCXXInlineMethodDef()
  #8 0x1cec51a clang::Parser::ParseCXXClassMemberDeclaration()
  #9 0x1ce9de5 clang::Parser::ParseCXXMemberSpecification()
  #10 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
  #11 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
  #12 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
  #13 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140427 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix up assertion a bit more
Douglas Gregor [Fri, 23 Sep 2011 22:07:41 +0000 (22:07 +0000)]
Fix up assertion a bit more

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140424 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDriver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.
Benjamin Kramer [Fri, 23 Sep 2011 21:03:19 +0000 (21:03 +0000)]
Driver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.

Also, on windows, chdir seems to live in <direct.h>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140414 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd DiagGroups to a couple of warnings.
Matt Beaumont-Gay [Fri, 23 Sep 2011 20:56:58 +0000 (20:56 +0000)]
Add DiagGroups to a couple of warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140411 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDriver: Test case that was supposed to go with previous commit.
Daniel Dunbar [Fri, 23 Sep 2011 20:35:31 +0000 (20:35 +0000)]
Driver: Test case that was supposed to go with previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140410 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDriver: Add a --working-directory option which can be used to cause the compiler
Daniel Dunbar [Fri, 23 Sep 2011 20:33:41 +0000 (20:33 +0000)]
Driver: Add a --working-directory option which can be used to cause the compiler
to operate "as if" in a certain working directory.
 - For now, we just implement this by changing the actual working directory, but
   eventually we would want to handle this transparently. This is useful to
   avoid an extra exec() pair in some situations, and will be something we would
   want to support for more flexibility in using the Clang libraries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140409 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a test triple. Who knew that all the world wasn't darwin?
Douglas Gregor [Fri, 23 Sep 2011 20:28:32 +0000 (20:28 +0000)]
Add a test triple. Who knew that all the world wasn't darwin?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140408 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemoving a bunch of dead returns/breaks after llvm_unreachables.
David Blaikie [Fri, 23 Sep 2011 20:26:49 +0000 (20:26 +0000)]
Removing a bunch of dead returns/breaks after llvm_unreachables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't propagate the 'availability' attribute through declaration
Douglas Gregor [Fri, 23 Sep 2011 20:23:42 +0000 (20:23 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140406 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a new warning to -Wliteral-conversion to catch cases where a string literal
Richard Trieu [Fri, 23 Sep 2011 20:10:00 +0000 (20:10 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140405 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up parsing the category names in interfaces slightly, using
Douglas Gregor [Fri, 23 Sep 2011 19:19:41 +0000 (19:19 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140404 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove immutable map canonization out of the removeDeadBindings loop (via using Immutab...
Anna Zaks [Fri, 23 Sep 2011 19:14:09 +0000 (19:14 +0000)]
Move immutable map canonization out of the removeDeadBindings loop (via using ImmutableMapRef). Gives ~2% speedup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140403 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen checking for weak vtables, check whether the actual definition of
Douglas Gregor [Fri, 23 Sep 2011 19:04:03 +0000 (19:04 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140400 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc-gc: Fix a corner case where clang fails to generate GC
Fariborz Jahanian [Fri, 23 Sep 2011 18:57:30 +0000 (18:57 +0000)]
objc-gc: Fix a corner case where clang fails to generate GC
write barrier with captured pointer to object. // rdar://10150823

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140399 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix up comment now that 'new' is no longer a virt-specifier, from Aaron Ballman
Douglas Gregor [Fri, 23 Sep 2011 16:58:49 +0000 (16:58 +0000)]
Fix up comment now that 'new' is no longer a virt-specifier, from Aaron Ballman

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140389 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate an MSVC comparison warning, from Aaron Ballman
Douglas Gregor [Fri, 23 Sep 2011 16:57:55 +0000 (16:57 +0000)]
Eliminate an MSVC comparison warning, from Aaron Ballman

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140388 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix wrong comment about reentering template scope for -fdelayed-template-parsing.
Francois Pichet [Fri, 23 Sep 2011 16:02:49 +0000 (16:02 +0000)]
Fix wrong comment about reentering template scope for -fdelayed-template-parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140382 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore missing header inclusions from llvm_unreachable migration.
David Blaikie [Fri, 23 Sep 2011 05:57:42 +0000 (05:57 +0000)]
More missing header inclusions from llvm_unreachable migration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140369 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix missing includes for llvm_unreachable
David Blaikie [Fri, 23 Sep 2011 05:35:21 +0000 (05:35 +0000)]
Fix missing includes for llvm_unreachable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140368 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch assert(0/false) llvm_unreachable.
David Blaikie [Fri, 23 Sep 2011 05:06:16 +0000 (05:06 +0000)]
Switch assert(0/false) llvm_unreachable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReenable -cxx-isystem for Objective C++, until I come up with a better solution
Benjamin Kramer [Fri, 23 Sep 2011 02:25:14 +0000 (02:25 +0000)]
Reenable -cxx-isystem for Objective C++, until I come up with a better solution

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140365 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agounittests/Basic/FileManagerTest.cpp: Suppress warnings on gcc.
NAKAMURA Takumi [Fri, 23 Sep 2011 01:53:05 +0000 (01:53 +0000)]
unittests/Basic/FileManagerTest.cpp: Suppress warnings on gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140364 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: Define ${LLVM_TABLEGEN_EXE} with explicit ${CMAKE_EXECUTABLE_SUFFIX} on standa...
NAKAMURA Takumi [Fri, 23 Sep 2011 00:52:55 +0000 (00:52 +0000)]
CMake: Define ${LLVM_TABLEGEN_EXE} with explicit ${CMAKE_EXECUTABLE_SUFFIX} on standalone build. Or build might fail with NMake.

Thanks to Nicolas Le Gland!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140360 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't finalize checking of base and member initializers for a
Douglas Gregor [Thu, 22 Sep 2011 23:04:35 +0000 (23:04 +0000)]
Don't finalize checking of base and member initializers for a
constructor template. Fixes PR10457.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140350 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[microsoft] Fix a bug in -fdelayed-template-parsing mode where we were not reentering...
Francois Pichet [Thu, 22 Sep 2011 22:14:56 +0000 (22:14 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140344 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't test unix path seperators, that will fail on windows.
Benjamin Kramer [Thu, 22 Sep 2011 22:14:48 +0000 (22:14 +0000)]
Don't test unix path seperators, that will fail on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140343 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSee if going through env pacifies the windows buildbots.
Benjamin Kramer [Thu, 22 Sep 2011 22:08:09 +0000 (22:08 +0000)]
See if going through env pacifies the windows buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140342 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for CPATH and friends.
Benjamin Kramer [Thu, 22 Sep 2011 21:41:16 +0000 (21:41 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140341 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo manual binary search for preprocessing entities because their end locations
Argyrios Kyrtzidis [Thu, 22 Sep 2011 21:17:02 +0000 (21:17 +0000)]
Do manual binary search for preprocessing entities because their end locations
may be unordered and MSVC's debug-mode doesn't like it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140337 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't remove filters.
Bill Wendling [Thu, 22 Sep 2011 20:32:54 +0000 (20:32 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140335 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly trigger the initialize-an-array-via-elementwise-copy/move code
Douglas Gregor [Thu, 22 Sep 2011 20:32:43 +0000 (20:32 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140334 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't use TemplateArgumentListInfo inside AST nodes because it may leak.
Argyrios Kyrtzidis [Thu, 22 Sep 2011 20:07:09 +0000 (20:07 +0000)]
Don't use TemplateArgumentListInfo inside AST nodes because it may leak.
Use ASTTemplateArgumentListInfo instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140331 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality...
Argyrios Kyrtzidis [Thu, 22 Sep 2011 20:07:03 +0000 (20:07 +0000)]
Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140330 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPlace diagnostic warn_ivar_use_hidden under the flag -Wshadow-ivar.
Ted Kremenek [Thu, 22 Sep 2011 19:24:22 +0000 (19:24 +0000)]
Place diagnostic warn_ivar_use_hidden under the flag -Wshadow-ivar.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140329 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoST->scanReachableSymbols() is creating a SubRegionMap (SRM) on every call since one...
Anna Zaks [Thu, 22 Sep 2011 18:10:41 +0000 (18:10 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140323 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPTX: Clean up target options code
Justin Holewinski [Thu, 22 Sep 2011 17:57:40 +0000 (17:57 +0000)]
PTX: Clean up target options code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140320 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix the ASTImporter's lookup for anonymous structs/unions that get a
Douglas Gregor [Thu, 22 Sep 2011 17:51:56 +0000 (17:51 +0000)]
Fix the ASTImporter's lookup for anonymous structs/unions that get a
linkage name via typedef. Patch from/fixes PR10958.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140317 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't allow template argument deduction to deduce a placeholder type,
Douglas Gregor [Thu, 22 Sep 2011 15:57:07 +0000 (15:57 +0000)]
Don't allow template argument deduction to deduce a placeholder type,
ever. Fixes PR10939.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140304 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExplicitly-defaulted copy/move constructors are not "implicit", but
Douglas Gregor [Thu, 22 Sep 2011 15:15:51 +0000 (15:15 +0000)]
Explicitly-defaulted copy/move constructors are not "implicit", but
they still need the logic to cope with array member
initialization. Fixes PR10720.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140302 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn OpenCL, conversions between different vector types are disallowed
Tobias Grosser [Thu, 22 Sep 2011 13:03:14 +0000 (13:03 +0000)]
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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140300 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoArrayRef-ifying the fields passed to Sema::ActOnFields
David Blaikie [Thu, 22 Sep 2011 02:58:26 +0000 (02:58 +0000)]
ArrayRef-ifying the fields passed to Sema::ActOnFields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140293 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoArrayRef-ifying the UnexpandedParameterPacks passed to Sema::CheckParameterPacksForEx...
David Blaikie [Thu, 22 Sep 2011 02:34:54 +0000 (02:34 +0000)]
ArrayRef-ifying the UnexpandedParameterPacks passed to Sema::CheckParameterPacksForExpansion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140290 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoArrayRef-ifying MacroArgs::create's arguments argument.
David Blaikie [Thu, 22 Sep 2011 02:03:12 +0000 (02:03 +0000)]
ArrayRef-ifying MacroArgs::create's arguments argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140288 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify the last character check.
David Blaikie [Thu, 22 Sep 2011 01:35:49 +0000 (01:35 +0000)]
Simplify the last character check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140287 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn the OpenCL mode, the AltiVec mode must be off and checks must be strict
Tobias Grosser [Wed, 21 Sep 2011 18:28:29 +0000 (18:28 +0000)]
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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140270 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoArrayRef-ifying Function/BlockDecl's setParams
David Blaikie [Wed, 21 Sep 2011 18:16:56 +0000 (18:16 +0000)]
ArrayRef-ifying Function/BlockDecl's setParams

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140268 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore MSVC9 unbreaking.
Benjamin Kramer [Wed, 21 Sep 2011 16:58:20 +0000 (16:58 +0000)]
More MSVC9 unbreaking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140256 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose attempts to write a templated data member, from Stepan
Douglas Gregor [Wed, 21 Sep 2011 14:40:46 +0000 (14:40 +0000)]
Diagnose attempts to write a templated data member, from Stepan
Dyatkovskiy! Fixes PR10896.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140250 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnforce access control for conversion operators used in contextual
John McCall [Wed, 21 Sep 2011 08:36:56 +0000 (08:36 +0000)]
Enforce access control for conversion operators used in contextual
conversions (rather than just call-arguments).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140244 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoI had meant to locally revert this test.
John McCall [Wed, 21 Sep 2011 08:34:49 +0000 (08:34 +0000)]
I had meant to locally revert this test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140243 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoANSI C requires that a call to an unprototyped function type succeed
John McCall [Wed, 21 Sep 2011 08:08:30 +0000 (08:08 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140241 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[microsoft] Move missing typename warning from -fms-extensions to -fms-compatibility...
Francois Pichet [Wed, 21 Sep 2011 07:59:49 +0000 (07:59 +0000)]
[microsoft] Move missing typename warning from -fms-extensions to -fms-compatibility. Also allow the missing typename warning at function scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140240 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix MSVC9 build by providing a full comparator object to lower_bound.
Benjamin Kramer [Wed, 21 Sep 2011 06:42:26 +0000 (06:42 +0000)]
Fix MSVC9 build by providing a full comparator object to lower_bound.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140238 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange:
Richard Trieu [Wed, 21 Sep 2011 02:50:14 +0000 (02:50 +0000)]
Change:

  assert(!"error message");

To:

  assert(0 && "error message");

which is more consistant across the code base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140232 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange "ivar" to true for a boolean function argument. Since string literals are...
Richard Trieu [Wed, 21 Sep 2011 02:46:06 +0000 (02:46 +0000)]
Change "ivar" to true for a boolean function argument.  Since string literals are cast to true, this should no effect on behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140231 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd case labels for Mips64 architectures.
Akira Hatanaka [Wed, 21 Sep 2011 02:13:07 +0000 (02:13 +0000)]
Add case labels for Mips64 architectures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140226 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix a bug where PathDiagnosticLocation did not generate a valid range...
Anna Zaks [Wed, 21 Sep 2011 00:35:58 +0000 (00:35 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140218 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[ARC] Allow forming 'id*' in an unevaluated context. Fixes rdar://10148540.
Argyrios Kyrtzidis [Tue, 20 Sep 2011 23:49:22 +0000 (23:49 +0000)]
[ARC] Allow forming 'id*' in an unevaluated context. Fixes rdar://10148540.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140212 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[PCH] Don't store the source range for each preprocessed entity since
Argyrios Kyrtzidis [Tue, 20 Sep 2011 23:27:41 +0000 (23:27 +0000)]
[PCH] Don't store the source range for each preprocessed entity since
we already have the range in the PPEntityOffsets array.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140209 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[PCH] Merge ASTReader::LoadPreprocessedEntity with ReadPreprocessedEntity
Argyrios Kyrtzidis [Tue, 20 Sep 2011 23:27:38 +0000 (23:27 +0000)]
[PCH] Merge ASTReader::LoadPreprocessedEntity with ReadPreprocessedEntity
and don't store the ID for each preprocessed entity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140208 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] When pointing at a macro expansion inside a macro argument,
Argyrios Kyrtzidis [Tue, 20 Sep 2011 23:27:33 +0000 (23:27 +0000)]
[libclang] When pointing at a macro expansion inside a macro argument,
return a cursor for the inner macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140207 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Remove SourceRange member from PathDiagno...
Anna Zaks [Tue, 20 Sep 2011 23:27:32 +0000 (23:27 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Remove SourceRange member from PathDiagnosticLocation - FullSourceLoc Loc and PathDiagnosticRange Range are sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140206 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Add comments. Remove the last constructor...
Anna Zaks [Tue, 20 Sep 2011 22:43:32 +0000 (22:43 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Add comments. Remove the last constructor which could allow invalid locations to slip in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140200 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Remove dead code. (This code is trying to implement the idea that PathDiag...
Anna Zaks [Tue, 20 Sep 2011 22:30:48 +0000 (22:30 +0000)]
[analyzer] Remove dead code. (This code is trying to implement the idea that PathDiagnosticClient could implement DiagnosticClient and has been dead for a while).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140198 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn SourceManager::translateLineCol, handle the case where we are pointing
Argyrios Kyrtzidis [Tue, 20 Sep 2011 22:14:54 +0000 (22:14 +0000)]
In SourceManager::translateLineCol, handle the case where we are pointing
directly at the end of the source file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140192 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove PreprocessingDirectiveKind since it's not necessary.
Argyrios Kyrtzidis [Tue, 20 Sep 2011 22:14:52 +0000 (22:14 +0000)]
Remove PreprocessingDirectiveKind since it's not necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140191 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe location of the name in MacroDefinition is the beginning of its range,
Argyrios Kyrtzidis [Tue, 20 Sep 2011 22:14:48 +0000 (22:14 +0000)]
The location of the name in MacroDefinition is the beginning of its range,
don't store an extra location for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140190 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove Microsoft access specifier bug emulation from -fms-extensions to -fm-compatibility.
Francois Pichet [Tue, 20 Sep 2011 22:08:26 +0000 (22:08 +0000)]
Move Microsoft access specifier bug emulation from -fms-extensions to -fm-compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140189 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFor i386 kext fallback to llvm-gcc, search paths for several Darwin versions.
Bob Wilson [Tue, 20 Sep 2011 22:00:38 +0000 (22:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140187 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Make PathDiagnosticLocation(SourceLocatio...
Anna Zaks [Tue, 20 Sep 2011 21:38:35 +0000 (21:38 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Make PathDiagnosticLocation(SourceLocation...) private. Most of the effort here goes to making BugReport refer to a PathDiagnosticLocation instead of FullSourceLocation.

(Another step closer to the goal of having Diagnostics which can recover from invalid SourceLocations.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140182 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Use the pre-computed Range and Location...
Anna Zaks [Tue, 20 Sep 2011 21:25:00 +0000 (21:25 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Use the pre-computed Range and Location for profile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140180 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] Default to arm mode when using the integrated assembler.
Chad Rosier [Tue, 20 Sep 2011 20:44:06 +0000 (20:44 +0000)]
[driver] Default to arm mode when using the integrated assembler.
rdar://10125227

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140179 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a problem in digraph handling where "[:" might be treated as "<::" and
Richard Trieu [Tue, 20 Sep 2011 20:03:50 +0000 (20:03 +0000)]
Fix a problem in digraph handling where "[:" might be treated as "<::" and
erronously trigger the digraph correction fix-it.  Include a new test to catch
this in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140175 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDefine Mips64 TargetInfo classes.
Akira Hatanaka [Tue, 20 Sep 2011 19:21:49 +0000 (19:21 +0000)]
Define Mips64 TargetInfo classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140174 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSort exports list.
Ted Kremenek [Tue, 20 Sep 2011 19:02:45 +0000 (19:02 +0000)]
Sort exports list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140171 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up TargetInfo class hierarchy. Define a base class from which TargetInfos
Akira Hatanaka [Tue, 20 Sep 2011 19:00:23 +0000 (19:00 +0000)]
Clean up TargetInfo class hierarchy. Define a base class from which TargetInfos
of Mips32 big and little endian derive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140170 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCreate a MipsTargetCodeGenInfo object for mips64/mips64el. The size of the
Akira Hatanaka [Tue, 20 Sep 2011 18:30:57 +0000 (18:30 +0000)]
Create a MipsTargetCodeGenInfo object for mips64/mips64el. The size of the
UnwindException structure is 32 for mips64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140165 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Use PointerUnion of LocationContext and...
Anna Zaks [Tue, 20 Sep 2011 18:23:52 +0000 (18:23 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Use PointerUnion of LocationContext and AnalysisContext to support creation of PathDiagnosticLocations for checkers which no context sensitivity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140162 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a parameter to MipsTargetCodeGenInfo's constructor.
Akira Hatanaka [Tue, 20 Sep 2011 18:23:28 +0000 (18:23 +0000)]
Add a parameter to MipsTargetCodeGenInfo's constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140161 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce an egregious hack for modules to cope with headers that come
Douglas Gregor [Tue, 20 Sep 2011 18:13:03 +0000 (18:13 +0000)]
Introduce an egregious hack for modules to cope with headers that come
from unfriendly (== not at all modularized) directories. This is
temporary, and it only affects module construction until I'll figured
out how to deal with system headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140159 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove __WCHAR_UNSIGNED__ and anything that used it.
Eric Christopher [Tue, 20 Sep 2011 18:05:01 +0000 (18:05 +0000)]
Remove __WCHAR_UNSIGNED__ and anything that used it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140155 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTest commit
DeLesley Hutchins [Tue, 20 Sep 2011 17:25:59 +0000 (17:25 +0000)]
Test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140149 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Lazily query LocationContext for a Parent...
Anna Zaks [Tue, 20 Sep 2011 16:37:36 +0000 (16:37 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Lazily query LocationContext for a ParentMap as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140147 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Remove LocationContext and a dependency from PathDiagnosticLoaction.
Anna Zaks [Tue, 20 Sep 2011 16:23:37 +0000 (16:23 +0000)]
[analyzer] Remove LocationContext and a dependency from PathDiagnosticLoaction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140146 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, IntPtrType,
Ivan Krasin [Tue, 20 Sep 2011 14:56:54 +0000 (14:56 +0000)]
Clarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, IntPtrType,
change __builtin_va_list to from a structure to int[4] (same alignment
and size, but with a simpler representation). Patch by David Meyer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140144 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove redundant break statements, and replace asserts with llvm_unreachable
Peter Collingbourne [Tue, 20 Sep 2011 12:40:26 +0000 (12:40 +0000)]
Remove redundant break statements, and replace asserts with llvm_unreachable

Per John's review comments for r140068.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140142 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a crash-on-invalid with bad CV-qualification on 'this' in the
John McCall [Tue, 20 Sep 2011 06:21:28 +0000 (06:21 +0000)]
Fix a crash-on-invalid with bad CV-qualification on 'this' in the
presence of an implicit move assignment operator.  I think the implicit
copy assignment operator case was also wrong, but just in a "displaying
the wrong diagnostic" way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140139 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a pretty nasty bug in noreturn destructors that cascaded into lots
Chandler Carruth [Tue, 20 Sep 2011 04:55:26 +0000 (04:55 +0000)]
Fix a pretty nasty bug in noreturn destructors that cascaded into lots
of false positive warnings that depend on noreturn destructors pruning
the CFGs, but only in C++0x mode!

This was really surprising as the debugger quickly reveals that the
attributes are parsed correctly (and using the same code) in both modes.
The warning fires in the same way in both modes. But between parsing and
building the destructor declaration with the noreturn attribute and the
warning, it magically disappears. The key? The 'noexcept' appears!

When we were rebuilding the destructor type with the computed implicit
noexcept we completely dropped the old type on the floor. This almost
makes sense (as the arguments and return type to a destructor aren't
exactly unpredictable), but lost any function type attributes as well.
The fix is simple, we build the new type off of the old one rather than
starting fresh.

Testing this is a bit awkward. I've done it by running the
noreturn-sensitive tests in both modes, which previous failed and now
passes, but if anyone has ideas about how to more specifically and
thoroughly test that the extended info on a destructor is preserved when
adding noexcept, I'm all ears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140138 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactor PathDiagnosticLocation: Pre-compute Range and Location with gen...
Anna Zaks [Tue, 20 Sep 2011 01:51:40 +0000 (01:51 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Pre-compute Range and Location with gen methods on object creation instead of computing on demand. This would allow to remove dependency on the other members which help with construction and might not even be valid at later stages (to be removed later on).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140131 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Use more create methods in the PathDiagnostic, cleanup.
Anna Zaks [Tue, 20 Sep 2011 01:38:47 +0000 (01:38 +0000)]
[analyzer] Use more create methods in the PathDiagnostic, cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140130 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't assume that the clause is a GlobalVariable. It could be a constant.
Bill Wendling [Tue, 20 Sep 2011 00:40:19 +0000 (00:40 +0000)]
Don't assume that the clause is a GlobalVariable. It could be a constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140123 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] BugReport has a profile method, so reuse it here.
Anna Zaks [Mon, 19 Sep 2011 23:44:31 +0000 (23:44 +0000)]
[analyzer] BugReport has a profile method, so reuse it here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140100 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Add a convinience method.
Anna Zaks [Mon, 19 Sep 2011 23:18:44 +0000 (23:18 +0000)]
[analyzer] Add a convinience method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140092 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Constify a method.
Anna Zaks [Mon, 19 Sep 2011 23:17:48 +0000 (23:17 +0000)]
[analyzer] Constify a method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140091 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd list initialization for complex numbers in C. Essentially, this allows "_Complex...
Eli Friedman [Mon, 19 Sep 2011 23:17:44 +0000 (23:17 +0000)]
Add list initialization for complex numbers in C.  Essentially, this allows "_Complex float x = {1.0f, 2.0f};".  See changes to docs/LanguageExtensions.html for a longer description.

<rdar://problem/9397672>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140090 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe eh.selector intrinsic isn't used anymore. Replace the check here with a
Bill Wendling [Mon, 19 Sep 2011 22:08:36 +0000 (22:08 +0000)]
The eh.selector intrinsic isn't used anymore. Replace the check here with a
check for the landingpad instruction instead. This check looks at each of the
clauses in the landingpad instruction. If it's a catch clause, it compares the
name directly with the global. If it's a filter clause, it has to look through
each value in the filer to see if any have the prefix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140075 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix gcc build.
Argyrios Kyrtzidis [Mon, 19 Sep 2011 22:02:08 +0000 (22:02 +0000)]
Fix gcc build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140073 91177308-0d34-0410-b5e6-96231b3b80d8