]> granicus.if.org Git - clang/log
clang
14 years agosimplify Get8ByteTypeAtOffset by making it a member of X86_64ABIInfo
Chris Lattner [Thu, 29 Jul 2010 02:20:19 +0000 (02:20 +0000)]
simplify Get8ByteTypeAtOffset by making it a member of X86_64ABIInfo

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

14 years agonow that ABIInfo depends on CGT, it has trivial access to such
Chris Lattner [Thu, 29 Jul 2010 02:16:43 +0000 (02:16 +0000)]
now that ABIInfo depends on CGT, it has trivial access to such
things as TargetData, ASTContext, LLVMContext etc.  Stop passing
them through so many APIs.

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

14 years agocave in to reality and make ABIInfo depend on CodeGenTypes.
Chris Lattner [Thu, 29 Jul 2010 02:01:43 +0000 (02:01 +0000)]
cave in to reality and make ABIInfo depend on CodeGenTypes.

This will simplify a bunch of code, coming up next.

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

14 years agoTeach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, and Charac...
Ted Kremenek [Thu, 29 Jul 2010 01:31:59 +0000 (01:31 +0000)]
Teach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, and CharacterLiteral.  Fixes an assertion failure reported in PR 7675.

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

14 years agoCheck for an invalid SourceLocation in clang_getCursor(). This avoids a possible...
Ted Kremenek [Thu, 29 Jul 2010 00:52:07 +0000 (00:52 +0000)]
Check for an invalid SourceLocation in clang_getCursor().  This avoids a possible assertion failure in SourceManager in the call to Lexer::GetBeginningOfToken().  Fixes <rdar://problem/8244873>.

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

14 years agoAugment RegionStore::BindStruct() to bind symbolicated struct values. This fixes...
Ted Kremenek [Thu, 29 Jul 2010 00:28:47 +0000 (00:28 +0000)]
Augment RegionStore::BindStruct() to bind symbolicated struct values.  This fixes a false path issue reported in <rdar://problem/8243408> and also spurs another cause where the idempotent operations checker fires.

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

14 years agoChange SymbolManager::canSymbolicate() to return true for RecordTypes.
Ted Kremenek [Thu, 29 Jul 2010 00:28:43 +0000 (00:28 +0000)]
Change SymbolManager::canSymbolicate() to return true for RecordTypes.

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

14 years agoExplicitly guard in BasicStore from storing to non-scalars.
Ted Kremenek [Thu, 29 Jul 2010 00:28:40 +0000 (00:28 +0000)]
Explicitly guard in BasicStore from storing to non-scalars.

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

14 years agoRemove extraneous guards around the call to getConjuredSymbolVal(). These checks...
Ted Kremenek [Thu, 29 Jul 2010 00:28:33 +0000 (00:28 +0000)]
Remove extraneous guards around the call to getConjuredSymbolVal().  These checks are already done within getConjuredSymbolVal() itself.

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

14 years agoVisit the children of CXXOperatorCallExprs in source order within
Douglas Gregor [Thu, 29 Jul 2010 00:26:18 +0000 (00:26 +0000)]
Visit the children of CXXOperatorCallExprs in source order within
libclang, so that clang_annotateTokens() doesn't get confused and miss
annotations.

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

14 years agoDon't set out-of-line template specialization/definition information
Douglas Gregor [Wed, 28 Jul 2010 23:59:57 +0000 (23:59 +0000)]
Don't set out-of-line template specialization/definition information
for AST nodes that aren't actually out-of-line (i.e., require a
nested-name-specifier). Fixes <rdar://problem/8204126>.

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

14 years agopass argument vectors in a type that corresponds to the user type if
Chris Lattner [Wed, 28 Jul 2010 23:47:21 +0000 (23:47 +0000)]
pass argument vectors in a type that corresponds to the user type if
possible.  This improves the example to pass <4 x float> instead of
<2 x double> but we still get awful code, and still don't get the
return value right.

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

