]> granicus.if.org Git - clang/log
clang
11 years agoDecl.cpp/mergeTemplateLV(): Tweak a description. [-Wdocumentation]
NAKAMURA Takumi [Fri, 22 Feb 2013 04:06:28 +0000 (04:06 +0000)]
Decl.cpp/mergeTemplateLV(): Tweak a description. [-Wdocumentation]

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

11 years agoOnly suppress instance context if a member is actually
John McCall [Fri, 22 Feb 2013 03:52:55 +0000 (03:52 +0000)]
Only suppress instance context if a member is actually
accessible in its declaring class;  otherwise we might
fail to apply [class.protected] when considering
accessibility in derived classes.

Noticed by inspection; <rdar://13270329>.

I had an existing test wrong.  Here's why it's wrong:

Follow the rules (and notation) of [class.access]p5.
The naming class (N) is B and the context (R) is D::getX.
- 'x' as a member of B is protected, but R does not occur
  in a member or friend of a class derived from B.
- There does exist a base class of B, A, which is accessible
  from R, and 'x' is accessible at R when named in A because
  'x' as a member of A is protected and R occurs in a member
  of a class, D, that is derived from A;  however, by
  [class.protected], the class of the object expression must
  be equal to or derived from that class, and A does not
  derive from D.

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

11 years ago[analyzer] Place all inlining policy checks into one palce
Anna Zaks [Fri, 22 Feb 2013 02:59:24 +0000 (02:59 +0000)]
[analyzer] Place all inlining policy checks into one palce

Previously, we had the decisions about inlining spread out
over multiple functions.

In addition to the refactor, this commit ensures
that we will always inline BodyFarm functions as long as the Decl
is available. This fixes false positives due to those functions
not being inlined when no or minimal inlining is enabled such (as
shallow mode).

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

11 years agoAdd -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
Richard Smith [Fri, 22 Feb 2013 01:59:51 +0000 (01:59 +0000)]
Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.

Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.

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

11 years ago[analyzer] Make sure a materialized temporary matches its bindings.
Jordan Rose [Fri, 22 Feb 2013 01:51:15 +0000 (01:51 +0000)]
[analyzer] Make sure a materialized temporary matches its bindings.

This is a follow-up to r175830, which made sure a temporary object region
created for, say, a struct rvalue matched up with the initial bindings
being stored into it. This does the same for the case in which the AST
actually tells us that we need to create a temporary via a
MaterializeObjectExpr. I've unified the two code paths and moved a static
helper function onto ExprEngine.

This also caused a bit of test churn, causing us to go back to describing
temporary regions without a 'const' qualifier. This seems acceptable; it's
our behavior from a few months ago.

<rdar://problem/13265460> (part 2)

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

11 years agoFix regression in modeling assignments of an address of a variable to itself. Fixes...
Ted Kremenek [Fri, 22 Feb 2013 01:39:26 +0000 (01:39 +0000)]
Fix regression in modeling assignments of an address of a variable to itself.  Fixes <rdar://problem/13226577>.

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

11 years agoMake sure we only use the output file as a base for debug splitting
Eric Christopher [Fri, 22 Feb 2013 01:33:46 +0000 (01:33 +0000)]
Make sure we only use the output file as a base for debug splitting
if we're compiling.

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

11 years agoobjective-C arc: Diagnostic can not say to use bridge
Fariborz Jahanian [Fri, 22 Feb 2013 01:22:48 +0000 (01:22 +0000)]
objective-C arc: Diagnostic can not say to use bridge
casts with c++ named casts. Change notes to say use
bridge with c-style cast instead. // rdar://12788838

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

11 years ago[analyzer] Fix buildbot by not reusing a variable name.
Jordan Rose [Fri, 22 Feb 2013 01:08:00 +0000 (01:08 +0000)]
[analyzer] Fix buildbot by not reusing a variable name.

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

11 years agoPreproceessor: fix #if skipping under -traditional-cpp.
Jordan Rose [Fri, 22 Feb 2013 00:32:00 +0000 (00:32 +0000)]
Preproceessor: fix #if skipping under -traditional-cpp.

