]>
granicus.if.org Git - clang/log
Ted Kremenek [Wed, 23 Feb 2011 02:26:43 +0000 (02:26 +0000)]
Add doxygen comments to Sema::DiagRuntimeBehavior().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126296
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 02:15:19 +0000 (02:15 +0000)]
Add test case (from PR 8876) for suppressing 'indirection of non-volatile null pointer...' warning due to reachability analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126294
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 23 Feb 2011 01:53:29 +0000 (01:53 +0000)]
Sema: diagnose kernel calls to non-global functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126292
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:52:07 +0000 (01:52 +0000)]
Add test case for PR 9284, a false positive for -Warray-bounds that is now addressed using basic reachability analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126291
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:52:04 +0000 (01:52 +0000)]
Enhance Sema::DiagRuntimeBehavior() to delay some diagnostics to see if the related code is reachable. This suppresses some
diagnostics that occur in unreachable code (e.g., -Warray-bound).
We only pay the cost of doing the reachability analysis when we issue one of these diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126290
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:51:59 +0000 (01:51 +0000)]
Migrate CFGReachabilityAnalysis out of the IdempotentOperationsChecker and into its own analysis file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126289
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:51:53 +0000 (01:51 +0000)]
Have IdempotentOperationsChecker pull its CFGStmtMap from AnalysisContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126288
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:51:48 +0000 (01:51 +0000)]
Issue AnalysisBasedWarnings as part of calling Sema::PopBlockOrFunctionScope(). No real functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126287
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:51:43 +0000 (01:51 +0000)]
Update Sema::DiagRuntimeBehavior() to take an optional Stmt* to indicate the code the diagnostic is associated with.
This Stmt* is unused, but we will use it shortly for pruning diagnostics associated
with unreachable code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126286
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Feb 2011 01:51:40 +0000 (01:51 +0000)]
Change -Warray-bounds logic to use DiagRuntimeBehavior in preparation for using basic dataflow to suppress warnings on unreachable array bounds checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126285
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 23 Feb 2011 01:05:36 +0000 (01:05 +0000)]
[analyzer] Migrate to CheckerV2:
CastToStructChecker
FixedAddressChecker
MacOSXAPIChecker
PointerArithChecker
PointerSubChecker
PthreadLockChecker
UnixAPIChecker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126284
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 23 Feb 2011 00:47:48 +0000 (00:47 +0000)]
Switch the VerifyDiagnosticsClient to use PresumedLocs now that they
exist. Cheat and do this by adding some wrappers around the PresumedLoc
machinery that directly return the line and column number.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126281
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 23 Feb 2011 00:41:16 +0000 (00:41 +0000)]
Update the www to indicate that auto is now implemented.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126280
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 23 Feb 2011 00:37:57 +0000 (00:37 +0000)]
Fix PR9276: We were missing the checks for auto deducing to different types in the same declaration group in the template instantiation case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126279
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 23 Feb 2011 00:16:10 +0000 (00:16 +0000)]
[analyzer] Migrate the BasicObjCFoundationChecks to CheckerV2:
NilArgChecker
CFNumberCreateChecker
ClassReleaseChecker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126275
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 23 Feb 2011 00:16:07 +0000 (00:16 +0000)]
[analyzer] Fix CheckerManager::runCheckersForObjCMessage.
It would run PostObjCMessage checkers even for PreObjCMessage checking.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126274
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 23 Feb 2011 00:16:04 +0000 (00:16 +0000)]
Silence a MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126273
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 23 Feb 2011 00:16:01 +0000 (00:16 +0000)]
[analyzer] Refactor BugTypes and their ownership model.
-In general, don't have the BugReporter deleting BugTypes, BugTypes will eventually become owned by checkers
and outlive the BugReporter. In the meantime, there will be some leaks since some checkers assume that
the BugTypes they create will be destroyed by the BugReporter.
-Have BugReporter::EmitBasicReport create BugTypes that are reused if the same name & category strings
are passed to EmitBasicReport. These BugTypes are owned and destroyed by the BugReporter.
This allows bugs reported through EmitBasicReport to be coalesced.
-Remove the llvm::FoldingSet<BugReportEquivClass> from BugType and move it into the BugReporter.
For uniquing BugReportEquivClass also use the BugType* so that we can iterate over all of them using only one set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126272
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 23 Feb 2011 00:15:56 +0000 (00:15 +0000)]
In the clang.xcodeproj modify the 'clang' target to do nothing, not try to build anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126270
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 23 Feb 2011 00:11:21 +0000 (00:11 +0000)]
Better parser recovery when method is
errornously defined inside an objc class.
// rdar://
7029784
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126269
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 23 Feb 2011 00:09:59 +0000 (00:09 +0000)]
DeclGroup's operator[] always returned the first Decl in the group.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126268
91177308 -0d34-0410-b5e6-
96231b3b80d8
Matt Beaumont-Gay [Tue, 22 Feb 2011 23:52:53 +0000 (23:52 +0000)]
Clean up the error recovery at the bottom of Sema::LookupMemberExpr. This
mostly just shuffles various possibilities for recovery into a more
straightforward order, but also unifies a couple of diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126266
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 22 Feb 2011 23:21:06 +0000 (23:21 +0000)]
When checking for abstract types, don't crash when we have a
FunctionProtoTypeLoc with NULL function parameter types, which can
occur in invalid code. Fixes PR9247 / <rdar://problem/
9037911 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126262
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 22 Feb 2011 23:17:49 +0000 (23:17 +0000)]
Provide Fixit warning when 'auto' is intended as storage
specifier in legacy code. Patch is reviewed offline by Doug.
// rdar://
9036633 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126261
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 22 Feb 2011 22:38:33 +0000 (22:38 +0000)]
Emit the structure layout of the block literal parameter to a block
invocation function into the debug info. Rather than faking up a class,
which is tricky because of the custom layout we do, we just emit a struct
directly from the layout information we've already got.
Also, don't emit an unnecessarily parameter alloca for this "variable".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126255
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 22 Feb 2011 22:25:56 +0000 (22:25 +0000)]
Give ImplicitParamDecl a public constructor so that it can be allocated on
the stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126254
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 22 Feb 2011 22:25:23 +0000 (22:25 +0000)]
Provide a Decl::getNonClosureContext to look through any "closure" (i.e.
block and, eventually, C++ lambda) contexts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126252
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 22 Feb 2011 21:42:31 +0000 (21:42 +0000)]
We need a longer long when testing this pathe Microsoft fixed-underlying-type extension for enumeration types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126250
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 22 Feb 2011 20:55:26 +0000 (20:55 +0000)]
A constructor call should force class's debug info even if -flimit-debug-info is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126246
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Feb 2011 20:47:07 +0000 (20:47 +0000)]
improve support for SUSE Linux Enterprise Server 11 SP1 (x86_64).
Patch by Csaba Raduly!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126245
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 22 Feb 2011 20:32:04 +0000 (20:32 +0000)]
Enable enumeration types with a fixed underlying type, e.g.,
enum X : long { Value = 0x100000000 };
when in Microsoft-extension mode (-fms-extensions). This (now C++0x)
feature has been supported since Microsoft Visual Studio .NET 2003.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126243
91177308 -0d34-0410-b5e6-
96231b3b80d8
Matt Beaumont-Gay [Tue, 22 Feb 2011 20:00:16 +0000 (20:00 +0000)]
Use an unused-except-in-Debug variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126240
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 22 Feb 2011 18:56:36 +0000 (18:56 +0000)]
Use LLVM coding standard.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126232
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 22 Feb 2011 18:29:51 +0000 (18:29 +0000)]
Implement the GNU C extension which permits the initialization of an
array from a constant array compound literal. Fixes PR9261.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126230
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 22 Feb 2011 17:30:38 +0000 (17:30 +0000)]
[analyzer] Start moving the path-sensitive checkers to CheckerV2.
-Migrate ObjCSelfInitChecker to CheckerV2. In the process remove the 'preCallSelfFlags' field
from the checker class and use GRState for storing that info.
-Get ExprEngine to start delegating checker running to CheckerManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126229
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 22 Feb 2011 17:30:32 +0000 (17:30 +0000)]
[analyzer] Separate CheckerContext into its own include file. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126228
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 22 Feb 2011 17:30:28 +0000 (17:30 +0000)]
[analyzer] Fix GRStatePartialTrait<bool> and introduce GRStatePartialTrait<unsigned>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126227
91177308 -0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 22 Feb 2011 15:19:35 +0000 (15:19 +0000)]
Remove the storage for -cxx-system-include. Make libcxx toolchain
use -nostdinc++ and -cxx-isystem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126223
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 22 Feb 2011 13:49:06 +0000 (13:49 +0000)]
Reimplement __pragma support using a TokenLexer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126221
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 22 Feb 2011 13:49:00 +0000 (13:49 +0000)]
Make TokenLexer capable of storing preprocessor directive tokens
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126220
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Tue, 22 Feb 2011 13:05:15 +0000 (13:05 +0000)]
CMAKE_EXECUTABLE_SUFFIX is undefined when a cmake script is executed
with cmake -P ... so we need to deduce the correct executable prefix.
Fixes PR9286.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126219
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 22 Feb 2011 07:16:58 +0000 (07:16 +0000)]
Establish the iteration variable of an ObjC for-in loop before
emitting the collection expression. Fixes some really, really broken
code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126193
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 22 Feb 2011 06:44:22 +0000 (06:44 +0000)]
Reorganize the emission of local variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126189
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 22 Feb 2011 04:58:34 +0000 (04:58 +0000)]
Add CStringChecker support for strncpy. Patch by Lenny Maiorani!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126188
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 22 Feb 2011 04:55:05 +0000 (04:55 +0000)]
Add CStringChecker support for strnlen. Patch by Lenny Maiorani!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126187
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 22 Feb 2011 03:56:57 +0000 (03:56 +0000)]
lib/CodeGen/TargetInfo.cpp: On Win64, arg i128 should be emitted as INDIRECT.
mingw-w64's i128 tweak should be done with x86_64-mingw32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126186
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 22 Feb 2011 02:55:24 +0000 (02:55 +0000)]
Fix a little bug in the handling of enumeration types with a fixed
underlying type: we weren't parsing unnamed enumeration types with a
fixed underlying type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126184
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 22 Feb 2011 02:45:07 +0000 (02:45 +0000)]
Warn about implicit conversions between values of different, named
enumeration types. Fixes <rdar://problem/
8559831 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126183
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 22 Feb 2011 01:52:06 +0000 (01:52 +0000)]
Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
Update all tests accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126177
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 22 Feb 2011 01:23:29 +0000 (01:23 +0000)]
Move some Objective-C tests to SemaObjC and CodeGenObjC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126175
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 22 Feb 2011 01:22:29 +0000 (01:22 +0000)]
In Objective-C, there are no trailing return types, so don't produce diagnostics suggesting they are missing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126174
91177308 -0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 22 Feb 2011 00:40:56 +0000 (00:40 +0000)]
Bug#8945: Add -cxx-isystem option to specify C++ system directories.
It works like -isystem and the search path keeps -isystem and
-cxx-isystem in order relative to each other. -cxx-isystem is only used
for C++ sources though. Drop the existing -cxx-system-include option for
cc1 as it is now redundant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126167
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 22 Feb 2011 00:36:53 +0000 (00:36 +0000)]
Fix a few auto-related issues:
* 'auto' was being rejected on abstract-declarators with trailing return
types and on typedefs with trailing return types. 'auto' is always
allowed in these cases. This was found while testing the fix for PR 9278.
* A very poor diagnostic was being issued for auto (f() -> int): "return
type must be 'auto', not 'auto'". This is closely related to PR 9060.
* Trailing return type handling was happening slightly too late,
resulting in the checks for functions returning arrays and functions
returning functions being missed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126166
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 22 Feb 2011 00:19:36 +0000 (00:19 +0000)]
Add reference to PR 9278 for archaeologists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126164
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 21 Feb 2011 23:49:15 +0000 (23:49 +0000)]
Warn when type modifiers on objc method declarations in
protocols do not match with method implementation.
// rdar://
7076235
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126162
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Chisnall [Mon, 21 Feb 2011 23:47:40 +0000 (23:47 +0000)]
The instance size of a metaclass should be the size of a class. This is not, in fact, 0, even for very small classes. (GNU runtime)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126161
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 21 Feb 2011 23:18:00 +0000 (23:18 +0000)]
C++0x's deduced auto is illegal in typedefs.
This actually rules out too much, since it also catches typedefs for pointers to functions with trailing return types:
typedef auto (*F)() -> int;
Fix for that (and the same issue in all abstract-declarators) to follow shortly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126153
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 21 Feb 2011 23:12:51 +0000 (23:12 +0000)]
Targets/Darwin: mcount name on Darwin needs to be unmangled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126152
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Feb 2011 22:11:26 +0000 (22:11 +0000)]
Fix a CFGBuilder bug exposed on convoluted control-flow in the Linux kernel.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126149
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 21 Feb 2011 22:09:29 +0000 (22:09 +0000)]
add one more case of mismatched input/output constraints.
When the mismatch is due to a larger input operand that is
a constant, truncate it down to the size of the output. This
allows us to accept some cases in the linux kernel and elsewhere.
Pedantically speaking, we generate different code than GCC, though
I can't imagine how it would matter:
Clang:
movb $-1, %al
frob %al
GCC:
movl $255, %eax
frob %al
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126148
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 21 Feb 2011 21:50:25 +0000 (21:50 +0000)]
more code restructuring, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126146
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 21 Feb 2011 21:40:33 +0000 (21:40 +0000)]
split the iteration loop out to a helper function, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126145
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 21 Feb 2011 21:15:10 +0000 (21:15 +0000)]
fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126143
91177308 -0d34-0410-b5e6-
96231b3b80d8
Stuart Hastings [Mon, 21 Feb 2011 21:08:21 +0000 (21:08 +0000)]
Test case for r126127 and r126141. Radar
9012638 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126142
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 21 Feb 2011 20:10:02 +0000 (20:10 +0000)]
Mangling of undeduced 'auto' types, as specified by Itanium C++ ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126140
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 21 Feb 2011 20:05:19 +0000 (20:05 +0000)]
Tweaks to C++0x deduced auto type support:
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
* Temporary template parameter list for auto deduction is now allocated on the stack.
* Deduced 'auto' types are now uniqued.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126139
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Feb 2011 19:26:48 +0000 (19:26 +0000)]
Fix call to send_error() in scan-view. An int error code is expected but a string was being sent. Patch by Andrew Price!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126138
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 21 Feb 2011 19:25:48 +0000 (19:25 +0000)]
Don't warn about static const integral data members with in-line constant
initializers just because they don't have a proper out-of-line definition.
Such code is technically ill-formed but is too common and too unlikely to be
a problem to be seriously worth worrying about.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126137
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 21 Feb 2011 18:37:13 +0000 (18:37 +0000)]
Turn on 'auto' in plain objc mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126134
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 21 Feb 2011 18:36:51 +0000 (18:36 +0000)]
Pass the right linker flag in openbsd::Link::ConstructJob,
patch by Matthew Dempsky!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126133
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 21 Feb 2011 17:31:28 +0000 (17:31 +0000)]
Remove warning on future change in ivar lookup rule
when doing the property default synthesis.
// rdar://
9027673 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126128
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 21 Feb 2011 07:57:55 +0000 (07:57 +0000)]
Reorganize subelement initialization checking, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126116
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 21 Feb 2011 07:22:22 +0000 (07:22 +0000)]
Small optimization: avoid redundant checks of whether a type is an array
when checking an initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126115
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 21 Feb 2011 06:23:05 +0000 (06:23 +0000)]
Pseudo-revirtualize CallExpr::getSourceRange by making it follow the
logic from CXXMemberCallExpr and by making it check for
CXXOperatorCallExpr in order to defer. This is not really an awesome solution,
but I don't have a better idea.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126114
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 21 Feb 2011 05:25:38 +0000 (05:25 +0000)]
Bind references to opaque r-values correctly. Add a few test cases
for ?: on record types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126113
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 21 Feb 2011 03:19:49 +0000 (03:19 +0000)]
CMake: Eliminate duplicate -D__STDC_LIMIT_MACROS and -D__STDC_CONSTANT_MACROS. llvm/cmake/modules/HandleLLVMOptions.cmake defines them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126105
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 21 Feb 2011 02:28:50 +0000 (02:28 +0000)]
Rename test/CodeGenCXX/gnu-conditional-scalar-ext.cpp to conditional-gnu-ext.cpp
for consistency with other tests (and to remove "scalar" from the name).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126104
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 21 Feb 2011 00:56:56 +0000 (00:56 +0000)]
Clean up the tests for warning about unused function results given the
appropriate attribute. Add a bit more testing that finds a pretty bad
regression (since ~forever) in this warning. Fix it with a nice 2 line
change. =]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126098
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 21 Feb 2011 00:07:51 +0000 (00:07 +0000)]
Allow -Wformat to be enabled without -Wformat-security. GCC gates
-Wformat-security on -Wformat, not vice-versa.
Fixes PR8486. Patch by Oleg Slezberg.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126096
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Sun, 20 Feb 2011 22:06:44 +0000 (22:06 +0000)]
Put targets on folders, if the IDE supports the feature.
Requires CMake 2.8.3 or newer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126094
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Sun, 20 Feb 2011 22:06:32 +0000 (22:06 +0000)]
New function for tablegenning: clang_tablegen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126093
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Sun, 20 Feb 2011 19:41:34 +0000 (19:41 +0000)]
Correct name of dependent target.
CMake complained about this while generating VS project files but was
okay with it while generating makefiles on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126090
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 20 Feb 2011 17:41:24 +0000 (17:41 +0000)]
tests: Fix test on Win32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126087
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 20 Feb 2011 16:04:14 +0000 (16:04 +0000)]
Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126084
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sun, 20 Feb 2011 12:13:05 +0000 (12:13 +0000)]
Turn on __has_feature(cxx_auto_type). The feature is now fully implemented.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126078
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 20 Feb 2011 06:15:13 +0000 (06:15 +0000)]
Remove a dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126073
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sun, 20 Feb 2011 03:19:35 +0000 (03:19 +0000)]
Implement the C++0x deduced 'auto' feature.
This fixes PR 8738, 9060 and 9132.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126069
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ken Dyck [Sun, 20 Feb 2011 02:06:09 +0000 (02:06 +0000)]
Expand use of CharUnits in LayoutField(). No change in functionality
intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126066
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ken Dyck [Sun, 20 Feb 2011 01:55:18 +0000 (01:55 +0000)]
Add const qualifier to getTypeInfoInChars().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126064
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sun, 20 Feb 2011 00:59:54 +0000 (00:59 +0000)]
Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126063
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 20 Feb 2011 00:20:27 +0000 (00:20 +0000)]
Add a LangOptions::areExceptionsEnabled and start using it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126062
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 19 Feb 2011 23:53:54 +0000 (23:53 +0000)]
Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126061
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sat, 19 Feb 2011 23:03:58 +0000 (23:03 +0000)]
Re-instate r125819 and r125820 with no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126060
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 19 Feb 2011 22:55:41 +0000 (22:55 +0000)]
Fix PR9253, allowing attribute(aligned) to reduce the alignment of
a typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126059
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 19 Feb 2011 22:34:59 +0000 (22:34 +0000)]
Don't produce "comparison is always (true|false)" warnings when the
comparison itself is a constant expression. Fixes PR7536.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126057
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 19 Feb 2011 22:28:58 +0000 (22:28 +0000)]
implement a tiny amount of codegen support for gnu array range
designators: allowing codegen when the element initializer is a
constant or something else without a side effect. This unblocks
enough to let process.c in the linux kernel build, PR9257.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126056
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 19 Feb 2011 21:54:50 +0000 (21:54 +0000)]
In addition to in-class member functions marked with the "used"
attribute, we also care about those with the "constructor"
attribute. Fixes PR6521.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126055
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 19 Feb 2011 21:53:09 +0000 (21:53 +0000)]
There's no need to return early if we encounter a try/throw and exceptions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126053
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 19 Feb 2011 21:39:31 +0000 (21:39 +0000)]
Revert 125820 and 125819 to fix PR9266.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126050
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Sat, 19 Feb 2011 21:38:48 +0000 (21:38 +0000)]
Fix some add_dependencies.
The syntax is (add_dependencies target-name depend-target1 ...).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126049
91177308 -0d34-0410-b5e6-
96231b3b80d8