14 years agotidy up
Chris Lattner [Wed, 28 Jul 2010 23:46:15 +0000 (23:46 +0000)]
tidy up

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

14 years agoInitialize block's imported variable(s) in
Fariborz Jahanian [Wed, 28 Jul 2010 23:27:30 +0000 (23:27 +0000)]
Initialize block's imported variable(s) in
block's synthesized constructor initalizer list.
Fixes radar 8240371.

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

14 years agoPR7736: Make sure to mark &Class::Member correctly as being type-dependent
Eli Friedman [Wed, 28 Jul 2010 23:26:18 +0000 (23:26 +0000)]
PR7736: Make sure to mark &Class::Member correctly as being type-dependent
inside a template class.

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

14 years agoOverride selected builtin names (e.g. "long int" instead of "long") to match names...
Devang Patel [Wed, 28 Jul 2010 23:23:29 +0000 (23:23 +0000)]
Override selected builtin names (e.g. "long int" instead of "long") to match names used by gcc in debug info. This makes gdb testsuite happy.

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

14 years agofix some break statements to be formatted more consistently,
Chris Lattner [Wed, 28 Jul 2010 23:12:33 +0000 (23:12 +0000)]
fix some break statements to be formatted more consistently,
remove some now-dead code.

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

14 years agouse Get8ByteTypeAtOffset for the return value path as well so we
Chris Lattner [Wed, 28 Jul 2010 23:06:14 +0000 (23:06 +0000)]
use Get8ByteTypeAtOffset for the return value path as well so we
don't get errors similar to PR7714 on the return path.

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

14 years agorefactor the autosizing code, eliminating duplication
Chris Lattner [Wed, 28 Jul 2010 22:44:07 +0000 (22:44 +0000)]
refactor the autosizing code, eliminating duplication
and making Get8ByteTypeAtOffset always succeed and documented.

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

14 years agoDon't die when a member access refers to a non-class member via a
Douglas Gregor [Wed, 28 Jul 2010 22:27:52 +0000 (22:27 +0000)]
Don't die when a member access refers to a non-class member via a
qualified name. Fixes <rdar://problem/8231724>.

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

14 years agofix PR7714 by not referencing off the end of a struct when passed by value in
Chris Lattner [Wed, 28 Jul 2010 22:15:08 +0000 (22:15 +0000)]
fix PR7714 by not referencing off the end of a struct when passed by value in
x86-64 abi.  This also improves codegen as well.  Some refactoring is needed of
this code.

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

14 years agoTurn off precompiled preamble support for C++
Douglas Gregor [Wed, 28 Jul 2010 22:12:37 +0000 (22:12 +0000)]
Turn off precompiled preamble support for C++

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

14 years agoWhen performing code completion for a case statement in a switch whose
Douglas Gregor [Wed, 28 Jul 2010 21:50:18 +0000 (21:50 +0000)]
When performing code completion for a case statement in a switch whose
condition is not of enumeration type, provide code-completion results
containing all values of integral or enumeral type.

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

14 years agoSupport extended vector types in chained PCH.
Sebastian Redl [Wed, 28 Jul 2010 21:38:49 +0000 (21:38 +0000)]
Support extended vector types in chained PCH.

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

14 years agoAdd a test case for tentative definitions in chained PCH. Fix a bug that completely...
Sebastian Redl [Wed, 28 Jul 2010 21:07:02 +0000 (21:07 +0000)]
Add a test case for tentative definitions in chained PCH. Fix a bug that completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files.

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

14 years agoFix flags in global block descriptor when
Fariborz Jahanian [Wed, 28 Jul 2010 19:07:18 +0000 (19:07 +0000)]
Fix flags in global block descriptor when
block returns structs. Fies radar 8241648.
Executable test added to llvm test suite.

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

14 years agoMake the pointer arguments to the __sync_* builtins pointers to
Douglas Gregor [Wed, 28 Jul 2010 18:42:27 +0000 (18:42 +0000)]
Make the pointer arguments to the __sync_* builtins pointers to
volatile-qualified types. Fixes <rdar://problem/8228293>.

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