When parsing directives within skipped #if blocks, we don't want to retain
any whitespace. Previously we were just skipping comments, but it's not
possible to skip comments and retain other whitespace. This change matches
the usual behavior for parsing directives (i.e. the behavior outside of
skipped #if blocks).

<rdar://problem/13267695>

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

11 years agoMake logic smaller.
Eric Christopher [Fri, 22 Feb 2013 00:24:40 +0000 (00:24 +0000)]
Make logic smaller.

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

11 years agoAdded a footnote to the documentation for objc_storeStrong that makes it clear
Michael Gottesman [Fri, 22 Feb 2013 00:16:48 +0000 (00:16 +0000)]
Added a footnote to the documentation for objc_storeStrong that makes it clear
that a __strong object of block type is a valid argument to objc_storeStrong but
that an objc_retain and not an objc_retainBlock will be emitted.

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

11 years agoRemoving has_getDecl (added in r175532). It cause a build break for MSVC, and was...
Aaron Ballman [Fri, 22 Feb 2013 00:15:31 +0000 (00:15 +0000)]
Removing has_getDecl (added in r175532). It cause a build break for MSVC, and was not yet being used in the codebase. If we start using std::enable_if, we can look into resurrecting the idea in a more portable fashion.

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

11 years agoApply the 'nobuiltin' attribute to call sites when the user specifies `-fno-builtin...
Bill Wendling [Fri, 22 Feb 2013 00:13:35 +0000 (00:13 +0000)]
Apply the 'nobuiltin' attribute to call sites when the user specifies `-fno-builtin' on the command line.

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

11 years agoMake for x86 to stop it failing on ARM buildbots.
Bill Wendling [Fri, 22 Feb 2013 00:04:55 +0000 (00:04 +0000)]
Make for x86 to stop it failing on ARM buildbots.

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

11 years agoGrammar.
Eric Christopher [Fri, 22 Feb 2013 00:03:08 +0000 (00:03 +0000)]
Grammar.

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

11 years ago[analyzer] Make sure a temporary object region matches its initial bindings.
Jordan Rose [Thu, 21 Feb 2013 23:57:17 +0000 (23:57 +0000)]
[analyzer] Make sure a temporary object region matches its initial bindings.

When creating a temporary region (say, when a struct rvalue is used as
the base of a member expr), make sure we account for any derived-to-base
casts. We don't actually record these in the LazyCompoundVal that
represents the rvalue, but we need to make sure that the temporary region
we're creating (a) matches the bindings, and (b) matches its expression.

Most of the time this will do exactly the same thing as before, but it
fixes spurious "garbage value" warnings introduced in r175234 by the use
of lazy bindings to model trivial copy constructors.

<rdar://problem/13265460>

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

11 years agoIgnore visibility from enclosing template arguments
John McCall [Thu, 21 Feb 2013 23:42:58 +0000 (23:42 +0000)]
Ignore visibility from enclosing template arguments
for explicit member specializations.

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

11 years agoSimplify code to use castAs rather than getAs + assert.
David Blaikie [Thu, 21 Feb 2013 23:35:06 +0000 (23:35 +0000)]
Simplify code to use castAs rather than getAs + assert.

Post commit review feedback on r175812 from Jordan Rose.

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

11 years agoFix copy/paste to refer to the relevant type (ProgramPoint instead of TypeLoc).
David Blaikie [Thu, 21 Feb 2013 23:35:03 +0000 (23:35 +0000)]
Fix copy/paste to refer to the relevant type (ProgramPoint instead of TypeLoc).

Post commit review feedback on r175812 from Jordan Rose.

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

11 years agoclang/test/Driver/qa_override.c: Appease gcc-driver.
NAKAMURA Takumi [Thu, 21 Feb 2013 23:17:45 +0000 (23:17 +0000)]
clang/test/Driver/qa_override.c: Appease gcc-driver.

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

11 years agoFix typo 'with with' in diagnostic.
Richard Smith [Thu, 21 Feb 2013 23:15:05 +0000 (23:15 +0000)]
Fix typo 'with with' in diagnostic.

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

11 years agoAdd back implicitly dropped const.
David Blaikie [Thu, 21 Feb 2013 22:37:44 +0000 (22:37 +0000)]
Add back implicitly dropped const.

(found due to incoming improvements to llvm::cast machinery that will error on
this sort of mistake)

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

11 years agoFix formatting and tabs in file.
Eric Christopher [Thu, 21 Feb 2013 22:35:08 +0000 (22:35 +0000)]
Fix formatting and tabs in file.

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

11 years agoDon't pass -split-dwarf= to the backend unless we're on linux for
Eric Christopher [Thu, 21 Feb 2013 22:35:05 +0000 (22:35 +0000)]
Don't pass -split-dwarf= to the backend unless we're on linux for
now.

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

11 years agoRemove the SplitDebug action and replace with a set of commands
Eric Christopher [Thu, 21 Feb 2013 22:35:01 +0000 (22:35 +0000)]
Remove the SplitDebug action and replace with a set of commands
in the compilation setup. Note that this doesn't currently
work for -no-integrated-as.

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

11 years agoReplace ProgramPoint llvm::cast support to be well-defined.
David Blaikie [Thu, 21 Feb 2013 22:23:56 +0000 (22:23 +0000)]
Replace ProgramPoint llvm::cast support to be well-defined.

See r175462 for another example/more details.

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

11 years agoRemove superfluous null pointer check. The pointer is used prior to this check.
Ted Kremenek [Thu, 21 Feb 2013 22:10:49 +0000 (22:10 +0000)]
Remove superfluous null pointer check.  The pointer is used prior to this check.

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

11 years agoAST dumping: dump template instantiations only once
Dmitri Gribenko [Thu, 21 Feb 2013 22:01:10 +0000 (22:01 +0000)]
AST dumping: dump template instantiations only once

Fixes infinite loop in PR15220.

Patch by Philip Craig.

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

11 years agoRemove accidentally introduced no-op line.
Daniel Jasper [Thu, 21 Feb 2013 21:40:48 +0000 (21:40 +0000)]
Remove accidentally introduced no-op line.

Was used during experiments, but another if-statements a few lines
before makes it (intentionally) useless.

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

11 years agoTeach serialized diagnostics about notes without locations.
Ted Kremenek [Thu, 21 Feb 2013 21:40:44 +0000 (21:40 +0000)]
Teach serialized diagnostics about notes without locations.

Along the way, improve a diagnostic for "previous declaration here" for implicit parameters.

Fixes <rdar://problem/13211384>.

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

11 years agoConsistently put {} onto the same line for empty functions.
Daniel Jasper [Thu, 21 Feb 2013 21:33:55 +0000 (21:33 +0000)]
Consistently put {} onto the same line for empty functions.

This fixes llvm.org/PR15167.

Before:
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL()
    : AAAAAAAA(10), BBBBBBBBB(10) {
}
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL() : AAAAAAAA(10) {}

After:
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL()
    : AAAAAAAA(10), BBBBBBBBB(10) {}
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL() : AAAAAAAA(10) {}

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

11 years agoReplace CFGElement llvm::cast support to be well-defined.
David Blaikie [Thu, 21 Feb 2013 20:58:29 +0000 (20:58 +0000)]
Replace CFGElement llvm::cast support to be well-defined.

See r175462 for another example/more details.

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

11 years agoPatch for debug info of qualified-id types is 'id'
Fariborz Jahanian [Thu, 21 Feb 2013 20:42:11 +0000 (20:42 +0000)]
Patch for debug info of qualified-id types is 'id'
By Adrian Pranti.

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

11 years agoTry to fix the test for cmake builds, where clang is called clang-3.3.
Benjamin Kramer [Thu, 21 Feb 2013 20:30:05 +0000 (20:30 +0000)]
Try to fix the test for cmake builds, where clang is called clang-3.3.

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

11 years ago[scan-build] Add quotes around clang executable name to handle path withs spaces...
Ted Kremenek [Thu, 21 Feb 2013 20:28:59 +0000 (20:28 +0000)]
[scan-build] Add quotes around clang executable name to handle path withs spaces.  Fixes <rdar://problem/13254727>

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

11 years agoTry to get buildbots to pass these tests.
Bill Wendling [Thu, 21 Feb 2013 19:44:18 +0000 (19:44 +0000)]
Try to get buildbots to pass these tests.

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

11 years ago[scan-build] fix xcode version parsing to handle dot releases. Fixes <rdar://problem...
Ted Kremenek [Thu, 21 Feb 2013 19:33:30 +0000 (19:33 +0000)]
[scan-build] fix xcode version parsing to handle dot releases.  Fixes <rdar://problem/13265300>.

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

11 years ago[driver] Handle the processing of the QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGS
Chad Rosier [Thu, 21 Feb 2013 18:56:55 +0000 (18:56 +0000)]
[driver] Handle the processing of the QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGS
before the DiagnosticsEngine is instantiated.  Otherwise, warning options are
not handled correctly.
rdar://13254743

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

11 years agoPreprocessor: preserve whitespace in -traditional-cpp mode.
Jordan Rose [Thu, 21 Feb 2013 18:53:19 +0000 (18:53 +0000)]
Preprocessor: preserve whitespace in -traditional-cpp mode.

Note that unlike GNU cpp we currently do not preserve whitespace in macros
(even in -traditional-cpp mode).

<rdar://problem/12897179>

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

11 years ago[driver] Add a dump method for ArgList.
Chad Rosier [Thu, 21 Feb 2013 18:40:49 +0000 (18:40 +0000)]
[driver] Add a dump method for ArgList.

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

11 years agoAllow breaking between type and name in for loops.
Daniel Jasper [Thu, 21 Feb 2013 15:00:29 +0000 (15:00 +0000)]
Allow breaking between type and name in for loops.

This fixes llvm.org/PR15033.

Also: Always break before a parameter, if the previous parameter was
split over multiple lines. This was necessary to make the right
decisions in for-loops, almost always makes the code more readable and
also fixes llvm.org/PR14873.

Before:
for (llvm::ArrayRef<NamedDecl *>::iterator I = FD->getDeclsInPrototypeScope()
         .begin(), E = FD->getDeclsInPrototypeScope().end();
     I != E; ++I) {
}
foo(bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
        ccccccccccccccccccccccccccccc), d, bar(e, f));

