]> granicus.if.org Git - clang/log
clang
14 years agoCall llvm::remove_fatal_error_handler before deallocating objects
Dan Gohman [Wed, 18 Aug 2010 21:23:17 +0000 (21:23 +0000)]
Call llvm::remove_fatal_error_handler before deallocating objects
which are used by the error handling functions.

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

14 years agoAdded psuedo-constant analysis and integrated it into the false positive reduction...
Tom Care [Wed, 18 Aug 2010 21:17:24 +0000 (21:17 +0000)]
Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified

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

14 years agoContextual arity is a feature of mangling expressions; kill off
John McCall [Wed, 18 Aug 2010 19:18:59 +0000 (19:18 +0000)]
Contextual arity is a feature of mangling expressions;  kill off
mangleCallExpression.  Also, operator names with unknown arity should
be mangled as binary operators;  this is actually covered by an oddly-
positioned sentence in the ABI document.  Fixes PR7891.

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

14 years agolibclang: Put clang_parseTranslationUnit inside a crash recovery context.
Daniel Dunbar [Wed, 18 Aug 2010 18:43:17 +0000 (18:43 +0000)]
libclang: Put clang_parseTranslationUnit inside a crash recovery context.

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

14 years agolibclang: Implicitly enable crash recovery when using the libclang APIs. We may need...
Daniel Dunbar [Wed, 18 Aug 2010 18:43:14 +0000 (18:43 +0000)]
libclang: Implicitly enable crash recovery when using the libclang APIs. We may need to add an explicit API call, but hopefully we can make the crash recovery seamless enough that it doesn't make sense to turn it off.

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

14 years agozap dead code.
Chris Lattner [Wed, 18 Aug 2010 16:09:06 +0000 (16:09 +0000)]
zap dead code.

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

14 years agono need to pass bumppointer allocator into macroinfo::destroy
Chris Lattner [Wed, 18 Aug 2010 16:08:51 +0000 (16:08 +0000)]
no need to pass bumppointer allocator into macroinfo::destroy

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

14 years agoMake sure to add MallocAttr to explicitly-declared operator new/new[]
Douglas Gregor [Wed, 18 Aug 2010 15:06:25 +0000 (15:06 +0000)]
Make sure to add MallocAttr to explicitly-declared operator new/new[]
when -fassume-sane-operator-new. Patch by Tom Jablin!

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

14 years agoSimplify FixItHint by eliminated the unnecessary InsertionLoc
Douglas Gregor [Wed, 18 Aug 2010 14:24:02 +0000 (14:24 +0000)]
Simplify FixItHint by eliminated the unnecessary InsertionLoc
location. Patch by Eelis van der Weegen!

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

14 years agoFlesh out the test cases a little.
John McCall [Wed, 18 Aug 2010 09:58:15 +0000 (09:58 +0000)]
Flesh out the test cases a little.

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

14 years agoRip out the existing retroactive abstract-class usage checker,
John McCall [Wed, 18 Aug 2010 09:41:07 +0000 (09:41 +0000)]
Rip out the existing retroactive abstract-class usage checker,
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class.  Also, look into templates when doing this.

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

14 years agoRemove -Wunused-member-function from the 'Extra' diagnostic group too; llvm uses it.
Argyrios Kyrtzidis [Wed, 18 Aug 2010 08:32:33 +0000 (08:32 +0000)]
Remove -Wunused-member-function from the 'Extra' diagnostic group too; llvm uses it.

This effectively disables -Wunused-member-function for building llvm/clang.

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

14 years agoCheck whether errors should be included in the diagnostic counts. Previously,
Chandler Carruth [Wed, 18 Aug 2010 06:46:41 +0000 (06:46 +0000)]
Check whether errors should be included in the diagnostic counts. Previously,
only warnings did this check.

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

14 years agoRemove dead malloc symbols from the symbol-state map.
Jordy Rose [Wed, 18 Aug 2010 04:33:47 +0000 (04:33 +0000)]
Remove dead malloc symbols from the symbol-state map.

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

14 years agoUse RegionStateTy everywhere we mean ImmutableMap<SymbolRef, RefState>
Jordy Rose [Wed, 18 Aug 2010 04:26:59 +0000 (04:26 +0000)]
Use RegionStateTy everywhere we mean ImmutableMap<SymbolRef, RefState>

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