14 years agosome cleanups and get alignments correct for various coerce cases.
Chris Lattner [Wed, 28 Jul 2010 18:24:28 +0000 (18:24 +0000)]
some cleanups and get alignments correct for various coerce cases.

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

14 years agoThe grammar for GNU typeof in C requires an expression to be
Douglas Gregor [Wed, 28 Jul 2010 18:22:12 +0000 (18:22 +0000)]
The grammar for GNU typeof in C requires an expression to be
parenthesized, unlike in C++, e.g.,

  C has: typeof ( expression)
  C++ has: typeof unary-expression

So, once we've parsed a parenthesized expression after typeof, we
should only go on to parse the postfix expression suffix if we're in
C++. Fixes <rdar://problem/8237491>.

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

14 years agoTest commit
Tanya Lattner [Wed, 28 Jul 2010 18:19:43 +0000 (18:19 +0000)]
Test commit

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

14 years agoTest commit.
Tanya Lattner [Wed, 28 Jul 2010 18:08:38 +0000 (18:08 +0000)]
Test commit.

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

14 years agoUpdate checker build.
Ted Kremenek [Wed, 28 Jul 2010 17:44:21 +0000 (17:44 +0000)]
Update checker build.

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

14 years agoaccept and ignore a few more gcc warnings.
Chris Lattner [Wed, 28 Jul 2010 16:27:11 +0000 (16:27 +0000)]
accept and ignore a few more gcc warnings.

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

14 years ago Add proper callbacks for DeclStmt -- we weren't recursing on
Craig Silverstein [Wed, 28 Jul 2010 15:54:33 +0000 (15:54 +0000)]
    Add proper callbacks for DeclStmt -- we weren't recursing on
        the decls.  This was just an oversight before; one we didn't
        catch because lots of information in a DeclStmt was also being
        traversed (redundantly) elsewhere.

        Once DeclStmt was cleaned up, I could clean up some of the
        redundant traversals found elswhere as well -- in particular,
        traversing the declarations inside a function as part of the
        function callback (instead of as part of the CompoundExpr
        callback that constitutes the body of the function).  The old
        way was really weird, and led to some parts of local variable
        declarations (but not all) being visited twice.  That is now
        resolved.  I also was able to simplify the traversers for
        IfStmt/WhileStmt/etc, which used to have redundant calls to
        work around the fact DeclStmt wasn't working properly.

        While in the area, I fixed up a few more recursion-ordering
        issues.  I try to hold to the principle that
        RecursiveASTVisitor visits objects in the source code in the
        same order they're typed.  So the return-type of a variable
        comes before the variable-name.  This still isn't perfect, but
        we're closer to that.

Reviewed by chandlerc and wan.

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

14 years agoRename -Wlogical-bitwise-confusion to -Wconstant-logical-operand, which strikes
Daniel Dunbar [Wed, 28 Jul 2010 15:40:39 +0000 (15:40 +0000)]
Rename -Wlogical-bitwise-confusion to -Wconstant-logical-operand, which strikes
me as more consistent and less pejorative.

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

14 years agoPreprocessor: Add support for '#pragma clang __debug crash' and '#pragma clang
Daniel Dunbar [Wed, 28 Jul 2010 15:40:33 +0000 (15:40 +0000)]
Preprocessor: Add support for '#pragma clang __debug crash' and '#pragma clang
__debug overflow_stack'.
 - For testing crash reporting stuff... you'd think I could just use some C++
   code but Doug keeps fixing stuff!

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

14 years agoEnable expression transformations in the current-instantiation
Douglas Gregor [Wed, 28 Jul 2010 15:14:14 +0000 (15:14 +0000)]
Enable expression transformations in the current-instantiation
rebuilder, i.e., remove a silly short-sighted hack from long
ago. Thanks to Abramo Bagnara for the test case/bug report!

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

