]> granicus.if.org Git - clang/log
clang
12 years agoConvert SemaExprMember.cpp to pass a callback object to CorrectTypo,
Kaelyn Uhrain [Fri, 13 Jan 2012 21:28:55 +0000 (21:28 +0000)]
Convert SemaExprMember.cpp to pass a callback object to CorrectTypo,
improving the typo correction results in certain situations.

This is also the first typo correction callback conversion to affect
an existing unit test. :)

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

12 years agoremove assertions in the Hexagon backend specific clang driver
Sebastian Pop [Fri, 13 Jan 2012 20:37:10 +0000 (20:37 +0000)]
remove assertions in the Hexagon backend specific clang driver

Patch from Jyotsna Verma:

I have made the changes to remove assertions in the Hexagon backend
specific clang driver. Instead of asserting on invalid arch name, it has
been modified to use the default value.

I have changed the implementation of the CPU flag validation for the
Hexagon backend. Earlier, the clang driver performed the check and
asserted on invalid inputs. In the new implementation, the driver passes
the last CPU flag (or sets to "v4" if not specified) to the compiler (and
also to the assembler and linker which perform their own check) instead of
asserting on incorrect values. This patch changes the setCPU function for
the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the
compiler to error out on incorrect CPU flag values.

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

12 years agorename -ccc-host-triple into -target
Sebastian Pop [Fri, 13 Jan 2012 20:37:02 +0000 (20:37 +0000)]
rename -ccc-host-triple into -target

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

12 years agorename DefaultHostTriple into DefaultTargetTriple
Sebastian Pop [Fri, 13 Jan 2012 20:36:46 +0000 (20:36 +0000)]
rename DefaultHostTriple into DefaultTargetTriple

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

12 years agoRefactor for clarity.
Richard Smith [Fri, 13 Jan 2012 19:34:55 +0000 (19:34 +0000)]
Refactor for clarity.

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

12 years agoReinstate test case accidentally reverted by r148028
Douglas Gregor [Fri, 13 Jan 2012 16:56:26 +0000 (16:56 +0000)]
Reinstate test case accidentally reverted by r148028

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

12 years agoDon't infer a submodule for a framework's private header, at least for now.
Douglas Gregor [Fri, 13 Jan 2012 16:54:27 +0000 (16:54 +0000)]
Don't infer a submodule for a framework's private header, at least for now.

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

12 years agoRemove --hash-style from link command on Android.
Evgeniy Stepanov [Fri, 13 Jan 2012 09:30:38 +0000 (09:30 +0000)]
Remove --hash-style from link command on Android.

Gnu hash is not supported by the Android loader.

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

12 years agoCodeInit was replaced by StringInit.
Jakob Stoklund Olesen [Fri, 13 Jan 2012 04:57:47 +0000 (04:57 +0000)]
CodeInit was replaced by StringInit.

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

12 years agoPR11754: Reject non-static constexpr member functions in classes with virtual
Richard Smith [Fri, 13 Jan 2012 04:54:00 +0000 (04:54 +0000)]
PR11754: Reject non-static constexpr member functions in classes with virtual
base classes.

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

12 years agoA base subobject type doesn't make sense for unions; don't try to compute it. Based...
Eli Friedman [Fri, 13 Jan 2012 03:58:31 +0000 (03:58 +0000)]
A base subobject type doesn't make sense for unions; don't try to compute it.  Based on patch by Yin Ma.  Fixes PR11751.

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

12 years agoconstexpr is allowed on static member functions of non-literal classes. Per report...
Eli Friedman [Fri, 13 Jan 2012 02:31:53 +0000 (02:31 +0000)]
constexpr is allowed on static member functions of non-literal classes.  Per report on cfe-dev.

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

12 years agoA few minor improvements to error recovery trying to access member of a function...
Eli Friedman [Fri, 13 Jan 2012 02:20:01 +0000 (02:20 +0000)]
A few minor improvements to error recovery trying to access member of a function.  In particular, this restores the cool error recovery for the example from http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html , which regressed a few months back.

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

12 years agoDon't crash while trying to diagnose a function declared at block scope with an
Richard Smith [Fri, 13 Jan 2012 02:14:39 +0000 (02:14 +0000)]
Don't crash while trying to diagnose a function declared at block scope with an
incomplete return type.

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

