]> granicus.if.org Git - clang/log
clang
12 years agoFix -fmacro-backtrace-limit=0 to show the entire macro backtrace.
Ted Kremenek [Wed, 25 Jan 2012 06:07:15 +0000 (06:07 +0000)]
Fix -fmacro-backtrace-limit=0 to show the entire macro backtrace.

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

12 years agodisable this test for now.
Chris Lattner [Wed, 25 Jan 2012 05:38:06 +0000 (05:38 +0000)]
disable this test for now.

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

12 years agoreapply r148902:
Chris Lattner [Wed, 25 Jan 2012 05:34:41 +0000 (05:34 +0000)]
reapply r148902:

"use the new ConstantVector::getSplat method where it makes sense."

Also simplify a bunch of code to use the Builder->getInt32 instead
of doing it the hard and ugly way.  Much more progress could be made
here, but I don't plan to do it.

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

12 years agofix broken testcase.
Chris Lattner [Wed, 25 Jan 2012 05:29:46 +0000 (05:29 +0000)]
fix broken testcase.

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

12 years agoFix a crash for an edge case of the GNU ?: extension.
Eli Friedman [Wed, 25 Jan 2012 05:04:17 +0000 (05:04 +0000)]
Fix a crash for an edge case of the GNU ?: extension.

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

12 years agoFix r148920 to what I actually meant to commit.
Eli Friedman [Wed, 25 Jan 2012 04:35:06 +0000 (04:35 +0000)]
Fix r148920 to what I actually meant to commit.

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

12 years agoAdd missing check for placeholders.
Eli Friedman [Wed, 25 Jan 2012 04:29:24 +0000 (04:29 +0000)]
Add missing check for placeholders.

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

12 years agoRepresent 256-bit unaligned loads natively and remove the builtins. Similar change...
Craig Topper [Wed, 25 Jan 2012 04:26:17 +0000 (04:26 +0000)]
Represent 256-bit unaligned loads natively and remove the builtins. Similar change was made for 128-bit versions a while back.

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

12 years agoIn TreeTransform<Derived>::TransformBlockExpr, call ActOnBlockError for errors,
Argyrios Kyrtzidis [Wed, 25 Jan 2012 03:53:04 +0000 (03:53 +0000)]
In TreeTransform<Derived>::TransformBlockExpr, call ActOnBlockError for errors,
patch by Dmitri Gribenko.

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

12 years agoRevert 148902 which was part of 148901 which was reverted in r148906.
Argyrios Kyrtzidis [Wed, 25 Jan 2012 02:58:12 +0000 (02:58 +0000)]
Revert 148902 which was part of 148901 which was reverted in r148906.

Original log:
 use the new ConstantVector::getSplat method where it makes sense.

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

12 years agoFix PR11848: decree that an alias template contains an unexpanded parameter pack
Richard Smith [Wed, 25 Jan 2012 02:14:59 +0000 (02:14 +0000)]
Fix PR11848: decree that an alias template contains an unexpanded parameter pack
iff its substitution contains an unexpanded parameter pack. This has the effect
that we now reject declarations such as this (which we used to crash when
expanding):

  template<typename T> using Int = int;
  template<typename ...Ts> void f(Int<Ts> ...ints);

The standard is inconsistent on how this case should be treated.

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

12 years agoRefactor the record decl forward declaration code a bit.
Eric Christopher [Wed, 25 Jan 2012 02:06:59 +0000 (02:06 +0000)]
Refactor the record decl forward declaration code a bit.

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

12 years agoTypo.
Eric Christopher [Wed, 25 Jan 2012 02:06:52 +0000 (02:06 +0000)]
Typo.

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

12 years agouse the new ConstantVector::getSplat method where it makes sense.
Chris Lattner [Wed, 25 Jan 2012 02:06:10 +0000 (02:06 +0000)]
use the new ConstantVector::getSplat method where it makes sense.

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

12 years agoWith a little more work in the tentative parse determining whether a statement
Nick Lewycky [Wed, 25 Jan 2012 01:19:14 +0000 (01:19 +0000)]
With a little more work in the tentative parse determining whether a statement
is a declaration-stmt or an expression, we can discern a subset of cases where
the user erred in omitting the typename keyword before a dependent type name.
Fixes PR11358!

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