14 years agoWhen a nested-name-specifier refers into a current instantiation that has
Douglas Gregor [Wed, 28 Jul 2010 14:49:07 +0000 (14:49 +0000)]
When a nested-name-specifier refers into a current instantiation that has
dependent bases, construct a dependent nested-name-specifier rather
than complaining that the name could not be found within the current
instantiation itself. Fixes PR7725.

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

14 years agowe are not supposed to create an improper callsite using a CallInstr; leave a fixme...
Gabor Greif [Wed, 28 Jul 2010 09:19:33 +0000 (09:19 +0000)]
we are not supposed to create an improper callsite using a CallInstr; leave a fixme mentioning the simplification when CallSite can clone itself

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

14 years agoconstruct debug info for "id" by hand.
Devang Patel [Wed, 28 Jul 2010 01:33:15 +0000 (01:33 +0000)]
construct debug info for "id" by hand.
Tested by mi1-var-obj.exp in gdb testsuite.

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

14 years agoWhen creating a jump destination, its scope should be the scope of the
John McCall [Wed, 28 Jul 2010 01:07:35 +0000 (01:07 +0000)]
When creating a jump destination, its scope should be the scope of the
enclosing normal cleanup, not the top of the EH stack.  I'm *really*
surprised this hasn't been causing more problems.

Fixes rdar://problem/8231514.

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

14 years agoAdded some false positive checking to UnreachableCodeChecker
Tom Care [Tue, 27 Jul 2010 23:30:21 +0000 (23:30 +0000)]
Added some false positive checking to UnreachableCodeChecker
- Allowed reporting of dead macros
- Added path walking function to search for false positives in conditional statements
- Updated some affected tests
- Added some false positive test cases

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

14 years agoExtracted out some useful common functions in IdempotentOperationChecker to their...
Tom Care [Tue, 27 Jul 2010 23:26:07 +0000 (23:26 +0000)]
Extracted out some useful common functions in IdempotentOperationChecker to their own CheckerHelpers file.

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

14 years agoAdd PTH test case for <rdar://problem/8227989>.
Ted Kremenek [Tue, 27 Jul 2010 23:06:03 +0000 (23:06 +0000)]
Add PTH test case for <rdar://problem/8227989>.

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

14 years agoRecord macros in dependent PCHs. Also add various info tables to dependent PCHs;...
Sebastian Redl [Tue, 27 Jul 2010 23:01:28 +0000 (23:01 +0000)]
Record macros in dependent PCHs. Also add various info tables to dependent PCHs; tests for this to follow.

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

14 years agoRevert r109546, it broke linux build.
Argyrios Kyrtzidis [Tue, 27 Jul 2010 22:37:14 +0000 (22:37 +0000)]
Revert r109546, it broke linux build.

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

14 years agoMerge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into...
Argyrios Kyrtzidis [Tue, 27 Jul 2010 22:01:17 +0000 (22:01 +0000)]
Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also
needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes.
This fixes current (and avoids future) codegen-from-PCH bugs.

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

14 years agoFix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.
Eli Friedman [Tue, 27 Jul 2010 20:51:02 +0000 (20:51 +0000)]
Fix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.

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

14 years agoAlways use current working directory for DW_AT_comp_dir.
Devang Patel [Tue, 27 Jul 2010 20:49:59 +0000 (20:49 +0000)]
Always use current working directory for DW_AT_comp_dir.

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

14 years agoPR7724: Don't try to evaluate value-dependent expressions.
Eli Friedman [Tue, 27 Jul 2010 19:14:53 +0000 (19:14 +0000)]
PR7724: Don't try to evaluate value-dependent expressions.

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

14 years agoAPIs that take different sized arguments than the instruction
Eric Christopher [Tue, 27 Jul 2010 19:11:16 +0000 (19:11 +0000)]
APIs that take different sized arguments than the instruction
should be taken out and shot.

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

14 years agoFinesse 'idempotent operations' analyzer issues to include the opcode of the binary...
Ted Kremenek [Tue, 27 Jul 2010 18:49:08 +0000 (18:49 +0000)]
Finesse 'idempotent operations' analyzer issues to include the opcode of the binary operator for clearer error reporting.  Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same.

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