12 years agoFix up the calls to CorrectTypo in Sema*ObjC.cpp to use callback
Kaelyn Uhrain [Fri, 13 Jan 2012 01:32:50 +0000 (01:32 +0000)]
Fix up the calls to CorrectTypo in Sema*ObjC.cpp to use callback
objects, and add a basic CorrectionCandidateCallback template class
to simplify the fixups.

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

12 years agoRevert previous commit. Something has gone wonky with my local configuration
Douglas Gregor [Fri, 13 Jan 2012 01:24:11 +0000 (01:24 +0000)]
Revert previous commit. Something has gone wonky with my local configuration

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

12 years agoWhen inferring a module map for a framework, add the 'private'
Douglas Gregor [Fri, 13 Jan 2012 01:20:43 +0000 (01:20 +0000)]
When inferring a module map for a framework, add the 'private'
requirement to headers under PrivateHeaders. We don't want to build
them as part of the module (yet).

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

12 years ago[analyzer] Unwrap the pointers when ignoring the const cast.
Anna Zaks [Fri, 13 Jan 2012 00:56:55 +0000 (00:56 +0000)]
[analyzer] Unwrap the pointers when ignoring the const cast.

radar://10686991

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

12 years ago[analyzer] Taint: when looking up a binding, provide the type.
Anna Zaks [Fri, 13 Jan 2012 00:56:51 +0000 (00:56 +0000)]
[analyzer] Taint: when looking up a binding, provide the type.

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

12 years ago[analyzer] RegionStoreManager::getBinding() should not crash when
Anna Zaks [Fri, 13 Jan 2012 00:56:48 +0000 (00:56 +0000)]
[analyzer] RegionStoreManager::getBinding() should not crash when
looking up value at a CodeTextRegion even when the type is not provided.

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

12 years ago[analyzer] Fix a typo in a warning message.
Anna Zaks [Fri, 13 Jan 2012 00:56:44 +0000 (00:56 +0000)]
[analyzer] Fix a typo in a warning message.

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

12 years agoobjc parsing. Fixes a crash when parsing array initialization
Fariborz Jahanian [Fri, 13 Jan 2012 00:14:12 +0000 (00:14 +0000)]
objc parsing. Fixes a crash when parsing array initialization
inside a class implementation with parse errors. // rdar://10633434

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

12 years agoImprove 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:
Richard Smith [Thu, 12 Jan 2012 23:53:29 +0000 (23:53 +0000)]
Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:

 - If the declarator is at the start of a line, and the previous line contained
   another declarator and ended with a comma, then that comma was probably a
   typo for a semicolon:

   int n = 0, m = 1, l = 2, // k = 5;
   myImportantFunctionCall(); // oops!

 - If removing the parentheses would correctly initialize the object, then
   produce a note suggesting that fix.

 - Otherwise, if there is a simple initializer we can suggest which performs
   value-initialization, then provide a note suggesting a correction to that
   initializer.

Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.

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

12 years agoRecommit r148056 with fixes to deal with weirdness with bitfields in unions.
Eli Friedman [Thu, 12 Jan 2012 23:48:56 +0000 (23:48 +0000)]
Recommit r148056 with fixes to deal with weirdness with bitfields in unions.

Original message: Make sure adding a field to a struct never reduces its size.  PR11745.

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

12 years agoRevert r148056 while I investigate failures.
Eli Friedman [Thu, 12 Jan 2012 23:27:03 +0000 (23:27 +0000)]
Revert r148056 while I investigate failures.

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

12 years agoRevert accidental commit.
Eli Friedman [Thu, 12 Jan 2012 22:43:19 +0000 (22:43 +0000)]
Revert accidental commit.

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

12 years agoMake sure adding a field to a struct never reduces its size. PR11745.
Eli Friedman [Thu, 12 Jan 2012 22:41:25 +0000 (22:41 +0000)]
Make sure adding a field to a struct never reduces its size.  PR11745.

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

12 years agoAdjust set of default checkers.
Ted Kremenek [Thu, 12 Jan 2012 22:41:10 +0000 (22:41 +0000)]
Adjust set of default checkers.

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

12 years agoIf an ObjCMessageExpr is implicit, there are no source locations for the
Argyrios Kyrtzidis [Thu, 12 Jan 2012 22:34:19 +0000 (22:34 +0000)]
If an ObjCMessageExpr is implicit, there are no source locations for the
selector identifiers.

It was difficult to form a test case for it unfortunately.

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