After:
for (llvm::ArrayRef<NamedDecl *>::iterator
         I = FD->getDeclsInPrototypeScope().begin(),
         E = FD->getDeclsInPrototypeScope().end();
     I != E; ++I) {
}
foo(bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
        ccccccccccccccccccccccccccccc),
    d, bar(e, f));

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

11 years agoAdd MSan to the list of targets in Makefile-based builds.
Evgeniy Stepanov [Thu, 21 Feb 2013 13:59:14 +0000 (13:59 +0000)]
Add MSan to the list of targets in Makefile-based builds.

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

11 years agoAdd a 64-bit triple to these tests, to fix 32-bit bots.
Joey Gouly [Thu, 21 Feb 2013 13:42:33 +0000 (13:42 +0000)]
Add a 64-bit triple to these tests, to fix 32-bit bots.

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

11 years agoFix an OpenCL test case. Pointer arguments to kernels must be declared with the
Joey Gouly [Thu, 21 Feb 2013 12:06:32 +0000 (12:06 +0000)]
Fix an OpenCL test case. Pointer arguments to kernels must be declared with the
__global, __constant or __local qualifier.

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

11 years agoAdd support to Sema and CodeGen for floating point vector types in OpenCL.
Joey Gouly [Thu, 21 Feb 2013 11:49:56 +0000 (11:49 +0000)]
Add support to Sema and CodeGen for floating point vector types in OpenCL.

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