14 years agozap dead code.
Chris Lattner [Wed, 18 Aug 2010 02:45:56 +0000 (02:45 +0000)]
zap dead code.

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

14 years agozap a big dead method.
Chris Lattner [Wed, 18 Aug 2010 02:44:19 +0000 (02:44 +0000)]
zap a big dead method.

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

14 years agoEmit an error if an array is too large. We're slightly more strict
Douglas Gregor [Wed, 18 Aug 2010 00:39:00 +0000 (00:39 +0000)]
Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.

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

14 years agofix typo
Chris Lattner [Wed, 18 Aug 2010 00:13:52 +0000 (00:13 +0000)]
fix typo

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

14 years agoFix PR7889 by generalizing some over specialized code. There is no
Chris Lattner [Wed, 18 Aug 2010 00:08:27 +0000 (00:08 +0000)]
Fix PR7889 by generalizing some over specialized code.  There is no
reason that this should be limited to simple lvalues.

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

14 years agofix PR7892, a crash on valid in c++ codegen of __PRETTY_FUNCTION__
Chris Lattner [Tue, 17 Aug 2010 23:58:10 +0000 (23:58 +0000)]
fix PR7892, a crash on valid in c++ codegen of __PRETTY_FUNCTION__

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

14 years agoTypedRegion::isBoundable() should return true by default. Since there is no TypedVie...
Ted Kremenek [Tue, 17 Aug 2010 23:51:30 +0000 (23:51 +0000)]
TypedRegion::isBoundable() should return true by default.  Since there is no TypedViewRegion anyore, it is not possible that the subclass (which doesn't override isBoundable) could return a null value type.

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

14 years agoGet rid of extra nesting when checking for invalid type,
Fariborz Jahanian [Tue, 17 Aug 2010 23:50:37 +0000 (23:50 +0000)]
Get rid of extra nesting when checking for invalid type,
per Doug's comment.

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

14 years agoRewrite code fragment to avoide ICE in MSVC. Fixes PR 7875. Patch by Dimitry Andric!
Ted Kremenek [Tue, 17 Aug 2010 23:29:06 +0000 (23:29 +0000)]
Rewrite code fragment to avoide ICE in MSVC.  Fixes PR 7875.  Patch by Dimitry Andric!

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

14 years agoDiagnose if type of iboutletcollection attribute is a builtin type.
Fariborz Jahanian [Tue, 17 Aug 2010 23:19:16 +0000 (23:19 +0000)]
Diagnose if type of iboutletcollection attribute is a builtin type.

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

14 years agoGet rid of pretty non-ASCII quotes.
Sebastian Redl [Tue, 17 Aug 2010 22:42:34 +0000 (22:42 +0000)]
Get rid of pretty non-ASCII quotes.

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

14 years agoStringRef'ication of lots stuff, patch by Peter Davies!
Daniel Dunbar [Tue, 17 Aug 2010 22:39:59 +0000 (22:39 +0000)]
StringRef'ication of lots stuff, patch by Peter Davies!

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

14 years agoLex: Add #pragma clang __debug {llvm_fatal_error, llvm_unreachable}, for testing
Daniel Dunbar [Tue, 17 Aug 2010 22:32:48 +0000 (22:32 +0000)]
Lex: Add #pragma clang __debug {llvm_fatal_error, llvm_unreachable}, for testing
those crash paths.

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

14 years agoDriver: Claim the -mlinker-version synthesized argument, it shouldn't be
Daniel Dunbar [Tue, 17 Aug 2010 22:32:45 +0000 (22:32 +0000)]
Driver: Claim the -mlinker-version synthesized argument, it shouldn't be
reported as unused.

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

14 years agoRename -Wunused-method -> -Wunused-member-function.
Argyrios Kyrtzidis [Tue, 17 Aug 2010 22:06:44 +0000 (22:06 +0000)]
Rename -Wunused-method -> -Wunused-member-function.

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

14 years agoRemove dead code.
Ted Kremenek [Tue, 17 Aug 2010 22:05:33 +0000 (22:05 +0000)]
Remove dead code.

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

14 years agoWhoops. Don't fall through into the overload case when mangling a
John McCall [Tue, 17 Aug 2010 21:51:21 +0000 (21:51 +0000)]
Whoops.  Don't fall through into the overload case when mangling a
dependent call expression.

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

14 years agoIntroduce -Wunused-method option for warning on unused class methods in anonymous...
Argyrios Kyrtzidis [Tue, 17 Aug 2010 21:43:11 +0000 (21:43 +0000)]
Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.

This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.

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

14 years agoDiagnose use of iboutletcollection on ivar/property
Fariborz Jahanian [Tue, 17 Aug 2010 21:39:27 +0000 (21:39 +0000)]
Diagnose use of iboutletcollection on ivar/property
of non-object types. Radar 8308053.

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

14 years agoImplicit decl ref expressions might not have name locations; don't silently
John McCall [Tue, 17 Aug 2010 21:27:17 +0000 (21:27 +0000)]
Implicit decl ref expressions might not have name locations;  don't silently
fail to instantiate them.

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

14 years agoFix CMake build
Sebastian Redl [Tue, 17 Aug 2010 21:00:23 +0000 (21:00 +0000)]
Fix CMake build

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

14 years agoFix horrible CFG bug caused by a series of NullStmts appearing at the beginning of...
Ted Kremenek [Tue, 17 Aug 2010 21:00:06 +0000 (21:00 +0000)]
Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop.  This would cause
the body of the DoStmt to be disconnected from the preceding code.

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

14 years agoCFGBuilder: don't create the empty "loop back" block for DoStmts if the loop edge...
Ted Kremenek [Tue, 17 Aug 2010 20:59:56 +0000 (20:59 +0000)]
CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop edge can never be taken.

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

14 years agoReintroduce the serialization library, with fixed dependencies.
Sebastian Redl [Tue, 17 Aug 2010 20:43:28 +0000 (20:43 +0000)]
Reintroduce the serialization library, with fixed dependencies.

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

14 years agoPatch to add type parameter support for attribute iboutletcollection.
Fariborz Jahanian [Tue, 17 Aug 2010 20:23:12 +0000 (20:23 +0000)]
Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.

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

14 years agoRemove the last bit of the Clang Serialization library, for now
Douglas Gregor [Tue, 17 Aug 2010 19:00:27 +0000 (19:00 +0000)]
Remove the last bit of the Clang Serialization library, for now

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

14 years agoRevert Sebastian's build-breaking patch.
Douglas Gregor [Tue, 17 Aug 2010 18:31:01 +0000 (18:31 +0000)]
Revert Sebastian's build-breaking patch.

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

14 years agoAdd the clangSerialization library to libclang.
Dan Gohman [Tue, 17 Aug 2010 18:07:30 +0000 (18:07 +0000)]
Add the clangSerialization library to libclang.

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

14 years agoCreate a new Serialization module that contains all the PCH code, and will contain...
Sebastian Redl [Tue, 17 Aug 2010 17:55:49 +0000 (17:55 +0000)]
Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.

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

14 years agoFix a typo in a diag name.
Sebastian Redl [Tue, 17 Aug 2010 17:55:38 +0000 (17:55 +0000)]
Fix a typo in a diag name.

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

14 years agoRemove a gratuitous lie.
Daniel Dunbar [Tue, 17 Aug 2010 17:34:48 +0000 (17:34 +0000)]
Remove a gratuitous lie.

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

14 years agoA member function never has "C" linkage. Fixes <rdar://problem/8318976>.
Douglas Gregor [Tue, 17 Aug 2010 16:09:23 +0000 (16:09 +0000)]
A member function never has "C" linkage. Fixes <rdar://problem/8318976>.

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

14 years agoWhen generating code completion patterns for method declarations, give
Douglas Gregor [Tue, 17 Aug 2010 16:06:07 +0000 (16:06 +0000)]
When generating code completion patterns for method declarations, give
the resulting pattern the appropriate cursor kind of an instance or
class method declaration.

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

14 years agoapparently msvc defines _STDCALL_SUPPORTED, so we should
Chris Lattner [Tue, 17 Aug 2010 16:02:32 +0000 (16:02 +0000)]
apparently msvc defines _STDCALL_SUPPORTED, so we should
too.  Patch by Per Linden!

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

14 years agoAdd a slightly better hack for microsoft style inline asm,
Chris Lattner [Tue, 17 Aug 2010 16:00:12 +0000 (16:00 +0000)]
Add a slightly better hack for microsoft style inline asm,
patch by Per Linden!

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

14 years agoImplement #pragma push_macro, patch by Francois Pichet!
Chris Lattner [Tue, 17 Aug 2010 15:55:45 +0000 (15:55 +0000)]
Implement #pragma push_macro, patch by Francois Pichet!

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

14 years ago1 != I. Fix the formulation of code-completion patterns for
Douglas Gregor [Tue, 17 Aug 2010 15:53:35 +0000 (15:53 +0000)]
1 != I. Fix the formulation of code-completion patterns for
Objective-C method declarations with > 2 parameters.

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

14 years agoConvert all uses of StringLiteral::getStrData() to StringLiteral::getString()
Benjamin Kramer [Tue, 17 Aug 2010 12:54:38 +0000 (12:54 +0000)]
Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData().  Patch by Peter Davies (with some tweaks).

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

14 years agoDon't try to initialize a reference with a constructed temporary if either
John McCall [Tue, 17 Aug 2010 07:23:57 +0000 (07:23 +0000)]
Don't try to initialize a reference with a constructed temporary if either
of the classes is invalid.  A class is invalid if a base is invalid.

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

14 years agoWhen the # of top-level declarations changes after reparsing a
Douglas Gregor [Tue, 17 Aug 2010 00:40:40 +0000 (00:40 +0000)]
When the # of top-level declarations changes after reparsing a
translation unit, refresh code-completion results because they've
probably changed. However, enforce a cooldown period between
refreshes, to avoid thrashing.

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

14 years agoGenerate a node instead of a sink. A leak is not a fatal error.
Zhongxing Xu [Tue, 17 Aug 2010 00:36:37 +0000 (00:36 +0000)]
Generate a node instead of a sink. A leak is not a fatal error.

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

14 years agoA field of incomplete type is sufficiently disruptive that we should mark
John McCall [Mon, 16 Aug 2010 23:42:35 +0000 (23:42 +0000)]
A field of incomplete type is sufficiently disruptive that we should mark
the record invalid.

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

14 years agoMove a bunch of code out of the ComplexExprEvaluator class definition;
Eli Friedman [Mon, 16 Aug 2010 23:27:44 +0000 (23:27 +0000)]
Move a bunch of code out of the ComplexExprEvaluator class definition;
no functionality change.

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

14 years agoAllow the "size" of a buffer access check to be either signed or unsigned. Fixes...
Jordy Rose [Mon, 16 Aug 2010 23:25:19 +0000 (23:25 +0000)]
Allow the "size" of a buffer access check to be either signed or unsigned. Fixes PR7925.

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

14 years agoMove include to the proper place. No functionality change
Douglas Gregor [Mon, 16 Aug 2010 23:08:34 +0000 (23:08 +0000)]
Move include to the proper place. No functionality change

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

14 years agoImplement support for cached code completions for
Douglas Gregor [Mon, 16 Aug 2010 23:05:20 +0000 (23:05 +0000)]
Implement support for cached code completions for
nested-name-specifiers. Also includes fixes to the generation of
nested-name-specifier result in the non-cached case; we were producing
lame results for namespaces and namespace aliases, which (1) didn't
always have nested-name-specifiers when we want them, and (2) did not
have the necessary "::" as part of the completion.

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

14 years agoDiagnose assiging to an interface object in
Fariborz Jahanian [Mon, 16 Aug 2010 21:51:12 +0000 (21:51 +0000)]
Diagnose assiging to an interface object in
non-fragile abi mode as sizes are not statically known.
Fixes radar 8315734.

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

14 years agoAdded basic psuedoconstant checking in IdempotentOperationChecker and fixed some...
Tom Care [Mon, 16 Aug 2010 21:43:52 +0000 (21:43 +0000)]
Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.

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

14 years agoFormatting fixes. No functionality change
Douglas Gregor [Mon, 16 Aug 2010 21:23:13 +0000 (21:23 +0000)]
Formatting fixes. No functionality change

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

14 years agoImplement name hiding of cached global code-completion results.
Douglas Gregor [Mon, 16 Aug 2010 21:18:39 +0000 (21:18 +0000)]
Implement name hiding of cached global code-completion results.

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

14 years agoInstead of using operator bool() for testing if a BindingKey is valid, use an explici...
Jordy Rose [Mon, 16 Aug 2010 20:53:01 +0000 (20:53 +0000)]
Instead of using operator bool() for testing if a BindingKey is valid, use an explicit isValid() method.

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

14 years agoMove GRState::AssumeInBound out of its header file -- it's not really inline-friendly...
Jordy Rose [Mon, 16 Aug 2010 20:34:06 +0000 (20:34 +0000)]
Move GRState::AssumeInBound out of its header file -- it's not really inline-friendly anymore.

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

14 years agoMove some code out-of-line which has long since grown too large to be
Douglas Gregor [Mon, 16 Aug 2010 20:01:48 +0000 (20:01 +0000)]
Move some code out-of-line which has long since grown too large to be
inlined. No functionality change.

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

14 years agoAdd two options for playing with modules.
Sebastian Redl [Mon, 16 Aug 2010 18:17:11 +0000 (18:17 +0000)]
Add two options for playing with modules.

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

14 years agoWhen caching code completions for global declarations, keep track of
Douglas Gregor [Mon, 16 Aug 2010 18:08:11 +0000 (18:08 +0000)]
When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.

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

14 years agoFix a crash when parsing malformed out-of-line member function
Fariborz Jahanian [Mon, 16 Aug 2010 17:58:53 +0000 (17:58 +0000)]
Fix a crash when parsing malformed out-of-line member function
definition. radar 8307865.

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

14 years agoFix initialization for members of anonymous struct in a union.
Argyrios Kyrtzidis [Mon, 16 Aug 2010 17:27:13 +0000 (17:27 +0000)]
Fix initialization for members of anonymous struct in a union.

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

14 years agoEmit diagnostic error when the field of an anonymous struct is non trivial.
Argyrios Kyrtzidis [Mon, 16 Aug 2010 17:27:08 +0000 (17:27 +0000)]
Emit diagnostic error when the field of an anonymous struct is non trivial.

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

14 years agoDereferencing NULL pointers is such poor form.
Douglas Gregor [Mon, 16 Aug 2010 16:46:30 +0000 (16:46 +0000)]
Dereferencing NULL pointers is such poor form.

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

14 years agosupport for vec_add, vec_adds, vec_and, vec_andc with bool arguments
Anton Yartsev [Mon, 16 Aug 2010 16:22:12 +0000 (16:22 +0000)]
support for vec_add, vec_adds, vec_and, vec_andc with bool arguments

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

14 years agoWhen caching global completion results, keep track of the simplified
Douglas Gregor [Mon, 16 Aug 2010 16:18:59 +0000 (16:18 +0000)]
When caching global completion results, keep track of the simplified
type class, so that we can adjust priorities appropriately when the
preferred type for the context and the actual type of the completion
are similar.

This gets us one step closer to parity of the cached completion
results with the non-cached completion results.

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

14 years agoFixed typo in conj, conjf, conjl signature.
Abramo Bagnara [Mon, 16 Aug 2010 15:57:05 +0000 (15:57 +0000)]
Fixed typo in conj, conjf, conjl signature.

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

14 years agoModel the effects of strcpy() and stpcpy() in CStringChecker. Other changes:
Jordy Rose [Mon, 16 Aug 2010 07:51:42 +0000 (07:51 +0000)]
Model the effects of strcpy() and stpcpy() in CStringChecker. Other changes:
- Fix memcpy() and friends to actually invalidate the destination buffer.
- Emit a different message for out-of-bounds buffer accesses if the buffer is being written to.
- When conjuring symbols, let ValueManager figure out the type.

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

14 years agoError out if reinterpret_casting between member pointers of two different
Charles Davis [Mon, 16 Aug 2010 05:30:44 +0000 (05:30 +0000)]
Error out if reinterpret_casting between member pointers of two different
sizes.

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

14 years agoErr on incomplete class types in member pointers when compiling for the
Charles Davis [Mon, 16 Aug 2010 04:01:50 +0000 (04:01 +0000)]
Err on incomplete class types in member pointers when compiling for the
Microsoft C++ ABI, for now.

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

14 years agoImplement support for member pointers under the Microsoft C++ ABI in the
Charles Davis [Mon, 16 Aug 2010 03:33:14 +0000 (03:33 +0000)]
Implement support for member pointers under the Microsoft C++ ABI in the
AST library.

This also adds infrastructure for supporting multiple C++ ABIs in the AST.

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

14 years ago- Allow making ElementRegions with complex offsets (expressions or symbols) for the...
Jordy Rose [Mon, 16 Aug 2010 01:15:17 +0000 (01:15 +0000)]
- Allow making ElementRegions with complex offsets (expressions or symbols) for the purpose of bounds-checking.
- Rewrite GRState::AssumeInBound to actually do that checking, and to use the normal constraint path.
- Remove ConstraintManager::AssumeInBound.
- Teach RegionStore and FlatStore to ignore those regions for now.

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

14 years agoPass some things to the linker that gcc passes. -r is the only one of these that...
David Chisnall [Sun, 15 Aug 2010 22:58:12 +0000 (22:58 +0000)]
Pass some things to the linker that gcc passes.  -r is the only one of these that I'm sure about, but the others seem to be listed on FreeBSD by gcc -dumpspecs, so I hope they're right.  Apparently -r is also not passed on GNU/Linux (and should be), but I can't see where the toolchain definition for this platform live.

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

14 years agoMove GRState's bind* methods out of its header file -- they're too big for inlining...
Jordy Rose [Sun, 15 Aug 2010 22:19:33 +0000 (22:19 +0000)]
Move GRState's bind* methods out of its header file -- they're too big for inlining now.

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

14 years agoCall the base class in StmtProfiler::VisitOverloadExpr.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 20:53:20 +0000 (20:53 +0000)]
Call the base class in StmtProfiler::VisitOverloadExpr.

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