12 years agoIntroduce a generation number for selector lookups in the global
Douglas Gregor [Wed, 25 Jan 2012 01:14:32 +0000 (01:14 +0000)]
Introduce a generation number for selector lookups in the global
method pool, so that we don't perform the same lookups into the same
PCH/module file repeatedly.

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

12 years agoOnly try to import a definition if there is an definition to import.
Douglas Gregor [Wed, 25 Jan 2012 01:13:20 +0000 (01:13 +0000)]
Only try to import a definition if there is an definition to import.

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

12 years agoMake sure we correctly treat __is_convertible_to as an unevaluated context. PR11833.
Eli Friedman [Wed, 25 Jan 2012 01:05:57 +0000 (01:05 +0000)]
Make sure we correctly treat __is_convertible_to as an unevaluated context.  PR11833.

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

12 years agoFix test on cygwin (where va_list expands to a different type)
Jean-Daniel Dupas [Wed, 25 Jan 2012 01:02:26 +0000 (01:02 +0000)]
Fix test on cygwin (where va_list expands to a different type)

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

12 years agoWhenever Sema attempts to look in the global method pool, try to load
Douglas Gregor [Wed, 25 Jan 2012 00:59:09 +0000 (00:59 +0000)]
Whenever Sema attempts to look in the global method pool, try to load
additional data from the external Sema source. This properly copes
with modules that are imported after we have already searched in the
global method pool for a given selector. For PCH, it's a slight
pessimization to be fixed soon.

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

12 years agoAdd "multiple format attributes" support on block.
Jean-Daniel Dupas [Wed, 25 Jan 2012 00:55:11 +0000 (00:55 +0000)]
Add "multiple format attributes" support on block.

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

12 years agoRework the external Sema source's ReadMethodPool() so that it doesn't
Douglas Gregor [Wed, 25 Jan 2012 00:49:42 +0000 (00:49 +0000)]
Rework the external Sema source's ReadMethodPool() so that it doesn't
return pre-built lists. Instead, it feeds the methods it deserializes
to Sema so that Sema can unique them, which keeps the chains shorter.

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

12 years agoReduce peak memory usage of the static analyzer on sqlite3 (when using inlining)...
Ted Kremenek [Wed, 25 Jan 2012 00:35:05 +0000 (00:35 +0000)]
Reduce peak memory usage of the static analyzer on sqlite3 (when using inlining) by 30%.

This is accomplished by periodically reclaiming nodes in the graph.  This was an optimization
done before the CFG was linearized, but the CFG linearization destroyed that optimization since each
freshly created node couldn't be reclaimed and we only looked at a window of nodes created between
each ProcessStmt.  This optimization can be reclaimed my merely expanding the window to N number of nodes.

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

12 years agoarc migrator: Provide infrastructure to add options
Fariborz Jahanian [Wed, 25 Jan 2012 00:20:29 +0000 (00:20 +0000)]
arc migrator: Provide infrastructure to add options
specific to migrator. Use its first option to
warn migrating from GC to arc when
NSAllocateCollectable/NSReallocateCollectable is used.
// rdar://10532541

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

12 years agoFactor out the addition of a method into the global method pool, and
Douglas Gregor [Wed, 25 Jan 2012 00:19:56 +0000 (00:19 +0000)]
Factor out the addition of a method into the global method pool, and
teach it to always add the new method at the *end* of the list rather
than as the second element in the list.

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

12 years agoFix NSLog format string checking for %@.
Ted Kremenek [Wed, 25 Jan 2012 00:04:09 +0000 (00:04 +0000)]
Fix NSLog format string checking for %@.

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

12 years agoSwitch PerformImplicitConversion over to use DefaultLvalueConversion for lvalue-to...
Eli Friedman [Tue, 24 Jan 2012 22:51:26 +0000 (22:51 +0000)]
Switch PerformImplicitConversion over to use DefaultLvalueConversion for lvalue-to-rvalue conversion.

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

12 years agoReplace a hack to handle NSLog/NSLogv in sema by declaring them as Library Builtins.
Jean-Daniel Dupas [Tue, 24 Jan 2012 22:32:46 +0000 (22:32 +0000)]
Replace a hack to handle NSLog/NSLogv in sema by declaring them as Library Builtins.

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