12 years agoConvert SemaCXXScopeSpec.cpp to pass a callback object to CorrectTypo,
Kaelyn Uhrain [Thu, 12 Jan 2012 22:32:39 +0000 (22:32 +0000)]
Convert SemaCXXScopeSpec.cpp to pass a callback object to CorrectTypo,
improvng the typo correction results in certain situations.

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

12 years agoobjc: do not warn when converting to a const id qualfied by its
Fariborz Jahanian [Thu, 12 Jan 2012 22:12:08 +0000 (22:12 +0000)]
objc: do not warn when converting to a const id qualfied by its
list of protools. // rdar://10669694

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

12 years agoRevert 148045 to fix the bots.
Rafael Espindola [Thu, 12 Jan 2012 21:17:34 +0000 (21:17 +0000)]
Revert 148045 to fix the bots.

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

12 years agoAdd a SONAME to the libclang library.
Rafael Espindola [Thu, 12 Jan 2012 21:04:54 +0000 (21:04 +0000)]
Add a SONAME to the libclang library.
Patch by Sylvestre Ledru.

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

12 years agoConvert SemaInit.cpp to pass a callback object to CorrectTypo.
Kaelyn Uhrain [Thu, 12 Jan 2012 19:27:05 +0000 (19:27 +0000)]
Convert SemaInit.cpp to pass a callback object to CorrectTypo.

And once again improve the typo correction results in certain
situations just by moving the existing checks on the correction.

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

12 years ago[analyzer] fix inlining's handling of mapping actual to formal arguments and limit...
Ted Kremenek [Thu, 12 Jan 2012 19:25:46 +0000 (19:25 +0000)]
[analyzer] fix inlining's handling of mapping actual to formal arguments and limit the call stack depth.  The analyzer can now accurately simulate factorial for limited depths.

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

12 years agoconstexpr: initialization of a union from an empty initializer-list should
Richard Smith [Thu, 12 Jan 2012 18:54:33 +0000 (18:54 +0000)]
constexpr: initialization of a union from an empty initializer-list should
zero-initialize the first union member. Also fix a bug where initializing an
array of types compatible with wchar_t from a wide string literal failed in C,
and fortify the C++ tests in this area. This part can't be tested without a code
change to enable array evaluation in C (where an existing test fails).

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

12 years agoscanf: parse the 'm' length modifier, and check that the right arguments
Hans Wennborg [Thu, 12 Jan 2012 17:11:12 +0000 (17:11 +0000)]
scanf: parse the 'm' length modifier, and check that the right arguments
are used with that and the 'a' length modifier.

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

12 years agoIn Objective-C++, actually compute the base type of a member access
Douglas Gregor [Thu, 12 Jan 2012 16:11:24 +0000 (16:11 +0000)]
In Objective-C++, actually compute the base type of a member access
expression for an Objective-C object or pointer type, so that we don't
attempt to treat the member name as a template. Fixes
<rdar://problem/10672501>.

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

12 years agoscanf analysis: the 'a' length modifier is valid with a scanlist
Hans Wennborg [Thu, 12 Jan 2012 15:07:16 +0000 (15:07 +0000)]
scanf analysis: the 'a' length modifier is valid with a scanlist

Before r148025 we (accidentally) didn't check whether a length modifier is
appropriate for a scanlist, but now we do.

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

12 years agoscanf analysis: don't bail out after successful parse of scanlist
Hans Wennborg [Thu, 12 Jan 2012 14:44:54 +0000 (14:44 +0000)]
scanf analysis: don't bail out after successful parse of scanlist

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

12 years agotest/Driver/debug-options*.c: Tweak r147819 to split out another cc1as-sensitive...
NAKAMURA Takumi [Thu, 12 Jan 2012 06:15:01 +0000 (06:15 +0000)]
test/Driver/debug-options*.c: Tweak r147819 to split out another cc1as-sensitive test. gcc driver is invoked for assembling on cygming.

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

12 years agoRevert accidentally-committed file in r148020.
Richard Smith [Thu, 12 Jan 2012 06:10:09 +0000 (06:10 +0000)]
Revert accidentally-committed file in r148020.

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

12 years agoAllow constant-folding of references which were formed in a manner not permitted
Richard Smith [Thu, 12 Jan 2012 06:08:57 +0000 (06:08 +0000)]
Allow constant-folding of references which were formed in a manner not permitted
in a constant expression, for compatibility with g++.

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