14 years agoOpen AST/PCH files in binary mode.
Benjamin Kramer [Sun, 15 Aug 2010 16:54:31 +0000 (16:54 +0000)]
Open AST/PCH files in binary mode.

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

14 years agoMake the FixItOptions object required instead of optional.
Nick Lewycky [Sun, 15 Aug 2010 16:47:39 +0000 (16:47 +0000)]
Make the FixItOptions object required instead of optional.

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

14 years agoStoreManager::RemoveDeadBindings() can take a Store instead of an entire GRState...
Zhongxing Xu [Sun, 15 Aug 2010 12:45:09 +0000 (12:45 +0000)]
StoreManager::RemoveDeadBindings() can take a Store instead of an entire GRState now.

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

14 years agoRemove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 10:17:39 +0000 (10:17 +0000)]
Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.

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

14 years agoDon't warn for the common pattern of disallowing copying:
Argyrios Kyrtzidis [Sun, 15 Aug 2010 10:17:33 +0000 (10:17 +0000)]
Don't warn for the common pattern of disallowing copying:

class S {
  S(const S&); // DO NOT IMPLEMENT
  void operator=(const S&); // DO NOT IMPLEMENT
};

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

14 years agoRemove redundant method.
Zhongxing Xu [Sun, 15 Aug 2010 10:08:38 +0000 (10:08 +0000)]
Remove redundant method.

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