14 years agoAdd non-static version of BinaryOperator::getOpcodeStr().
Ted Kremenek [Tue, 27 Jul 2010 18:49:04 +0000 (18:49 +0000)]
Add non-static version of BinaryOperator::getOpcodeStr().

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

14 years agoUpdate the list of lexical decls in the TU for chained PCHs. This makes -ast-print...
Sebastian Redl [Tue, 27 Jul 2010 18:24:41 +0000 (18:24 +0000)]
Update the list of lexical decls in the TU for chained PCHs. This makes -ast-print show the decls from the dependent PCH.

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

14 years agoPut 'Idempotent operations' static analyzer issues in the 'Dead code' category.
Ted Kremenek [Tue, 27 Jul 2010 17:52:52 +0000 (17:52 +0000)]
Put 'Idempotent operations' static analyzer issues in the 'Dead code' category.

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

14 years agoReapply 109303.
Devang Patel [Tue, 27 Jul 2010 15:17:16 +0000 (15:17 +0000)]
Reapply 109303.

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

14 years agoFix use-after-free with precompiled preambles
Douglas Gregor [Tue, 27 Jul 2010 14:52:07 +0000 (14:52 +0000)]
Fix use-after-free with precompiled preambles

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

14 years agoAlways deserialize from PCH file scoped variables with non trivial constructor/destru...
Argyrios Kyrtzidis [Tue, 27 Jul 2010 12:56:10 +0000 (12:56 +0000)]
Always deserialize from PCH file scoped variables with non trivial constructor/destructor.

Fixes http://llvm.org/PR7692

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

14 years agoRevert r109428 "Hoist argument type checking into CheckFormatHandler. This is prep...
Michael J. Spencer [Tue, 27 Jul 2010 04:46:02 +0000 (04:46 +0000)]
Revert r109428 "Hoist argument type checking into CheckFormatHandler.  This is prep for scanf format"

Got errors about ASTContext being undefined with Visual Studio 2010.

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

14 years agoDon't warn about unreachable code if the block starts with __builtin_unreachable().
Jordy Rose [Tue, 27 Jul 2010 03:39:53 +0000 (03:39 +0000)]
Don't warn about unreachable code if the block starts with __builtin_unreachable().

The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810.

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

14 years agoAdd PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those...
Ted Kremenek [Tue, 27 Jul 2010 02:59:02 +0000 (02:59 +0000)]
Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those by Lexer::LexEndOfFile().

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

14 years agoFix predicate in 'InCachingLexMode' to include 'CurPTHLexer'.
Ted Kremenek [Tue, 27 Jul 2010 02:58:59 +0000 (02:58 +0000)]
Fix predicate in 'InCachingLexMode' to include 'CurPTHLexer'.

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

14 years agoPTH generation: Don't save the leading '#' token in a null directive. This unbreaks...
Ted Kremenek [Tue, 27 Jul 2010 02:58:57 +0000 (02:58 +0000)]
PTH generation: Don't save the leading '#' token in a null directive.  This unbreaks using PTH with Boost (<rdar://problem/8227989>).

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

14 years agoGroundwork for C string length tracking. Currently only handles the length of constan...
Jordy Rose [Tue, 27 Jul 2010 01:37:31 +0000 (01:37 +0000)]
Groundwork for C string length tracking. Currently only handles the length of constant string literals, which is not too helpful, and only calls to strlen() are checked.

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

14 years agoImplement -fno-validate-pch at the -cc1 level, which suppresses most
Douglas Gregor [Tue, 27 Jul 2010 00:27:13 +0000 (00:27 +0000)]
Implement -fno-validate-pch at the -cc1 level, which suppresses most
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.

Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.

This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).

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

14 years ago- Fix recording of offsets of types in dependent PCHs.
Sebastian Redl [Tue, 27 Jul 2010 00:17:23 +0000 (00:17 +0000)]
- Fix recording of offsets of types in dependent PCHs.
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.

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

