[ms-inline asm] Rename a few induction variables to avoid confusion and silence
a gcc warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162444 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a bunch of -Wdocumentation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Support C++ default arguments if they are literal values.

A CXXDefaultArgExpr wraps an Expr owned by a ParmVarDecl belonging to the
called function. In general, ExprEngine and Environment ought to treat this
like a ParenExpr or other transparent wrapper expression, with the inside
expression evaluated first.

However, if we call the same function twice, we'd produce a CFG that contains
the same wrapped expression twice, and we're not set up to handle that. I've
added a FIXME to the CFG builder to come back to that, but meanwhile we can
at least handle expressions that don't need to be explicitly evaluated:
literals. This probably handles many common uses of default parameters:
true/false, null, etc.

Part of PR13385 / <rdar://problem/12156507>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162453 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Remove an unused argument.  This logic can now be reused by the
ms-style inline asms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162463 91177308-0d34-0410-b5e6-96231b3b80d8
When disambiguating an expression-statement from a declaraton-statement, if the
statement starts with an identifier for which name lookup will fail either way,
look at later tokens to disambiguate in order to improve error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162464 91177308-0d34-0410-b5e6-96231b3b80d8
Change a bunch of cases where we do "getAs<...>->doSomething()" to
"castAs<...>->doSomething()".  The analyzer was flagging these
as potential null dereferences, which is technically true.  The
invariants appear to be that these casts should never fail, so
let's use castAs<> instead and avoid a runtime check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162468 91177308-0d34-0410-b5e6-96231b3b80d8
Added a method to DeclContext that marks the
lookup table as needing to be built.

This is required for LLDB, which provides the
contents of many DeclContexts through a custom
ExternalASTSource.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162471 91177308-0d34-0410-b5e6-96231b3b80d8
Rip out remnants of move semantic emulation and smart pointers in Sema.

These were nops for quite a while and only lead to confusion. ASTMultiPtr
now behaves like a proper dumb array reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162475 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Add a few helper function to the MSAsmStmt class that are needed
by CodeGen.

In the long-term, much of the codegen logic will be shared between the GNU-style
and MS-style inline assembly, but for now I'm replicating this logic to avoid
regressions with the GNU-style.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162478 91177308-0d34-0410-b5e6-96231b3b80d8
Attaching comments to decls: since it was decided that Decl::isImplicit should
not be set for implicit instantiations, remove the FIXME.  This should be the
last bit for PR13634.  The actual fix happened in r162238.

Motivation: it might be misleading to mark implicit instantiations as
Decl::isImplicit = true.  Because then, in order to be consistent, we should
mark all instantiated members as implicit.  But the user did actually type the
declaration for the member, but the compiler played with it a little bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162488 91177308-0d34-0410-b5e6-96231b3b80d8
Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162492 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Handle UserDefinedConversion casts in C++.

This is trivial; the UserDefinedConversion always wraps a CXXMemberCallExpr
for the appropriate conversion function, so it's just a matter of
propagating that value to the CastExpr itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162494 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] For now, treat pointers-to-members as non-null void * symbols.

Until we have full support for pointers-to-members, we can at least
approximate some of their use by tracking null and non-null values.
We thus treat &A::m_ptr as a non-null void * symbol, and MemberPointer(0)
as a pointer-sized null constant.

This enables support for what is sometimes called the "safe bool" idiom,
demonstrated in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162495 91177308-0d34-0410-b5e6-96231b3b80d8
[scan-build] Accept -fno-objc-arc as well as -fobjc-arc.

This is how Xcode lets individual files be marked as non-ARC when the rest
of the project is ARC-enabled, so this is necessary for scan-build xcodebuild.

Patch by Paul Eipper!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162497 91177308-0d34-0410-b5e6-96231b3b80d8
Now that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.

This required changing all get() calls to data() and using the simpler constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162501 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a few -Wdocumentation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162506 91177308-0d34-0410-b5e6-96231b3b80d8
Comment semantic analysis: treat function typedefs as functions so that one can
use \param and \returns in documentation.

Fixes PR13533.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162507 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Make analyzer less aggressive when dealing with [self init].

With inlining, retain count checker starts tracking 'self' through the
init methods. The analyser results were too noisy if the developer
did not follow 'self = [super init]' pattern (which is common
especially in older code bases) - we reported self init anti-pattern AND
possible use-after-free. This patch teaches the retain count
checker to assume that [super init] does not fail when it's not consumed
by another expression. This silences the retain count warning that warns
about possibility of use-after-free when init fails, while preserving
all the other checking on 'self'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162508 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST.  Next we need
generate the Input/Output expressions using Sema::ActOnIdExpression().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162509 91177308-0d34-0410-b5e6-96231b3b80d8
DeclPrinter tests: add two more tests.


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