11 years agoCorrect spelling of 'enumerator'.
David Blaikie [Thu, 21 Feb 2013 06:12:38 +0000 (06:12 +0000)]
Correct spelling of 'enumerator'.

Post commit code review feedback to r175705 from Jordan Rose.

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

11 years agoAvoid implicit conversions of Optional<T> to bool.
David Blaikie [Thu, 21 Feb 2013 06:05:05 +0000 (06:05 +0000)]
Avoid implicit conversions of Optional<T> to bool.

This is a precursor to making Optional<T>'s operator bool 'explicit' when
building Clang & LLVM as C++11.

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

11 years agoStaticAnalyzer/Core: Suppress warnings. [-Wunused-variable, -Wunused-function]
NAKAMURA Takumi [Thu, 21 Feb 2013 04:40:10 +0000 (04:40 +0000)]
StaticAnalyzer/Core: Suppress warnings. [-Wunused-variable, -Wunused-function]

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

11 years agoWhitespace.
NAKAMURA Takumi [Thu, 21 Feb 2013 04:40:04 +0000 (04:40 +0000)]
Whitespace.

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

11 years ago[analyzer] Record whether a base object region represents a virtual base.
Jordan Rose [Thu, 21 Feb 2013 03:12:32 +0000 (03:12 +0000)]
[analyzer] Record whether a base object region represents a virtual base.

This allows MemRegion and MemRegionManager to avoid asking over and over
again whether an class is a virtual base or a non-virtual base.