14 years agoWhen remapping a virtual file, also make an entry for the file with
Douglas Gregor [Mon, 26 Jul 2010 23:54:23 +0000 (23:54 +0000)]
When remapping a virtual file, also make an entry for the file with
its absolute path on disk. Also, introduce a fun test for the
precompiled preamble, which almost works...

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

14 years ago2nd argument of __builtin_expect must be evaluated
Fariborz Jahanian [Mon, 26 Jul 2010 23:11:03 +0000 (23:11 +0000)]
2nd argument of __builtin_expect must be evaluated
if it hs side-effect to matchgcc's behaviour.
Addresses radar 8172109.

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

14 years agopath renamed.
Chris Lattner [Mon, 26 Jul 2010 22:51:00 +0000 (22:51 +0000)]
path renamed.

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

14 years agoTest for the presence of EH branch-throughs instead of normal branch-throughs.
John McCall [Mon, 26 Jul 2010 22:44:58 +0000 (22:44 +0000)]
Test for the presence of EH branch-throughs instead of normal branch-throughs.
I knew this code duplication would bite me.

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

14 years agoMark __builtin_eh_return as noreturn. Patch by Dimitry Andric.
Benjamin Kramer [Mon, 26 Jul 2010 22:04:15 +0000 (22:04 +0000)]
Mark __builtin_eh_return as noreturn. Patch by Dimitry Andric.

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

14 years agoFix an apparent bug.
Dan Gohman [Mon, 26 Jul 2010 21:44:15 +0000 (21:44 +0000)]
Fix an apparent bug.

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

14 years agoIntroduce basic support for loading a precompiled preamble while
Douglas Gregor [Mon, 26 Jul 2010 21:36:20 +0000 (21:36 +0000)]
Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.

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

14 years agoMinor code simplification.
Dan Gohman [Mon, 26 Jul 2010 21:33:22 +0000 (21:33 +0000)]
Minor code simplification.

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

14 years agoIt's not necessary to call flush() on a raw_ostream immediately prior
Dan Gohman [Mon, 26 Jul 2010 21:29:50 +0000 (21:29 +0000)]
It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.

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

14 years agoFix namespace polution.
Dan Gohman [Mon, 26 Jul 2010 21:25:24 +0000 (21:25 +0000)]
Fix namespace polution.

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

14 years agoMake a variable static.
Dan Gohman [Mon, 26 Jul 2010 21:12:29 +0000 (21:12 +0000)]
Make a variable static.

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

14 years agoUse an export file. Plugins must export llvm::Registry symbols.
Dan Gohman [Mon, 26 Jul 2010 21:12:10 +0000 (21:12 +0000)]
Use an export file. Plugins must export llvm::Registry symbols.
Also, don't link in all the clang libraries statically.

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

14 years agoHoist argument type checking into CheckFormatHandler. This is prep for scanf format
Ted Kremenek [Mon, 26 Jul 2010 19:45:54 +0000 (19:45 +0000)]
Hoist argument type checking into CheckFormatHandler.  This is prep for scanf format
string argument type checking.

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

14 years agoConsolidate #args checking for scanf/printf format strings.
Ted Kremenek [Mon, 26 Jul 2010 19:45:42 +0000 (19:45 +0000)]
Consolidate #args checking for scanf/printf format strings.

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

14 years agoRevert 109303.
Devang Patel [Mon, 26 Jul 2010 18:49:27 +0000 (18:49 +0000)]
Revert 109303.

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

14 years agoMake sure that implicit qualification and derived-to-base conversions of xvalues...
Sebastian Redl [Mon, 26 Jul 2010 17:52:21 +0000 (17:52 +0000)]
Make sure that implicit qualification and derived-to-base conversions of xvalues preserve xvalue-ness. Unfortunately I have no idea how to test this property; there doesn't seem to be a syntactical construct that triggers such a conversion and still allows the distinction between prvalues and xvalues to be made.

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

14 years agoAdd source location information to C++ base specifiers.
Nick Lewycky [Mon, 26 Jul 2010 16:56:01 +0000 (16:56 +0000)]
Add source location information to C++ base specifiers.

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