12 years agoAdd IsImplicit field in ObjCMessageExpr that is true when the message
Argyrios Kyrtzidis [Thu, 12 Jan 2012 02:34:39 +0000 (02:34 +0000)]
Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.

This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.

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

12 years ago[arcmt] The migrator tests for the buildbot in http://lab.llvm.org:8011/builders...
Argyrios Kyrtzidis [Thu, 12 Jan 2012 02:34:32 +0000 (02:34 +0000)]
[arcmt] The migrator tests for the buildbot in http://lab.llvm.org:8011/builders/clang-native-mingw32-win7/
are messed up, XFAIL does not help. Waiting until DISABLE is supported..

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

12 years ago[analyzer] Rename Store::Retrieve() -> getBinding().
Anna Zaks [Thu, 12 Jan 2012 02:22:40 +0000 (02:22 +0000)]
[analyzer] Rename Store::Retrieve() -> getBinding().

+ all the other Retrieve..() methods + a comment for ElementRegion.

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

12 years ago[analyzer] Add taint transfer by strcpy & others (part 1).
Anna Zaks [Thu, 12 Jan 2012 02:22:34 +0000 (02:22 +0000)]
[analyzer] Add taint transfer by strcpy & others (part 1).

To simplify the process:
Refactor taint generation checker to simplify passing the
information on which arguments need to be tainted from pre to post
visit.

Todo: We need to factor out the code that sema is using to identify the
string and memcpy functions and use it here and in the CString checker.

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

12 years agoFix test case committed in r147986.
Akira Hatanaka [Thu, 12 Jan 2012 01:27:24 +0000 (01:27 +0000)]
Fix test case committed in r147986.

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

12 years agoFormatting.
Eric Christopher [Thu, 12 Jan 2012 01:26:58 +0000 (01:26 +0000)]
Formatting.

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

12 years agoFormatting.
Eric Christopher [Thu, 12 Jan 2012 01:26:51 +0000 (01:26 +0000)]
Formatting.

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

12 years agoTake into account the pointer to an aggregate that is passed as a hidden
Akira Hatanaka [Thu, 12 Jan 2012 01:10:09 +0000 (01:10 +0000)]
Take into account the pointer to an aggregate that is passed as a hidden
argument when Offset is initialized.

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

12 years agoCall CodeGenTypes::ConvertType to get LLVM::Type*.
Akira Hatanaka [Thu, 12 Jan 2012 00:52:17 +0000 (00:52 +0000)]
Call CodeGenTypes::ConvertType to get LLVM::Type*.
Remove function MipsABIInfo::GetFloatingPointTy.

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

12 years agoFix some edge cases with C++ casts and placeholder expressions.
Eli Friedman [Thu, 12 Jan 2012 00:44:34 +0000 (00:44 +0000)]
Fix some edge cases with C++ casts and placeholder expressions.

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

12 years agoobjective-c: fixes a regression in looking up names
Fariborz Jahanian [Thu, 12 Jan 2012 00:18:35 +0000 (00:18 +0000)]
objective-c: fixes a regression in looking up names
in class extensions and categories by recent refactoring
of objc class ASTs. // rdar://1066654

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

12 years agoAppease -Wnon-virtual-dtor
Matt Beaumont-Gay [Wed, 11 Jan 2012 22:53:23 +0000 (22:53 +0000)]
Appease -Wnon-virtual-dtor

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

12 years agoExtend test-case as requested by Eli
Douglas Gregor [Wed, 11 Jan 2012 22:43:46 +0000 (22:43 +0000)]
Extend test-case as requested by Eli

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

12 years agoImprove the diagnostic when trying to redefine a typedef with a
Douglas Gregor [Wed, 11 Jan 2012 22:33:48 +0000 (22:33 +0000)]
Improve the diagnostic when trying to redefine a typedef with a
variably-modified type.

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

12 years agoFix the caching in CorrectTypo so that other non-keyword identifiers
Kaelyn Uhrain [Wed, 11 Jan 2012 21:17:51 +0000 (21:17 +0000)]
Fix the caching in CorrectTypo so that other non-keyword identifiers
are still added if the cached correction fails validation.

Also fix a copy-and-paste error in a comment from my previous commit.
Finally, add an example of the benefit the typo correction callback adds
to TryNamespaceTypoCorrection--which happens to also tickle the above
caching problem, as the only way a non-namespace Decl would be added to
the possible corrections is if it was cached as the correction for a
previous instance of the same typo where the typo was corrected to a
non-namespace via a different code path.

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