Minor optimization/cleanup; no functionality change.

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

11 years ago[analyzer] Add another reinterpret_cast behavior test.
Jordan Rose [Thu, 21 Feb 2013 03:12:26 +0000 (03:12 +0000)]
[analyzer] Add another reinterpret_cast behavior test.

The test is similar to <rdar://problem/13239840> but doesn't actually test
the case that fails there. It's still a good test, though.

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

11 years ago[analyzer] Tidy up a few uses of Optional in RegionStore.
Jordan Rose [Thu, 21 Feb 2013 03:12:21 +0000 (03:12 +0000)]
[analyzer] Tidy up a few uses of Optional in RegionStore.

Some that I just added needed conversion to use 'None', others looked
better using Optional<SVal>::create.

No functionality change.

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

11 years agoCIndex.cpp: Appease g++-4.4. "if (Optional<unsigned> Minor = In.getMinor())" did...
NAKAMURA Takumi [Thu, 21 Feb 2013 02:32:34 +0000 (02:32 +0000)]
CIndex.cpp: Appease g++-4.4. "if (Optional<unsigned> Minor = In.getMinor())" did not work as expected.

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

11 years agolibstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against
Richard Smith [Thu, 21 Feb 2013 02:17:58 +0000 (02:17 +0000)]
libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against
being included in C++. Don't define alignof or alignas in this case. Note that
the C++11 standard is broken in various ways here (it refers to the contents
of <stdalign.h> in C99, where that header did not exist, and doesn't mention
the alignas macro at all), but we do our best to do what it intended.

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

11 years agoRespect -fno-canonical-prefixes when deciding where to generate .gcno and .gcda
Nick Lewycky [Thu, 21 Feb 2013 02:02:50 +0000 (02:02 +0000)]
Respect -fno-canonical-prefixes when deciding where to generate .gcno and .gcda
files.

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

11 years agoUse None rather than Optional<T>() where possible.
David Blaikie [Thu, 21 Feb 2013 01:47:18 +0000 (01:47 +0000)]
Use None rather than Optional<T>() where possible.

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

11 years agoRename TypeLoc's isType to isKind
David Blaikie [Thu, 21 Feb 2013 01:47:08 +0000 (01:47 +0000)]
Rename TypeLoc's isType to isKind

Matches changes made to SVal's similar functions based on Jordan Rose's review
feedback to r175594.

Also change isKind to take a reference rather than a non-null pointer, while I'm
at it. (& make TypeLoc::isKind private)

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

11 years ago[analyzer] Tighten up safety in the use of lazy bindings.
Jordan Rose [Thu, 21 Feb 2013 01:34:51 +0000 (01:34 +0000)]
[analyzer] Tighten up safety in the use of lazy bindings.

- When deciding if we can reuse a lazy binding, make sure to check if there
  are additional bindings in the sub-region.
- When reading from a lazy binding, don't accidentally strip off casts or
  base object regions. This slows down lazy binding reading a bit but is
  necessary for type sanity when treating one class as another.

A bit of minor refactoring allowed these two checks to be unified in a nice
early-return-using helper function.

<rdar://problem/13239840>

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

11 years agoStrip 'llvm' from 'llvm::Optional' uses.
Ted Kremenek [Thu, 21 Feb 2013 01:29:01 +0000 (01:29 +0000)]
Strip 'llvm' from 'llvm::Optional' uses.

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

11 years agoRemove commented out code.
Richard Trieu [Thu, 21 Feb 2013 00:50:43 +0000 (00:50 +0000)]
Remove commented out code.

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

11 years agoobjective-C arc IR-gen. Retaining of strong
Fariborz Jahanian [Thu, 21 Feb 2013 00:40:10 +0000 (00:40 +0000)]
objective-C arc IR-gen. Retaining of strong
arguments in function prologue is done
with objc_StoreStrong to pair it with
similar objc_StoreStrong for release in function
epilogue. This is done with -O0 only.
// rdar://13145317

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

11 years agoMark unimplemented function with LLVM_DELETED_FUNCTION
David Blaikie [Thu, 21 Feb 2013 00:26:17 +0000 (00:26 +0000)]
Mark unimplemented function with LLVM_DELETED_FUNCTION

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