14 years agoWhen LIBCLANG_CODE_COMPLETION_LOGGING is set in the environment, log code-completion...
Douglas Gregor [Mon, 26 Jul 2010 16:29:14 +0000 (16:29 +0000)]
When LIBCLANG_CODE_COMPLETION_LOGGING is set in the environment, log code-completion command lines to stderr

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

14 years agoEliminate the "minimal" and printing parser actions, which only ever
Douglas Gregor [Mon, 26 Jul 2010 04:08:02 +0000 (04:08 +0000)]
Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.

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

14 years agoWrap bit mangling logic for DiagMappings in its own class so it doesn't leak
Benjamin Kramer [Sun, 25 Jul 2010 21:40:48 +0000 (21:40 +0000)]
Wrap bit mangling logic for DiagMappings in its own class so it doesn't leak
into other code. Make it an array instead of a constant-length vector.

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

14 years agoRemove a bunch of trivial destructors
Douglas Gregor [Sun, 25 Jul 2010 18:44:37 +0000 (18:44 +0000)]
Remove a bunch of trivial destructors

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

14 years agoMove Type destructor out-of-line
Douglas Gregor [Sun, 25 Jul 2010 18:39:40 +0000 (18:39 +0000)]
Move Type destructor out-of-line

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

14 years agoRemove destructors from declaration nodes
Douglas Gregor [Sun, 25 Jul 2010 18:38:02 +0000 (18:38 +0000)]
Remove destructors from declaration nodes

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

14 years agoI lied. Kill off a few more Destroy methods
Douglas Gregor [Sun, 25 Jul 2010 18:32:30 +0000 (18:32 +0000)]
I lied. Kill off a few more Destroy methods

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

14 years agoKill off the last Destroy method in the AST library
Douglas Gregor [Sun, 25 Jul 2010 18:23:53 +0000 (18:23 +0000)]
Kill off the last Destroy method in the AST library

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

14 years agoRemove the vast majority of the Destroy methods from the AST library,
Douglas Gregor [Sun, 25 Jul 2010 18:17:45 +0000 (18:17 +0000)]
Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.

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

14 years agoMake ASTContext always use the BumpPtrAllocator.
Douglas Gregor [Sun, 25 Jul 2010 17:53:33 +0000 (17:53 +0000)]
Make ASTContext always use the BumpPtrAllocator.

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

14 years agoStart removing the use of smart pointers from the Parse/Sema
Douglas Gregor [Sun, 25 Jul 2010 17:39:21 +0000 (17:39 +0000)]
Start removing the use of smart pointers from the Parse/Sema
interaction, by effectively defaulting to
DISABLE_SMART_POINTERS. We're embracing the model where all AST nodes
are ASTContext-allocated and live as long as the ASTContext lives.

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

14 years agoRemove emacs file mode marker on file with .cpp extension.
Nick Lewycky [Sun, 25 Jul 2010 03:12:58 +0000 (03:12 +0000)]
Remove emacs file mode marker on file with .cpp extension.

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

14 years agoRemove dead code.
Eli Friedman [Sat, 24 Jul 2010 21:35:09 +0000 (21:35 +0000)]
Remove dead code.

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

14 years agoAdd header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!
Nick Lewycky [Sat, 24 Jul 2010 21:33:13 +0000 (21:33 +0000)]
Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!

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

14 years agoPR7698: Make sure we correctly handle the initialization of an array with
Eli Friedman [Sat, 24 Jul 2010 21:19:15 +0000 (21:19 +0000)]
PR7698: Make sure we correctly handle the initialization of an array with
dependent size.

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

14 years agoFix clang-interpreter build
Peter Collingbourne [Sat, 24 Jul 2010 17:59:51 +0000 (17:59 +0000)]
Fix clang-interpreter build

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

14 years agoFix sort order.
Nick Lewycky [Sat, 24 Jul 2010 02:58:13 +0000 (02:58 +0000)]
Fix sort order.

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