14 years agoImplement MallocChecker::EvalDeadSymbols() with the new API. This time we
Zhongxing Xu [Sun, 15 Aug 2010 08:19:57 +0000 (08:19 +0000)]
Implement MallocChecker::EvalDeadSymbols() with the new API. This time we
iterate over symbols being tracked, instead of symbols being dead.

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

14 years agoExtend the code-completion caching infrastructure to include global
Douglas Gregor [Sun, 15 Aug 2010 06:18:01 +0000 (06:18 +0000)]
Extend the code-completion caching infrastructure to include global
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters.

There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.

Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.

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

14 years agoUse Enumerators.data() instead of &Enumerators[0] to fix a potential
Eli Friedman [Sun, 15 Aug 2010 02:27:09 +0000 (02:27 +0000)]
Use Enumerators.data() instead of &Enumerators[0] to fix a potential
assertion failure.

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

14 years agoRemove dead code, caught by unused function warnings.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 01:15:58 +0000 (01:15 +0000)]
Remove dead code, caught by unused function warnings.

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

14 years agoDependentTypeOfExprType and DependentDecltypeType are not seen by client code.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 01:15:44 +0000 (01:15 +0000)]
DependentTypeOfExprType and DependentDecltypeType are not seen by client code.

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

14 years agoCall the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 01:15:38 +0000 (01:15 +0000)]
Call the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.

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

14 years agoSome refactoring on StmtPrinter to avoid unused function warnings.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 01:15:33 +0000 (01:15 +0000)]
Some refactoring on StmtPrinter to avoid unused function warnings.

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

14 years agoAdd ATTRIBUTE_UNUSED to methods not supposed to be used.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 01:15:27 +0000 (01:15 +0000)]
Add ATTRIBUTE_UNUSED to methods not supposed to be used.

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

14 years agoCommit improved version of 111026 & 111027.
Argyrios Kyrtzidis [Sun, 15 Aug 2010 01:15:20 +0000 (01:15 +0000)]
Commit improved version of 111026 & 111027.

Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

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