11 years agoDoxycomment SVal's getAs/castAs.
David Blaikie [Thu, 21 Feb 2013 00:26:14 +0000 (00:26 +0000)]
Doxycomment SVal's getAs/castAs.

Also document TypeLoc's operations similarly, since it's a good idea.

Post-commit CR feedback from Anna Zaks regarding r175594.

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

11 years agoRevert "intmax_t is long long on Darwin, not long."
Jordan Rose [Wed, 20 Feb 2013 22:28:41 +0000 (22:28 +0000)]
Revert "intmax_t is long long on Darwin, not long."

'long' and 'long long' are different for the purposes of mangling.
This caused <rdar://problem/13254874>.

This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c.

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

11 years agoMCParser: Update method names per coding guidelines.
Jim Grosbach [Wed, 20 Feb 2013 22:25:15 +0000 (22:25 +0000)]
MCParser: Update method names per coding guidelines.

s/ParseMSInlineAsm/parseMSInlineAsm/

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

11 years agoInclude llvm::Optional in clang/Basic/LLVM.h
David Blaikie [Wed, 20 Feb 2013 22:23:23 +0000 (22:23 +0000)]
Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

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

11 years agoRemove redundant Optional type in favor of llvm::Optional
David Blaikie [Wed, 20 Feb 2013 22:23:03 +0000 (22:23 +0000)]
Remove redundant Optional type in favor of llvm::Optional

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

11 years agoUse op-> directly rather than via Optional<T>::getPointer.
David Blaikie [Wed, 20 Feb 2013 22:23:01 +0000 (22:23 +0000)]
Use op-> directly rather than via Optional<T>::getPointer.

Post-commit CR feedback from Jordan Rose regarding r175594.

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

11 years agoRename SVal::isType functions to SVal::isKind
David Blaikie [Wed, 20 Feb 2013 22:22:59 +0000 (22:22 +0000)]
Rename SVal::isType functions to SVal::isKind

Post-commit CR feedback from Jordan Rose regarding r175594.

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

11 years agoPR15311: Finish implementation of the suggested resolution of core issue 1488,
Richard Smith [Wed, 20 Feb 2013 20:19:27 +0000 (20:19 +0000)]
PR15311: Finish implementation of the suggested resolution of core issue 1488,
which allows grouping parens in an abstract-pack-declarator. This was already
mostly implemented, but missed some cases. Add an ExtWarn for use of this
extension until CWG ratifies it.

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

11 years agoAttempt to clean up tests for non-X86 platforms.
Bill Wendling [Wed, 20 Feb 2013 19:30:01 +0000 (19:30 +0000)]
Attempt to clean up tests for non-X86 platforms.

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

11 years agoProcess and handle attributes on conditions and for loop variables. Process and
Richard Smith [Wed, 20 Feb 2013 19:22:51 +0000 (19:22 +0000)]
Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.

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

11 years ago[ms-inline asm] Remove this test while I investigate why eax isn't being clobbered.
Chad Rosier [Wed, 20 Feb 2013 17:39:31 +0000 (17:39 +0000)]
[ms-inline asm] Remove this test while I investigate why eax isn't being clobbered.

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

11 years agoFix regression in string literal alignment.
Manuel Klimek [Wed, 20 Feb 2013 15:32:58 +0000 (15:32 +0000)]
Fix regression in string literal alignment.

Now correctly indents (again):
a = a + "a"
        "a"
        "a";

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

11 years agoFixes bug in string literal alignment.
Manuel Klimek [Wed, 20 Feb 2013 15:25:48 +0000 (15:25 +0000)]
Fixes bug in string literal alignment.

We now indent the following correctly:
1. some + "literal" /* comment */
          "literal";
2. breaking string literals after which we have another string literal.

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

11 years agoDon't remove blank lines within unwrapped lines.
Daniel Jasper [Wed, 20 Feb 2013 12:56:39 +0000 (12:56 +0000)]
Don't remove blank lines within unwrapped lines.

If the code author decides to put empty lines anywhere into the code we
should treat them equally, i.e. reduce them to the configured
MaxEmptyLinesToKeep.

With this change, we e.g. keep the newline in:
SomeType ST = {
  // First value
  a,

  // Second value
  b
};

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

11 years agoImplements breaking of string literals if they stick out.
Manuel Klimek [Wed, 20 Feb 2013 10:15:13 +0000 (10:15 +0000)]
Implements breaking of string literals if they stick out.