12 years agoRemove trailing slash in front of header name of ObjC builtins.
Jean-Daniel Dupas [Tue, 24 Jan 2012 22:29:27 +0000 (22:29 +0000)]
Remove trailing slash in front of header name of ObjC builtins.

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

12 years ago[analyzer] Add the HTML file to the SATest diagnostic diff.
Anna Zaks [Tue, 24 Jan 2012 21:57:35 +0000 (21:57 +0000)]
[analyzer] Add the HTML file to the SATest diagnostic diff.
(Uses the functionality which has been in CmpRuns long before.)

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

12 years ago[analyzer] Testing: make diagnostic diffs more informative (add
Anna Zaks [Tue, 24 Jan 2012 21:57:32 +0000 (21:57 +0000)]
[analyzer] Testing: make diagnostic diffs more informative (add
diagnostic message).

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

12 years ago[libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"
Argyrios Kyrtzidis [Tue, 24 Jan 2012 21:39:26 +0000 (21:39 +0000)]
[libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"
for forward references of classes and protocols, this breaks libclang API usage.

rdar://10747438.

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

12 years agoTeach scanf/printf checking about '%Ld' and friends (a GNU extension). Fixes PR...
Ted Kremenek [Tue, 24 Jan 2012 21:29:54 +0000 (21:29 +0000)]
Teach scanf/printf checking about '%Ld' and friends (a GNU extension).  Fixes PR 9466.

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

12 years agoForce triple on these tests to pacify the windows tester.
Nick Lewycky [Tue, 24 Jan 2012 21:28:47 +0000 (21:28 +0000)]
Force triple on these tests to pacify the windows tester.

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

12 years agoAdd a new warning, -Wover-aligned, which detects attempts to use the default
Nick Lewycky [Tue, 24 Jan 2012 21:15:41 +0000 (21:15 +0000)]
Add a new warning, -Wover-aligned, which detects attempts to use the default
allocator to construct an object which declares more alignment than the default
allocator actually provides. Fixes PR9527!

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

12 years agoFix one of the (larger) FIXMEs where we were misusing the Driver's idea
Chandler Carruth [Tue, 24 Jan 2012 20:08:17 +0000 (20:08 +0000)]
Fix one of the (larger) FIXMEs where we were misusing the Driver's idea
of the target triple to stand in for the "host" triple.

Thanks to a great conversation with Richard Smith, I'm now much more
confident in how this is proceeding. In all of the places where we
currently reason about the "host" architecture or triple, what we really
want to reason about in the detected GCC installation architecture or
triple, and the ways in which that differs from the target. When we find
a GCC installation with a different triple from our target *but capable
of targeting our target* through an option such as '-m64', we want to
detect *that* case and change the paths within the GCC installation (and
libstdc++ installation) to reflect this difference.

This patch makes one function do this correctly. Subsequent commits will
hoist the logic used here into the GCCInstallation utility, and then
reuse it through the rest of the toolchains to fix the remaining places
where this is currently happening.

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

12 years agoSmall code cleanup/simplification in Sema::ClassifyName.
Kaelyn Uhrain [Tue, 24 Jan 2012 19:45:35 +0000 (19:45 +0000)]
Small code cleanup/simplification in Sema::ClassifyName.

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

12 years ago[libclang] When calling clang_getCursorReferenced on a class or protocol
Argyrios Kyrtzidis [Tue, 24 Jan 2012 19:40:15 +0000 (19:40 +0000)]
[libclang] When calling clang_getCursorReferenced on a class or protocol
forward reference, do give an interface or protocol cursor back, don't give
an 'UnexposedDecl' one.

rdar://10743193

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

12 years agoobjc: Issue a generic diagnostic assigning to
Fariborz Jahanian [Tue, 24 Jan 2012 19:40:13 +0000 (19:40 +0000)]
objc: Issue a generic diagnostic assigning to
an objc object in any abi mode.

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

12 years ago[analyzer] Add more C taint sources/sinks.
Anna Zaks [Tue, 24 Jan 2012 19:32:25 +0000 (19:32 +0000)]
[analyzer] Add more C taint sources/sinks.

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

12 years agoAddress one part of the FIXME I introduced my switching the triple
Chandler Carruth [Tue, 24 Jan 2012 19:28:29 +0000 (19:28 +0000)]
Address one part of the FIXME I introduced my switching the triple
inside of GCCInstallation to be a proper llvm::Triple. This is still
a touch ugly because we have to use it as a string in so many places,
but I think on the whole the more structured representation is better.

Comments of course welcome if this tradeoff isn't working for folks.

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

12 years agoThe following patch adds __attribute__((no_address_safety_analysis)) which will allow...
Kostya Serebryany [Tue, 24 Jan 2012 19:25:38 +0000 (19:25 +0000)]
The following patch adds __attribute__((no_address_safety_analysis)) which will allow to disable
address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function.

When building with AddressSanitizer, add AddressSafety function attribute to every generated function
except for those that have __attribute__((no_address_safety_analysis)).

With this patch we will be able to
1. disable AddressSanitizer for a particular function
2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on.

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

12 years agoAt least within these classes, consistently spell 'GCC' as 'GCC'.
Chandler Carruth [Tue, 24 Jan 2012 19:21:42 +0000 (19:21 +0000)]
At least within these classes, consistently spell 'GCC' as 'GCC'.
I can't read Java-style 'Gcc' acronyms. ;]

No functionality changed.

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

12 years agoStart hoisting the logic for computing the target triple into its own
Chandler Carruth [Tue, 24 Jan 2012 19:17:46 +0000 (19:17 +0000)]
Start hoisting the logic for computing the target triple into its own
function. The logic for this, and I want to emphasize that this is the
logic for computing the *target* triple, is currently scattered
throughout various different HostInfo classes ToolChain factoring
functions. Best part, it is largely *duplicated* there. The goal is to
hoist all of that up to here where we can deal with it once, and in
a consistent manner.

Unfortunately, this uncovers more fun problems: the ToolChains assume
that the *actual* target triple is the one passed into them by these
factory functions, while the *host* triple is the one in the driver.
This already was a lie, and a damn lie, when the '-target' flag was
specified. It only really worked when the difference stemmed from '-m32'
and '-m64' flags. I'll have to fix that (and remove all the FIXMEs I've
introduced here to document the problem) before I can finish hoisting
the target-calculation logic.

It's bugs all the way down today it seems...

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

12 years agoPromote the extension warning for attempts to catch a reference or
Douglas Gregor [Tue, 24 Jan 2012 19:01:26 +0000 (19:01 +0000)]
Promote the extension warning for attempts to catch a reference or
pointer to incomplete type from an ExtWarn to an error. We put the
ExtWarn in place as part of a workaround for Boost (PR6527), but it
(1) doesn't actually match a GCC extension and (2) has been fixed for
two years in Boost, and (3) causes us to emit code that fails badly at
run time, so it's a bad idea to keep it. Fixes PR11803.

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

12 years agoWhen importing a RecordDecl as a DeclContext, make sure that we pull
Douglas Gregor [Tue, 24 Jan 2012 18:36:04 +0000 (18:36 +0000)]
When importing a RecordDecl as a DeclContext, make sure that we pull
in the definition as well.

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

12 years agoobjc: issue error if assigning objects in fragile-abi too.
Fariborz Jahanian [Tue, 24 Jan 2012 18:05:45 +0000 (18:05 +0000)]
objc: issue error if assigning objects in fragile-abi too.
// rdar://10731065

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

12 years agoTeach the AST importer about redeclaration chains for Objective-C
Douglas Gregor [Tue, 24 Jan 2012 17:42:07 +0000 (17:42 +0000)]
Teach the AST importer about redeclaration chains for Objective-C
classes and protocols, implementing lazy-import semantics for both.

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

12 years agoOnly mark an IdentifierInfo as having changed since deserialization
Douglas Gregor [Tue, 24 Jan 2012 15:24:38 +0000 (15:24 +0000)]
Only mark an IdentifierInfo as having changed since deserialization
when it actually has changed (and not, e.g., when we've simply attached a
deserialized macro definition). Good for ~1.5% reduction in module
file size, mostly in the identifier table.

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

12 years agoOn Darwin, use the system's <unwind.h> whenever it is
Douglas Gregor [Tue, 24 Jan 2012 15:12:50 +0000 (15:12 +0000)]
On Darwin, use the system's <unwind.h> whenever it is
available. Clang's <unwind.h> isn't ready for prime time. Fixes
<rdar://problem/10733587>.

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

12 years agoRemove HostInfo::useDriverDriver(). This was only used in two places
Chandler Carruth [Tue, 24 Jan 2012 10:43:44 +0000 (10:43 +0000)]
Remove HostInfo::useDriverDriver(). This was only used in two places
inside the innards of the Driver implementation, and only ever
implemented to return 'true' for the Darwin OSes. Instead use a more
direct query on the target triple and a comment to document why the
target matters here.

If anyone is worried about this predicate getting wider use or improper
use, I can make it a local or private predicate in the driver.

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

12 years agoHoist the targeted triple object into an actual object in the Driver.
Chandler Carruth [Tue, 24 Jan 2012 10:21:46 +0000 (10:21 +0000)]
Hoist the targeted triple object into an actual object in the Driver.
The Driver has a fixed target, whether we like it or not, the
DefaultTargetTriple is not a default. This at least makes things more
honest. I'll eventually get rid of most (if not all) of
DefaultTargetTriple with this proper triple object. Bit of a WIP.

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

12 years agoSupport decltype in member initializers.
David Blaikie [Tue, 24 Jan 2012 06:03:59 +0000 (06:03 +0000)]
Support decltype in member initializers.

This is the last piece of N3031 (decltype in weird places) - supporting
the use of decltype in a class ctor's member-initializer-list to
specify the base classes to initialize.

Reviewed by Richard Smith.

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

12 years agoSupport decltype as a simple-type-specifier.
David Blaikie [Tue, 24 Jan 2012 05:47:35 +0000 (05:47 +0000)]
Support decltype as a simple-type-specifier.

This makes all sorts of fun examples work with decltype.
Reviewed by Richard Smith.

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

12 years agoAdd a test for a diagnostic special case added in r148439, as requested by
Richard Smith [Tue, 24 Jan 2012 05:40:50 +0000 (05:40 +0000)]
Add a test for a diagnostic special case added in r148439, as requested by
Francois Pichet.

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

12 years agoReword/rename -Wswitch-unreachable-default.
David Blaikie [Tue, 24 Jan 2012 05:34:08 +0000 (05:34 +0000)]
Reword/rename -Wswitch-unreachable-default.

Rewording the diagnostic to be more precise/correct: "default label in switch
which covers all enumeration values" and changed the switch to
-Wcovered-switch-default

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

12 years agoImprove -Wswitch-enum diagnostic message.
David Blaikie [Tue, 24 Jan 2012 04:56:25 +0000 (04:56 +0000)]
Improve -Wswitch-enum diagnostic message.

Changing wording to include the word "explicitly" (as in "enumeration value ...
not /explicitly/ handled by switch"), as suggested by Richard Smith.

Also, now that the diagnostic text differs between -Wswitch and -Wswitch-enum,
I've simplified the test cases a bit.

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

12 years agoRevert various template unreachability code I committed accidentally.
David Blaikie [Tue, 24 Jan 2012 04:51:48 +0000 (04:51 +0000)]
Revert various template unreachability code I committed accidentally.

r148774, r148775, r148776, r148777

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

12 years agoMore fixes/tests.
David Blaikie [Tue, 24 Jan 2012 04:29:31 +0000 (04:29 +0000)]
More fixes/tests.

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

12 years agoTest for the previous commit/crash.
David Blaikie [Tue, 24 Jan 2012 04:29:27 +0000 (04:29 +0000)]
Test for the previous commit/crash.

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

12 years agoSupport undefined dependent bases.
David Blaikie [Tue, 24 Jan 2012 04:29:23 +0000 (04:29 +0000)]
Support undefined dependent bases.

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

12 years agoSimple hack to do unreachable code analysis on template patterns.
David Blaikie [Tue, 24 Jan 2012 04:29:18 +0000 (04:29 +0000)]
Simple hack to do unreachable code analysis on template patterns.

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

12 years agoRename Sema::isNullExpr() -> Sema::isSentinelNullExpr() which is more descriptive.
Argyrios Kyrtzidis [Tue, 24 Jan 2012 03:13:57 +0000 (03:13 +0000)]
Rename Sema::isNullExpr() -> Sema::isSentinelNullExpr() which is more descriptive.

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

12 years agoMake driver tests more resilient to output trees containing symlinks --
Chandler Carruth [Tue, 24 Jan 2012 01:55:55 +0000 (01:55 +0000)]
Make driver tests more resilient to output trees containing symlinks --
the tests are making assertions about the name of the clang binary, so
we should ensure that the name is as stable as possible.

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

12 years agoIn CXXRecordDecl::isCLike(), also check for PODness.
Argyrios Kyrtzidis [Tue, 24 Jan 2012 01:37:11 +0000 (01:37 +0000)]
In CXXRecordDecl::isCLike(), also check for PODness.

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

12 years agoobjective-c: Ignore with warning forward class declaration whose name
Fariborz Jahanian [Tue, 24 Jan 2012 00:40:15 +0000 (00:40 +0000)]
objective-c: Ignore with warning forward class declaration whose name
matches a typedef declaring an object type. // rdar://10733000

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

12 years agoMake sure the integer type used to align the vaarg address is the same as the
Akira Hatanaka [Mon, 23 Jan 2012 23:59:52 +0000 (23:59 +0000)]
Make sure the integer type used to align the vaarg address is the same as the
type of pointers.

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

12 years agofixes location of "availability" attribute so warning is displayed at
Fariborz Jahanian [Mon, 23 Jan 2012 23:38:32 +0000 (23:38 +0000)]
fixes location of "availability" attribute so warning is displayed at
its line. // rdar://10711037

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

12 years agoIgnore return type if its size is zero.
Akira Hatanaka [Mon, 23 Jan 2012 23:18:57 +0000 (23:18 +0000)]
Ignore return type if its size is zero.

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

12 years agoRemove extraneous ';'.
Bill Wendling [Mon, 23 Jan 2012 22:53:59 +0000 (22:53 +0000)]
Remove extraneous ';'.

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

12 years agoMinor fixups for auto deduction of initializer lists.
Sebastian Redl [Mon, 23 Jan 2012 22:09:39 +0000 (22:09 +0000)]
Minor fixups for auto deduction of initializer lists.

Fix some review comments.
Add a test for deduction when std::initializer_list isn't available yet.
Fix redundant error messages. This fixes and outstanding FIXME too.

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

12 years ago[libclang] For:
Argyrios Kyrtzidis [Mon, 23 Jan 2012 21:28:38 +0000 (21:28 +0000)]
[libclang] For:
@implementation I(cat)
suppress subsequent references to 'I'.

rdar://10568103

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

12 years agoIntroduce Sema::isNullExpr() that contains the checks that
Argyrios Kyrtzidis [Mon, 23 Jan 2012 20:38:53 +0000 (20:38 +0000)]
Introduce Sema::isNullExpr() that contains the checks that
Sema::DiagnoseSentinelCalls() does.

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

12 years agoIn CorrectTypo, use the cached correction as a starting point instead.
Kaelyn Uhrain [Mon, 23 Jan 2012 20:18:59 +0000 (20:18 +0000)]
In CorrectTypo, use the cached correction as a starting point instead.

Previously, for unqualified lookups, a positive cache hit is used as the
only non-keyword correction and a negative cache hit immediately returns
an empty TypoCorrection. With the new callback objects, this behavior
causes false negatives by not accounting for the fact that callback
objects alter the set of potential/allowed corrections. The new behavior
is to seed the set of corrections with the cached correction (for
positive hits) to estabilishing a baseline edit distance. Negative cache
hits are only stored or used when either no callback object is provided
or when it returns true for a call to ValidateCandidate with an empty
TypoCorrection (i.e. when ValidateCandidate does not seem to be doing
any checking of the TypoCorrection, such as when an instance of the base
callback class is used solely to specify the set of keywords to be accepted).

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

12 years ago[asan] document the need for -fno-optimize-sibling-calls
Kostya Serebryany [Mon, 23 Jan 2012 18:50:23 +0000 (18:50 +0000)]
[asan] document the need for -fno-optimize-sibling-calls

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

12 years agoFix a typo: _MM_FLUSH_ZERO_OFF has the wrong value. rdar://10716672
Bob Wilson [Mon, 23 Jan 2012 18:27:24 +0000 (18:27 +0000)]
Fix a typo: _MM_FLUSH_ZERO_OFF has the wrong value. rdar://10716672

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

12 years agoIntroduce CXXRecordDecl::isCLike() that is true if the class is C-like,
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:45 +0000 (16:58 +0000)]
Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,
without C++-specific features.

Use it to set the language to C++ when indexing non-C-like structs.
rdar://10732579

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

12 years ago[libclang] Index C++ template specializations, rdar://10732708
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:41 +0000 (16:58 +0000)]
[libclang] Index C++ template specializations, rdar://10732708

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

12 years ago[libclang] Index namespaces in C++ qualified lookup of members, rdar://10732798
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:38 +0000 (16:58 +0000)]
[libclang] Index namespaces in C++ qualified lookup of members, rdar://10732798

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