12 years agominor refactoring to improve compile-time performance.
Fariborz Jahanian [Wed, 11 Jan 2012 19:48:08 +0000 (19:48 +0000)]
minor refactoring to improve compile-time performance.

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

12 years agoAdd initial callback object support to Sema::CorrectTypo.
Kaelyn Uhrain [Wed, 11 Jan 2012 19:37:46 +0000 (19:37 +0000)]
Add initial callback object support to Sema::CorrectTypo.

Also includes two examples of the callback: a wrapper/replacement for
the CorrectTypoContext enum, and a conversion of the two calls to
CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable
improvement to the typo correction, as demonstrated in the added test).

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

12 years agoobjc-arc: evaluate 'readonly' property with no known
Fariborz Jahanian [Wed, 11 Jan 2012 18:26:06 +0000 (18:26 +0000)]
objc-arc: evaluate 'readonly' property with no known
life-time to that of its backing 'ivar's lifetime.
// rdar://10558871

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

12 years agoconstexpr: fix typo resulting in move constructors sometimes not being
Richard Smith [Wed, 11 Jan 2012 18:26:05 +0000 (18:26 +0000)]
constexpr: fix typo resulting in move constructors sometimes not being
implicitly marked constexpr when they should be.

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

12 years agoMore tests for ARM FPU features.
Evgeniy Stepanov [Wed, 11 Jan 2012 12:36:39 +0000 (12:36 +0000)]
More tests for ARM FPU features.

Also remove the svn:eol-style property from the test file.

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

12 years agoFix -mfpu parsing on ARM.
Evgeniy Stepanov [Wed, 11 Jan 2012 11:21:31 +0000 (11:21 +0000)]
Fix -mfpu parsing on ARM.

- Support gcc-compatible vfpv3 name in addition to vfp3.
- Support vfpv3-d16.
- Disable neon feature for -mfpu=vfp* (yes, we were emitting Neon instructions
  for those!).

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

12 years agoclang/test/CodeGen/vla-4.c: Relax expression for -Asserts.
NAKAMURA Takumi [Wed, 11 Jan 2012 08:34:52 +0000 (08:34 +0000)]
clang/test/CodeGen/vla-4.c: Relax expression for -Asserts.

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

12 years agoFixed VLA code generation.
Abramo Bagnara [Wed, 11 Jan 2012 08:19:46 +0000 (08:19 +0000)]
Fixed VLA code generation.

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

12 years ago"This change adds alloca/valloc checks to UnixAPIChecker. It includes a small refacto...
Ted Kremenek [Wed, 11 Jan 2012 08:13:21 +0000 (08:13 +0000)]
"This change adds alloca/valloc checks to UnixAPIChecker. It includes a small refactoring for
the common *alloc functions as well as a few tiny wibbles (adds a note
to CWE/CERT advisory numbers in the bug output, and fixes a couple
80-column-wide violations.)"

Patch by Austin Seipp!

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

12 years agotest/Driver/debug-options-as.c: Mark this as XFAIL:cygwin.
NAKAMURA Takumi [Wed, 11 Jan 2012 07:50:51 +0000 (07:50 +0000)]
test/Driver/debug-options-as.c: Mark this as XFAIL:cygwin.

Also cygwin has not supported integrated-as yet.

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

12 years agoC11 allows typedefs to be redefined. Implement this in C11 mode, and
Douglas Gregor [Wed, 11 Jan 2012 04:25:01 +0000 (04:25 +0000)]
C11 allows typedefs to be redefined. Implement this in C11 mode, and
downgrade the default-error warning to an ExtWarn in
C90/99. <rdar://problem/10668057>

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

12 years agoRevert changes to lib/Driver in r147917; I didn't mean to commit this.
Eli Friedman [Wed, 11 Jan 2012 02:41:15 +0000 (02:41 +0000)]
Revert changes to lib/Driver in r147917; I didn't mean to commit this.

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

12 years agoAdd elidable CXXConstructExpr as block-level expr. It converts an lvalue to a rvalue...
Zhongxing Xu [Wed, 11 Jan 2012 02:39:07 +0000 (02:39 +0000)]
Add elidable CXXConstructExpr as block-level expr. It converts an lvalue to a rvalue, which is a useful step during AST evaluation.

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