An alternative strategy to calculating the break on demand when hitting
a token that would need to be broken would be to put all possible breaks
inside the token into the optimizer.

Currently only supports breaking at spaces; more break points to come.

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

11 years agoRemove target-specific features.
Bill Wendling [Wed, 20 Feb 2013 08:01:34 +0000 (08:01 +0000)]
Remove target-specific features.

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

11 years agoModify the tests to use attribute group references instead of listing the
Bill Wendling [Wed, 20 Feb 2013 07:22:19 +0000 (07:22 +0000)]
Modify the tests to use attribute group references instead of listing the
function attributes.

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

11 years agoReplace SVal llvm::cast support to be well-defined.
David Blaikie [Wed, 20 Feb 2013 05:52:05 +0000 (05:52 +0000)]
Replace SVal llvm::cast support to be well-defined.

See r175462 for another example/more details.

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

11 years agointmax_t is long long on Darwin, not long.
Jordan Rose [Wed, 20 Feb 2013 01:56:21 +0000 (01:56 +0000)]
intmax_t is long long on Darwin, not long.

<rdar://problem/11540697>

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

11 years agoAdd a new 'type_visibility' attribute to allow users to
John McCall [Wed, 20 Feb 2013 01:54:26 +0000 (01:54 +0000)]
Add a new 'type_visibility' attribute to allow users to
control the visibility of a type for the purposes of RTTI
and template argument restrictions independently of how
visibility propagates to its non-type member declarations.

Also fix r175326 to not ignore template argument visibility
on a template explicit instantiation when a member has
an explicit attribute but the instantiation does not.

The type_visibility work is rdar://11880378

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

11 years agoDon't repeat the function name in the comment.
Richard Smith [Wed, 20 Feb 2013 01:17:14 +0000 (01:17 +0000)]
Don't repeat the function name in the comment.

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

11 years ago[preprocessor] Split the MacroInfo class into two separate concepts, MacroInfo class
Argyrios Kyrtzidis [Wed, 20 Feb 2013 00:54:57 +0000 (00:54 +0000)]
[preprocessor] Split the MacroInfo class into two separate concepts, MacroInfo class
for the data specific to a macro definition (e.g. what the tokens are), and
MacroDirective class which encapsulates the changes to the "macro namespace"
(e.g. the location where the macro name became active, the location where it was undefined, etc.)

(A MacroDirective always points to a MacroInfo object.)

