John McCall
612942d65f
Sketch out a framework for delaying the activation of a cleanup.
...
Not yet complete or used.
llvm-svn: 111044
2010-08-13 21:20:51 +00:00
Argyrios Kyrtzidis
98703d3883
Revert 111026 & 111027, build breakage.
...
llvm-svn: 111036
2010-08-13 20:13:06 +00:00
Argyrios Kyrtzidis
1063a71e43
The unused warnings extravaganza continues. Warn for:
...
-static variables
-variables in anonymous namespace (fixes rdar://7794535)
-static data members in anonymous namespace
-static data members specializations in anonymous namespace
llvm-svn: 111027
2010-08-13 18:42:40 +00:00
Argyrios Kyrtzidis
540bc01f50
Expand the unused warnings for functions. Warn for:
...
-static function declarations
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace
llvm-svn: 111026
2010-08-13 18:42:29 +00:00
Argyrios Kyrtzidis
35672e7852
Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also keeping track of unused file scoped variables.
...
This is only preparation, currently only static function definitions are tracked, as before.
llvm-svn: 111025
2010-08-13 18:42:17 +00:00
Fariborz Jahanian
18d90a97df
When issuing warning for future conflict resolution,
...
(nonfragile-abi2), do not consider 'ivar' access
in class methods. Also, improve on diagnostics.
Radar 8304561.
llvm-svn: 111023
2010-08-13 18:09:39 +00:00
Nick Lewycky
078a5e26fd
Add a new cc1 option -fix-what-you-can which when combined with the fix-it mode
...
will apply all fixes even when there were other errors in the file.
llvm-svn: 111020
2010-08-13 17:31:00 +00:00
Abramo Bagnara
c852cef1f2
Fixed NNS insertion in MemberPointerType.
...
llvm-svn: 111013
2010-08-13 12:56:25 +00:00
John McCall
8823c65abd
Properly give unique-external linkage to members of member templates
...
instantiated with unique-external parameters.
llvm-svn: 111012
2010-08-13 08:35:10 +00:00
John McCall
bd8062dff1
Work around a crash when checking access to injected class names
...
qua templates. The current fix suppresses the access check entirely
in this case; to do better, we'd need to be able to say that a
particular lookup result came from a particular injected class name,
which is not easy to do with the current representation of LookupResult.
This is on my known-problems list.
llvm-svn: 111009
2010-08-13 07:02:08 +00:00
Douglas Gregor
e938668003
Implement clang_saveTranslationUnit(), which saves a translation unit
...
into a PCH/AST file.
llvm-svn: 111006
2010-08-13 05:36:37 +00:00
Daniel Dunbar
568b7500fe
Driver/OptParser: Add a NoForward flag to prevent forwarding certain options to
...
GCC.
- Mark -Xclang and -mlinker-version= with it for now, although I am sure there
are more.
llvm-svn: 111005
2010-08-13 04:44:20 +00:00
Douglas Gregor
6fd55e06d3
Teach ASTUnit to hold on to the Sema object and ASTConsumer that are
...
used when parsing (or re-parsing) a file. Also, when loading a
precompiled header into ASTUnit, create a Sema object that holds onto
semantic-analysis information.
llvm-svn: 111003
2010-08-13 03:15:25 +00:00
John McCall
dcc7140f86
Perform access control when template lookup finds a class template.
...
This is *really* hacky.
llvm-svn: 110997
2010-08-13 02:23:42 +00:00
Eli Friedman
a2622dd266
Zap unused UnaryOperator::OffsetOf.
...
llvm-svn: 110996
2010-08-13 01:36:11 +00:00
Douglas Gregor
e525b4e2d9
The Sema object will get destroyed before all of the others anyway. We don't need to force it
...
llvm-svn: 110993
2010-08-13 00:52:31 +00:00
Sebastian Redl
e7c1fe6ab7
Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.
...
llvm-svn: 110989
2010-08-13 00:28:03 +00:00
Fariborz Jahanian
f7f020bb2a
Make use of __func__ in a block actually refer to
...
block's helper function. Fixes radar 7860965.
llvm-svn: 110988
2010-08-13 00:19:55 +00:00
John McCall
b3732bb3b7
Just disable the hidden-visibility optimization for now by hiding it behind
...
a -cc1 option. The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable. Platforms with less ornery linkers can feel free to enable this.
llvm-svn: 110979
2010-08-12 23:36:15 +00:00
Douglas Gregor
0e93f017e5
Teach CompilerInstance to create and hold on to the Sema object used
...
for parsing, so that it can persist beyond the lifetime of the parsing
call.
llvm-svn: 110978
2010-08-12 23:31:19 +00:00
Tom Care
af9bbad718
Small changes to UnreachableCodeChecker
...
- Added detection of Empty CFGBlocks (artificial blocks)
- Relaxed an assertion based on an incorrect assumption until further investigation
llvm-svn: 110974
2010-08-12 23:01:06 +00:00
Douglas Gregor
5c6f10b54c
Add a ParseAST overload that takes a Sema object, so that the caller
...
can create (and hold on to) the Sema object. Also, move Sema-related
initialization/finalization with its various consumers and external
sources into the Sema constructor and destructor, rather than placing
it in ParseAST.
llvm-svn: 110973
2010-08-12 22:51:45 +00:00
Tom Care
f8a9863df9
Improved IdempotentOperationChecker false positives and false negatives.
...
- Unfinished analysis may still report valid warnings if the path was completely analyzed
- New 'CanVary' heuristic to recursively determine if a subexpression has a varying element
- Updated test cases, including one known bug
- Exposed GRCoreEngine through GRExprEngine
llvm-svn: 110970
2010-08-12 22:45:47 +00:00
Fariborz Jahanian
b5a6246b91
Typo.
...
llvm-svn: 110965
2010-08-12 22:33:42 +00:00
Fariborz Jahanian
68e69ca9f9
Patch to issue warning when colllection expresion's type
...
does not implement 'countByEnumeratingWithState' API.
Implements radar 7634669.
llvm-svn: 110964
2010-08-12 22:25:42 +00:00
John McCall
2b5c1b2516
Implement -Wcast-align. The initial design of this diagnostic diverges
...
from GCC's in that we warn on *any* increase in alignment requirements, not
just those that are enforced by hardware. Please let us know if this causes
major problems for you (which it shouldn't, since it's an optional warning).
llvm-svn: 110959
2010-08-12 21:44:57 +00:00
John McCall
112fd083fa
Fixing the build isn't good enough; back out r110956 and r110953.
...
llvm-svn: 110958
2010-08-12 21:39:05 +00:00
John McCall
0af2b7c93e
dgregor should write code that compiles.
...
llvm-svn: 110956
2010-08-12 21:23:27 +00:00
Douglas Gregor
ad814e224f
Add a ParseAST overload that takes a Sema object, so that the caller
...
can create (and hold on to) the Sema object. Also, move Sema-related
initialization/finalization with its various consumers and external
sources into the Sema constructor and destructor, rather than placing
it in ParseAST.
llvm-svn: 110952
2010-08-12 20:50:39 +00:00
Fariborz Jahanian
753783a062
Fixes block type matching bug. Radar 8302845.
...
llvm-svn: 110950
2010-08-12 20:46:12 +00:00
Douglas Gregor
c3a6ade0bb
Move Sema's headers into include/clang/Sema, renaming a few along the way.
...
llvm-svn: 110945
2010-08-12 20:07:10 +00:00
Anton Yartsev
bfd0f96e79
first test commit
...
llvm-svn: 110941
2010-08-12 18:51:55 +00:00
Douglas Gregor
62157e5342
Downgrade error about nonnull attribute bbeing applied to a function without point arguments to a warning
...
llvm-svn: 110939
2010-08-12 18:48:43 +00:00
Douglas Gregor
02690ba643
Don't emit end-of-file diagnostics like "unterminated conditional" or
...
"unterminated string" when we're performing code completion.
llvm-svn: 110933
2010-08-12 17:04:55 +00:00
Abramo Bagnara
8de74e9c81
Added locations and type source info for DeclarationName inside UsingDecl.
...
llvm-svn: 110912
2010-08-12 11:46:03 +00:00
Jordy Rose
5af0e3cbba
Remove OwnershipAttr::Kind, since it's essentially redundant with attr::Kind the way it's being used. Also fix isa<OwnershipAttr> support, break more-than-80-char lines, and other miscellaneous ownership attr cleanup.
...
llvm-svn: 110908
2010-08-12 08:54:03 +00:00
John McCall
8246e350be
Handle the obvious case for diagnosing redeclarations of extern "C" functions.
...
Fixes PR7859.
llvm-svn: 110906
2010-08-12 07:09:11 +00:00
Jordy Rose
2f7ee3ca40
Actually use reduced set of checkers in EvalAssume.
...
llvm-svn: 110904
2010-08-12 04:05:07 +00:00
Daniel Dunbar
e9e91b0597
Frontend: Move the bulk of the cc1_main() processing into
...
ExecuteCompilerInvocation in libFrontend.
llvm-svn: 110903
2010-08-12 02:53:12 +00:00
John McCall
bdb989eca4
Bail out of MaybeBindToTemporary if the record type is invalid. Test case
...
is 8.5MB, sorry.
llvm-svn: 110901
2010-08-12 02:40:37 +00:00
John McCall
398dc37d1f
Implement RTTI generation for Objective C types. Fixes PR7864.
...
llvm-svn: 110900
2010-08-12 02:17:33 +00:00
John McCall
12d53da8cb
Fix a crash on invalid when declaring an implicit member of a class with an
...
invalid destructor.
llvm-svn: 110891
2010-08-12 00:57:17 +00:00
Daniel Dunbar
628fcf4e3b
Driver: Use the compile time linker version as the default for -mlinker-version,
...
if detected.
- This is a hack, we really want the linker version at execution time, but we
don't have any infrastructure for getting that. Yet.
llvm-svn: 110886
2010-08-12 00:05:12 +00:00
Devang Patel
caa23f0708
Emit debug info for static const class member.
...
llvm-svn: 110885
2010-08-12 00:02:44 +00:00
John McCall
2ded5d25a9
Don't try to implicitly declare special members of an invalid class.
...
Fixes a crash in a rather large and difficult-to-reduce test case.
llvm-svn: 110882
2010-08-11 23:52:36 +00:00
Tom Care
ec389da6f2
Fix a bug where child statements could not be identified as being in a CFGBlock in CFGStmtMap::getBlock.
...
llvm-svn: 110881
2010-08-11 23:36:58 +00:00
Argyrios Kyrtzidis
90bdfbbdf7
Switch on PCH for C++. C++ fans all over the world rejoice.
...
llvm-svn: 110879
2010-08-11 23:27:58 +00:00
Daniel Dunbar
cacb0e2d45
Driver/Darwin: Pass -demangle when linking, if the linker supports it.
...
llvm-svn: 110873
2010-08-11 23:07:50 +00:00
Daniel Dunbar
976a2f54fa
Driver: Add -mlinker-version=, which forwards to -target-linker-version.
...
llvm-svn: 110872
2010-08-11 23:07:47 +00:00
Daniel Dunbar
a1d107cb46
Frontend: Add -target-linker-version, for specifying the version string of the
...
linker in use.
llvm-svn: 110871
2010-08-11 23:07:42 +00:00