12 years agoStart refactoring code for capturing variables and 'this' so that it is shared betwee...
Eli Friedman [Wed, 11 Jan 2012 02:36:31 +0000 (02:36 +0000)]
Start refactoring code for capturing variables and 'this' so that it is shared between lambda expressions and block literals.

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

12 years agoTypo in test.
John McCall [Wed, 11 Jan 2012 01:35:55 +0000 (01:35 +0000)]
Typo in test.

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

12 years agoRemove '#if 0' from ExprEngine::InlineCall(), and start fresh by wiring up inlining...
Ted Kremenek [Wed, 11 Jan 2012 01:06:27 +0000 (01:06 +0000)]
Remove '#if 0' from ExprEngine::InlineCall(), and start fresh by wiring up inlining for straight C calls.
My hope is to reimplement this from first principles based on the simplifications of removing unneeded node builders
and re-evaluating how C++ calls are handled in the CFG.  The hope is to turn inlining "on-by-default" as soon as possible
with a core set of things working well, and then expand over time.

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

12 years agoDo placeholder conversions on array bounds in both declarators and
John McCall [Wed, 11 Jan 2012 00:14:46 +0000 (00:14 +0000)]
Do placeholder conversions on array bounds in both declarators and
new-expressions.

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

12 years agoRemove switch/case statements and call GetFloatingPointTy() instead to get the
Akira Hatanaka [Tue, 10 Jan 2012 23:30:49 +0000 (23:30 +0000)]
Remove switch/case statements and call GetFloatingPointTy() instead to get the
floating point type.

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

12 years agoFlatten float complex arguments. N32/64 requires float complex arguments be
Akira Hatanaka [Tue, 10 Jan 2012 23:12:19 +0000 (23:12 +0000)]
Flatten float complex arguments. N32/64 requires float complex arguments be
passed in floating point registers.

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

12 years agoRemove space.
Akira Hatanaka [Tue, 10 Jan 2012 22:44:52 +0000 (22:44 +0000)]
Remove space.

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

12 years agoAdd field IsIEEE in FloatingLiteral to distinguish between different 128-bit
Akira Hatanaka [Tue, 10 Jan 2012 22:40:09 +0000 (22:40 +0000)]
Add field IsIEEE in FloatingLiteral to distinguish between different 128-bit
floating point formats.

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

12 years agoWhen something goes wrong in type-checking a namespace definition, make the namespace...
Douglas Gregor [Tue, 10 Jan 2012 22:14:10 +0000 (22:14 +0000)]
When something goes wrong in type-checking a namespace definition, make the namespace declaration invalid

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

12 years agoAdd support for the androideabi environment to our triple support, and
Chandler Carruth [Tue, 10 Jan 2012 19:47:42 +0000 (19:47 +0000)]
Add support for the androideabi environment to our triple support, and
for the arm-linux-androideabi triple in particular.

Also use this to do a better job of selecting soft FP settings.

Patch by Evgeniy Stepanov.

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

12 years agoobjc-arc: fixes a crash when trying to find out retaining cycle
Fariborz Jahanian [Tue, 10 Jan 2012 19:28:26 +0000 (19:28 +0000)]
objc-arc: fixes a crash when trying to find out retaining cycle
ownership of property sent to 'super'. // rdar://10640891

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

12 years agoRemove a set, but unused variable. Found with GCC's warning.
Chandler Carruth [Tue, 10 Jan 2012 18:26:14 +0000 (18:26 +0000)]
Remove a set, but unused variable. Found with GCC's warning.

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

12 years ago[analyzer] Testing infrastructure: Flush output after every print
Anna Zaks [Tue, 10 Jan 2012 18:10:25 +0000 (18:10 +0000)]
[analyzer] Testing infrastructure: Flush output after every print
statement.

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

12 years agoContrary to the other BSDs, NetBSD followed the ELF ABI for structure
Joerg Sonnenberger [Tue, 10 Jan 2012 16:53:17 +0000 (16:53 +0000)]
Contrary to the other BSDs, NetBSD followed the ELF ABI for structure
passing on i386 and does not use registers.

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

12 years agoMake PathDiagnosticLocation more resilient to null Stmt pointers.
Ted Kremenek [Tue, 10 Jan 2012 15:26:13 +0000 (15:26 +0000)]
Make PathDiagnosticLocation more resilient to null Stmt pointers.

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