Usually a macro definition (MacroInfo) is where a macro name becomes active (MacroDirective) but
splitting the concepts allows us to better model the effect of modules to the macro namespace
(also as a bonus it allows better modeling of push_macro/pop_macro #pragmas).
Modules can have their own macro history, separate from the local (current translation unit)
macro history; MacroDirectives will be used to model the macro history (changes to macro namespace).

For example, if "@import A;" imports macro FOO, there will be a new local MacroDirective created
to indicate that "FOO" became active at the import location. Module "A" itself will contain another
MacroDirective in its macro history (at the point of the definition of FOO) and both MacroDirectives
will point to the same MacroInfo object.

Introducing the separation of macro concepts is the first part towards better modeling of module macros.

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

11 years ago[analyzer] Account for the "interesting values" hash table resizing.
Jordan Rose [Wed, 20 Feb 2013 00:27:26 +0000 (00:27 +0000)]
[analyzer] Account for the "interesting values" hash table resizing.

RegionStoreManager::getInterestingValues() returns a pointer to a
std::vector that lives inside a DenseMap, which is constructed on demand.
However, constructing one such value can lead to constructing another
value, which will invalidate the reference created earlier.

Fixed by delaying the new entry creation until the function returns.

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

11 years agoPR15300: Support C++11 attributes on base-specifiers. We don't support any such
Richard Smith [Tue, 19 Feb 2013 23:47:15 +0000 (23:47 +0000)]
PR15300: Support C++11 attributes on base-specifiers. We don't support any such
attributes yet, so just issue the appropriate diagnostics. Also generalize the
fixit for attributes-in-the-wrong-place code and reuse it here, if attributes
are placed after the access-specifier or 'virtual' in a base specifier.

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

11 years ago[analyzer] Don't accidentally strip off base object regions for lazy bindings.
Jordan Rose [Tue, 19 Feb 2013 20:28:33 +0000 (20:28 +0000)]
[analyzer] Don't accidentally strip off base object regions for lazy bindings.

If a base object is at a 0 offset, RegionStoreManager may find a lazy
binding for the entire object, then try to attach a FieldRegion or
grandparent CXXBaseObjectRegion on top of that (skipping the intermediate
region). We now preserve as many layers of base object regions necessary
to make the types match.

<rdar://problem/13239840>

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

11 years agoAdd missing clang-format null pointer check..
Daniel Jasper [Tue, 19 Feb 2013 20:05:41 +0000 (20:05 +0000)]
Add missing clang-format null pointer check..

.. and a test that triggers it in valid albeit questionable code.

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

11 years ago[modules] Const'ify some functions of ModuleMap.
Argyrios Kyrtzidis [Tue, 19 Feb 2013 19:58:45 +0000 (19:58 +0000)]
[modules] Const'ify some functions of ModuleMap.

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

11 years ago[modules] Refactor code from ASTReader::makeModuleVisible() into a new function,
Argyrios Kyrtzidis [Tue, 19 Feb 2013 19:34:40 +0000 (19:34 +0000)]
[modules] Refactor code from ASTReader::makeModuleVisible() into a new function,
Module::getExportedModules() so it can be reused.

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

11 years agoUse MapVector::pop_back() per LLVM r175538.
Douglas Gregor [Tue, 19 Feb 2013 18:26:28 +0000 (18:26 +0000)]
Use MapVector::pop_back() per LLVM r175538.

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

11 years ago[docs] Rename to permit wider variety of content.
Sean Silva [Tue, 19 Feb 2013 17:29:01 +0000 (17:29 +0000)]
[docs] Rename to permit wider variety of  content.

I don't want to rule out the possibility of linking to e.g. interesting
blog posts about uses of Clang, so avoid restricting the content to
"projects".

This breaks URL compatibility, but this document was committed less than
an hour ago so hopefully nobody has linked to it yet.

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

11 years ago[docs] Revise content on ExternalProjectsUsingClang page.
Sean Silva [Tue, 19 Feb 2013 17:21:23 +0000 (17:21 +0000)]
[docs] Revise content on ExternalProjectsUsingClang page.

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

11 years agoCorrectly format macro with unfinished template declaration.
Daniel Jasper [Tue, 19 Feb 2013 17:14:38 +0000 (17:14 +0000)]
Correctly format macro with unfinished template declaration.

We can now format:
  #define A template <typename T>

Before this created a segfault :-/.

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

11 years agoSupport in hasDeclaration for types with getDecl()
Edwin Vane [Tue, 19 Feb 2013 17:14:34 +0000 (17:14 +0000)]
Support in hasDeclaration for types with getDecl()

Using a new metafunction for detecting the presence of the member
'getDecl' in a type T, added support to hasDeclaration for any such type
T. This allows hasDecl() to be replaced and enables several other
subclasses of clang::Type to use hasDeclaration.

Updated unittests and LibASTMatchersReference.html.

Reviewers: klimek

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

11 years ago[docs] Introduce ExternalProjectsUsingClang.rst
Sean Silva [Tue, 19 Feb 2013 16:58:15 +0000 (16:58 +0000)]
[docs] Introduce ExternalProjectsUsingClang.rst

A couple concrete examples are sure to be a win. If you know of any
other external projects using Clang, please let me know!

Patch by Laszlo Nagy! (with a title tweak by me)

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

11 years ago[Sanitizer] If -fsanitize-blacklist= option is not explicitly specified, make Clang...
Alexey Samsonov [Tue, 19 Feb 2013 11:25:29 +0000 (11:25 +0000)]
[Sanitizer] If -fsanitize-blacklist= option is not explicitly specified, make Clang look for the default sanitizer-specific blacklist in the resource directory.

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

11 years agoAdd the missing 'static' keyword to the test
Timur Iskhodzhanov [Tue, 19 Feb 2013 10:50:44 +0000 (10:50 +0000)]
Add the missing 'static' keyword to the test

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

11 years agoFix bug in LineState comparison function.
Daniel Jasper [Tue, 19 Feb 2013 09:28:55 +0000 (09:28 +0000)]
Fix bug in LineState comparison function.

The key bug was

  if (Other.StartOfLineLevel < StartOfLineLevel) ..

instead of

  if (Other.StartOfLineLevel != StartOfLineLevel) ..

Also cleaned up the function to be more consistent in the comparisons.

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