12 years ago[libclang] Index C++ constructor initializers, rdar://10732164
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:36 +0000 (16:58 +0000)]
[libclang] Index C++ constructor initializers, rdar://10732164

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

12 years agoImprove Lexer::getImmediateMacroName to take into account inner macros
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:33 +0000 (16:58 +0000)]
Improve Lexer::getImmediateMacroName to take into account inner macros
of macro arguments.

For "MAC1( MAC2(foo) )" and location of 'foo' token it would return
"MAC1" instead of "MAC2".

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

12 years agoHandle pseudo-object expressions (and any other placeholder
Douglas Gregor [Mon, 23 Jan 2012 15:59:30 +0000 (15:59 +0000)]
Handle pseudo-object expressions (and any other placeholder
expression) when code-completing member access expressions. Fixes
<rdar://problem/10717172>.

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

12 years agoAdd -Wnarrowing as an alias for -Wc++11-narrowing, for better GCC
Douglas Gregor [Mon, 23 Jan 2012 15:52:03 +0000 (15:52 +0000)]
Add -Wnarrowing as an alias for -Wc++11-narrowing, for better GCC
compatibility.

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

12 years agoDowngrade C++11 narrowing conversion errors to warnings default-mapped
Douglas Gregor [Mon, 23 Jan 2012 15:29:33 +0000 (15:29 +0000)]
Downgrade C++11 narrowing conversion errors to warnings default-mapped
to an error, so that users can turn them off if necessary. Note that
this does *not* change the behavior of in a SFINAE context, where we
still flag an error even if the warning is disabled. This matches
GCC's behavior.

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

12 years agoAdd support for -fno-optimize-sibling-calls. Currently only implemented in the
Nick Lewycky [Mon, 23 Jan 2012 08:29:12 +0000 (08:29 +0000)]
Add support for -fno-optimize-sibling-calls. Currently only implemented in the
X86 backend in LLVM.

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

12 years agoAdd a source range to the ms path. Spotted by David Blaikie.
Nico Weber [Mon, 23 Jan 2012 06:08:16 +0000 (06:08 +0000)]
Add a source range to the ms path. Spotted by David Blaikie.

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

12 years agoIn microsoft mode, downgrade pseudo-destructors on void from error to warning.
Nico Weber [Mon, 23 Jan 2012 05:50:57 +0000 (05:50 +0000)]
In microsoft mode, downgrade pseudo-destructors on void from error to warning.

This matches cl.exe's behavior and fixes PR11791.

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

12 years agoRename -Wswitch-enum-redundant-default to -Wswitch-redundant-default.
David Blaikie [Mon, 23 Jan 2012 04:58:54 +0000 (04:58 +0000)]
Rename -Wswitch-enum-redundant-default to -Wswitch-redundant-default.

This is for consistency, since the flag is actually under -Wswitch now, rather
than -Wswitch-enum (since it's really valuable for the former and rather
orthogonal to the latter)

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

12 years agoImplement -Wswitch-enum correctly.
David Blaikie [Mon, 23 Jan 2012 04:46:12 +0000 (04:46 +0000)]
Implement -Wswitch-enum correctly.

Clang previously implemented -Wswitch-enum the same as -Wswitch. This patch
corrects the behavior to match GCC's. The critical/only difference being that
-Wswitch-enum is not silenced by the presence of a default case in the switch.

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

12 years agoConvert file from 60% unix 40% dos line endings to 100% unix line endings.
Nico Weber [Mon, 23 Jan 2012 04:08:13 +0000 (04:08 +0000)]
Convert file from 60% unix 40% dos line endings to 100% unix line endings.

No other changes.

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

12 years agoEli says this should check MicrosoftMode instead.
Nico Weber [Mon, 23 Jan 2012 04:01:33 +0000 (04:01 +0000)]
Eli says this should check MicrosoftMode instead.

Also change a || that I accidentally changed to && back to ||.

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

12 years agoIn ms mode, a move assignment operator shouldn't mark a copy ctor as deleted.
Nico Weber [Mon, 23 Jan 2012 03:19:29 +0000 (03:19 +0000)]
In ms mode, a move assignment operator shouldn't mark a copy ctor as deleted.

MSVC2010's pair class has a move assignment operator but no explicit copy
constructor, which makes it unusable without this change.

For symmetry, let move copy constructors not mark the default assignment
operator as deleted either. Both changes match cl.exe's behavior.  Fixes
pr11826.

Also update the standard excerpt to point to the right paragraph.

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

12 years agoMake sure the AST correctly represents lvalue-to-rvalue conversions where appropriate.
Eli Friedman [Mon, 23 Jan 2012 02:35:22 +0000 (02:35 +0000)]
Make sure the AST correctly represents lvalue-to-rvalue conversions where appropriate.

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

12 years agoFix -Wswitch to warn about out of bounds enum cases even when there's a default
David Blaikie [Sun, 22 Jan 2012 02:31:55 +0000 (02:31 +0000)]
Fix -Wswitch to warn about out of bounds enum cases even when there's a default

For consistency with GCC & reasonable sanity. The FIXME suggests that the
original author was perhaps using the default check for some other purpose,
not realizing the more obvious limitation/false-negatives it creates, but this
doesn't seem to produce any regressions & fixes the included test.

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

12 years agoMove -Wswitch-enum to -Wswitch
David Blaikie [Sun, 22 Jan 2012 01:58:03 +0000 (01:58 +0000)]
Move -Wswitch-enum to -Wswitch

This matches GCC's documented (& actual) behavior. What Clang had implemented
as -Wswitch-enum was actually GCC's -Wswitch behavior. -Wswitch is on by
default (part of -Wall) and warns if a switch-over-enum, without a default
case, covers all enum values.

-Wswitch-enum, on the other hand, does not have the default clause and should
fire even in the presence of a default. This warning is off by default.

With this change the -Wswitch-enum flag is off-by-default in Clang but has no
functionality at the moment. I'll add that in a future commit.

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

12 years agoIn Microsoft Mode, disable the C++11 strict integral conversion rules for enumerator...
Francois Pichet [Sat, 21 Jan 2012 23:26:50 +0000 (23:26 +0000)]
In Microsoft Mode, disable the C++11 strict integral conversion rules for enumerator that were introduced with r148439. Otherwise MSVC headers won't compile in C++ 11 mode.

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

12 years agoAdd -Wswitch-enum-redundant-default.
David Blaikie [Sat, 21 Jan 2012 18:12:07 +0000 (18:12 +0000)]
Add -Wswitch-enum-redundant-default.

This warning acts as the complement to the main -Wswitch-enum warning (which
warns whenever a switch over enum without a default doesn't cover all values of
 the enum) & has been an an-doc coding convention in LLVM and Clang in my
experience. The purpose is to ensure there's never a "dead" default in a
switch-over-enum because this would hide future -Wswitch-enum errors.

The name warning has a separate flag name so it can be disabled but it's grouped
under -Wswitch-enum & is on-by-default because of this.

The existing violations of this rule in test cases have had the warning disabled
& I've added a specific test for the new behavior (many negative cases already
exist in the same test file - and none regressed - so I didn't add more).

Reviewed by Ted Kremenek ( http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120116/051690.html )

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

12 years agolib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.
NAKAMURA Takumi [Sat, 21 Jan 2012 14:46:07 +0000 (14:46 +0000)]
lib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.

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

12 years ago[Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.
NAKAMURA Takumi [Sat, 21 Jan 2012 14:46:01 +0000 (14:46 +0000)]
[Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.

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

12 years ago[analyzer] It's possible to have a non PointerType expression evaluate to a Loc value...
Anna Zaks [Sat, 21 Jan 2012 06:59:01 +0000 (06:59 +0000)]
[analyzer] It's possible to have a non PointerType expression evaluate to a Loc value. When this happens, use the default type.

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