12 years agoAdd definitions for AMD's bobcat (aka btver1)
Benjamin Kramer [Tue, 10 Jan 2012 11:50:18 +0000 (11:50 +0000)]
Add definitions for AMD's bobcat (aka btver1)

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

12 years agoEnable POPCNT and LZCNT with sse4a.
Benjamin Kramer [Tue, 10 Jan 2012 11:50:13 +0000 (11:50 +0000)]
Enable POPCNT and LZCNT with sse4a.

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

12 years agoFactor the repetitive cpu macro definition into a helper function.
Benjamin Kramer [Tue, 10 Jan 2012 11:50:09 +0000 (11:50 +0000)]
Factor the repetitive cpu macro definition into a helper function.

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

12 years agoThe `-fwritable-strings' flag doesn't make the backing store strings of all
Bill Wendling [Tue, 10 Jan 2012 08:46:39 +0000 (08:46 +0000)]
The `-fwritable-strings' flag doesn't make the backing store strings of all
CFStrings writable.

The strings (both Unicode and ASCII) should reside in a read-only section. E.g.,
__TEXT,__cstring instead of __DATA,__data. This is done by making the global
variable created for the strings constant despite the value of that flag.
<rdar://problem/10657500>

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

12 years agoImplement the missing pieces of Evaluate for _Complex types. With that complete...
Eli Friedman [Tue, 10 Jan 2012 04:58:17 +0000 (04:58 +0000)]
Implement the missing pieces of Evaluate for _Complex types.  With that complete, remove some code from CGExprConstant which is no longer necessary.  While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)

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

12 years agoPR11724: Implement evaluation for constexpr defaulted trivial union copy/move
Richard Smith [Tue, 10 Jan 2012 04:32:03 +0000 (04:32 +0000)]
PR11724: Implement evaluation for constexpr defaulted trivial union copy/move
constructors. These are a special case whose behavior cannot be modeled as a
user-written constructor.

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

12 years agoPer John's comment, it makes sense to ask isLambda on any CXXRecordDecl; make sure...
Eli Friedman [Tue, 10 Jan 2012 03:38:46 +0000 (03:38 +0000)]
Per John's comment, it makes sense to ask isLambda on any CXXRecordDecl; make sure that's safe.  Get rid of a check which is now unnecessary in Sema::getFunctionLevelDeclContext().

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

12 years ago[arcmt] XFAIL on mingw.
Argyrios Kyrtzidis [Tue, 10 Jan 2012 02:39:29 +0000 (02:39 +0000)]
[arcmt] XFAIL on mingw.

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

12 years agoUpdate C++11 scoped enumeration support to match the final proposal:
Richard Smith [Tue, 10 Jan 2012 01:33:14 +0000 (01:33 +0000)]
Update C++11 scoped enumeration support to match the final proposal:
 - reject definitions of enums within friend declarations
 - require 'enum', not 'enum class', for non-declaring references to scoped
   enumerations

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

12 years agoAdd -g to the cc1as flags only if we're dealing with an original
Eric Christopher [Tue, 10 Jan 2012 00:38:01 +0000 (00:38 +0000)]
Add -g to the cc1as flags only if we're dealing with an original
source file. Otherwise -g -save-temps will error out on the compile
of any .c file.

Fixes about 4000 of the errors in the clang-tests gdb test suite.

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

12 years agoRemove extraneous braces.
Eric Christopher [Tue, 10 Jan 2012 00:37:56 +0000 (00:37 +0000)]
Remove extraneous braces.

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

12 years agoobjc++: patch for IRgen for atomic properties of
Fariborz Jahanian [Tue, 10 Jan 2012 00:37:01 +0000 (00:37 +0000)]
objc++: patch for IRgen for atomic properties of
c++ objects with non-trivial assignment/copy functions.
Also, one additional sema check. // rdar://6137845

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

12 years agoDon't crash with -Wlarge-by-value-copy and a dependent type. PR11726.
Eli Friedman [Mon, 9 Jan 2012 23:46:59 +0000 (23:46 +0000)]
Don't crash with -Wlarge-by-value-copy and a dependent type.  PR11726.

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

12 years agoExtend the diagnostic for a ',' at the end of a declaration where a ';' was
Richard Smith [Mon, 9 Jan 2012 22:31:44 +0000 (22:31 +0000)]
Extend the diagnostic for a ',' at the end of a declaration where a ';' was
intended to cover C++ class definitions.

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