]> granicus.if.org Git - clang/log
clang
11 years agoRefine SourceManager's isBeforeInTranslationUnit() cache to have more entries.
Ted Kremenek [Wed, 27 Feb 2013 00:00:26 +0000 (00:00 +0000)]
Refine SourceManager's isBeforeInTranslationUnit() cache to have more entries.

isBeforeInTranslationUnit() uses a cache to reduce the expensive work
to compute a common ancestor for two FileIDs.  This work is very
expensive, so even caching the latest used FileIDs was a big win.
A closer analysis of the cache before, however, shows that the cache
access pattern would oscillate between a working set of FileIDs, and
thus caching more pairs would be profitable.

This patch adds a side table for extending caching.  This side table
is bounded in size (experimentally determined in this case from
a simple Objective-C project), and when the table gets too large
we fall back to the single entry caching before as before.

On Sketch (a small example Objective-C project), this optimization
reduces -fsyntax-only time on SKTGraphicView.m by 5%.  This is
for a project that is already using PCH.

Fixes <rdar://problem/13299847>

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

11 years agoUse existing macros to simplify the test a bit.
Rafael Espindola [Tue, 26 Feb 2013 23:24:59 +0000 (23:24 +0000)]
Use existing macros to simplify the test a bit.

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

11 years agoTemporarily revert r176133 until testcases are modified.
Bill Wendling [Tue, 26 Feb 2013 23:18:33 +0000 (23:18 +0000)]
Temporarily revert r176133 until testcases are modified.

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

11 years agoFix testcases to not rely upon target-* attributes.
Bill Wendling [Tue, 26 Feb 2013 23:08:48 +0000 (23:08 +0000)]
Fix testcases to not rely upon target-* attributes.

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

11 years agoDon't set the -target-cpu and -target-features attributes just now.
Bill Wendling [Tue, 26 Feb 2013 23:01:33 +0000 (23:01 +0000)]
Don't set the -target-cpu and -target-features attributes just now.

This is causing some problems with some of the builders. It's non-trivial to
reset the target's features.

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

11 years agoNo need to initialize these variables.
Chad Rosier [Tue, 26 Feb 2013 22:15:50 +0000 (22:15 +0000)]
No need to initialize these variables.

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

11 years agodoxygen command. Add 'attention' command to list of similar
Fariborz Jahanian [Tue, 26 Feb 2013 22:12:16 +0000 (22:12 +0000)]
doxygen command. Add 'attention' command to list of similar
doxygen commands. // rdar://12379053

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

11 years agoFix assertion failure when a field is given an address space.
Matt Arsenault [Tue, 26 Feb 2013 21:16:00 +0000 (21:16 +0000)]
Fix assertion failure when a field is given an address space.

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

11 years agoFix initializer for variables with attribute address_space set.
Matt Arsenault [Tue, 26 Feb 2013 21:15:54 +0000 (21:15 +0000)]
Fix initializer for variables with attribute address_space set.

This would error in C++ mode unless the variable also had a cv
qualifier.

e.g.

__attribute__((address_space(2))) float foo = 1.0f; would error but
__attribute__((address_space(2))) const float foo = 1.0f; would not.

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

11 years agoEnsure that DIType is regenerated after we visited an implementation that adds ivars...
Adrian Prantl [Tue, 26 Feb 2013 20:01:46 +0000 (20:01 +0000)]
Ensure that DIType is regenerated after we visited an implementation that adds ivars to an interface. Fixes rdar://13175234

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

11 years ago[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.
Ted Kremenek [Tue, 26 Feb 2013 19:44:38 +0000 (19:44 +0000)]
[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.

Fixes PR15358 and <rdar://problem/13295437>.

Along the way, shorten path diagnostics that say "Variable 'x'" to just
be "'x'".  By the context, it is obvious that we have a variable,
and so this just consumes text space.

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

11 years agoWarn on dropping the return value from a warn_unused_result function, even in
Matt Beaumont-Gay [Tue, 26 Feb 2013 19:34:08 +0000 (19:34 +0000)]
Warn on dropping the return value from a warn_unused_result function, even in
macros.

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

11 years agoUse the most recent decl in getExplicitVisibility.
Rafael Espindola [Tue, 26 Feb 2013 19:33:14 +0000 (19:33 +0000)]
Use the most recent decl in getExplicitVisibility.

Now that implicitly hidden template arguments can make an instantiation hidden,
it is important to look at more than just the canonical decl of the argument
in order to see if an attribute is available in a more recent decl.

This has the disadvantage of exposing when getExplicitVisibility is called,
but lets us handle cases like

template <typename T>
struct __attribute__((visibility("default"))) barT {
  static void zed() {}
};
class foo;
class __attribute__((visibility("default"))) foo;
template struct barT<foo>;

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

11 years agoBe more careful in applying pragma weak. Fixes pr14974.
Rafael Espindola [Tue, 26 Feb 2013 19:13:56 +0000 (19:13 +0000)]
Be more careful in applying pragma weak. Fixes pr14974.

GCC applies a pragma weak to a decl if it matches the mangled name. We used
to apply if it matched the plain name.

This patch is a compromise: we apply the pragma only if it matches the name
and the decl has C language linkage.

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

11 years agoFix bad line break decision.
Daniel Jasper [Tue, 26 Feb 2013 13:59:14 +0000 (13:59 +0000)]
Fix bad line break decision.

Before:
if (Intervals[i].getRange().getFirst() < Intervals[i - 1]
                                             .getRange().getLast()) {}

After:
if (Intervals[i].getRange().getFirst() <
    Intervals[i - 1].getRange().getLast()) {}

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

11 years agoAllow dash before "ld" in android driver test.
Evgeniy Stepanov [Tue, 26 Feb 2013 13:20:29 +0000 (13:20 +0000)]
Allow dash before "ld" in android driver test.

Sometimes android linker is "arm-linux-androideabi-ld", and not just "ld".

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

11 years agoIn range-based for-loops, prefer splitting after ":".
Daniel Jasper [Tue, 26 Feb 2013 13:18:08 +0000 (13:18 +0000)]
In range-based for-loops, prefer splitting after ":".

Before:
for (const aaaaaaaaaaaaaaaaaaaaa &
         aaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

After:
for (const aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaa :
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

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

11 years agoOnly keep empty lines in unwrapped lines if they preceed a line comment.
Daniel Jasper [Tue, 26 Feb 2013 13:10:34 +0000 (13:10 +0000)]
Only keep empty lines in unwrapped lines if they preceed a line comment.

Empty lines followed by line comments are often used to highlight the
comment. Empty lines somewhere else are usually left over from manual or
automatic formatting and should probably be removed.

Before (clang-format would keep):
S s = {
  a,

  b
};

After:
S s = { a, b };

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

11 years agoOnly break string literals as a last resort.
Daniel Jasper [Tue, 26 Feb 2013 12:52:34 +0000 (12:52 +0000)]
Only break string literals as a last resort.

We might want to move towards doing this if the formatting can be
significantly improved, but we need to carefully evaluate the different
situations first.

Before (the string literal was split by clang-format here):
aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa "
                                                  "aaaaa aaa aaa aaaaaa"));

After:
aaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaa,
    aaaaaa("aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa"));

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

11 years agoDefine CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ subdirectory...
Alexey Samsonov [Tue, 26 Feb 2013 09:43:27 +0000 (09:43 +0000)]
Define CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ subdirectory. Otherwise, while configuring the build tree for the first time, Clang unit tests could avoid being added to 'check-clang' command, and thus avoid being built and executed.

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

11 years agoUnify clang/llvm attributes for asan/tsan/msan (Clang part)
Kostya Serebryany [Tue, 26 Feb 2013 06:58:27 +0000 (06:58 +0000)]
Unify clang/llvm attributes for asan/tsan/msan (Clang part)

These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

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

11 years agoUpdate tests to do a full match against printed C++11 attributes.
Michael Han [Tue, 26 Feb 2013 02:00:13 +0000 (02:00 +0000)]
Update tests to do a full match against printed C++11 attributes.

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

11 years ago[analyzer] Don't look through casts when creating pointer temporaries.
Jordan Rose [Tue, 26 Feb 2013 01:21:27 +0000 (01:21 +0000)]
[analyzer] Don't look through casts when creating pointer temporaries.

Normally, we need to look through derived-to-base casts when creating
temporary object regions (added in r175854). However, if the temporary
is a pointer (rather than a struct/class instance), we need to /preserve/
the base casts that have been applied.

This also ensures that we really do create a new temporary region when
we need to: MaterializeTemporaryExpr and lvalue CXXDefaultArgExprs.

Fixes PR15342, although the test case doesn't include the crash because
I couldn't isolate it.

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

11 years ago[analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.
Jordan Rose [Tue, 26 Feb 2013 01:21:21 +0000 (01:21 +0000)]
[analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.

With the new support for trivial copy constructors, we are not always
consistent about whether a CXXTempObjectRegion gets reused or created
from scratch, which affects whether qualifiers are preserved. However,
we probably don't care anyway.

This also switches to using the current PrintingPolicy for the type,
which means C++ types don't get a spurious 'struct' prefix anymore.

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

11 years ago[ubsan] Emit single check for left shift.
Will Dietz [Mon, 25 Feb 2013 22:37:49 +0000 (22:37 +0000)]
[ubsan] Emit single check for left shift.

Avoids warning twice on same shift.

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

11 years ago[analyzer] Restrict ObjC type inference to methods that have related result type.
Anna Zaks [Mon, 25 Feb 2013 22:10:34 +0000 (22:10 +0000)]
[analyzer] Restrict ObjC type inference to methods that have related result type.

This addresses a case when we inline a wrong method due to incorrect
dynamic type inference. Specifically, when user code contains a method from init
family, which creates an instance of another class.

Use hasRelatedResultType() to find out if our inference rules should be triggered.

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

11 years ago[analyzer] Recover all PreStmtPurgeDeadSymbols nodes with a single successor or prede...
Ted Kremenek [Mon, 25 Feb 2013 21:32:40 +0000 (21:32 +0000)]
[analyzer] Recover all PreStmtPurgeDeadSymbols nodes with a single successor or predecessor.

These nodes are never consulted by any analyzer client code, so they are
used only for machinery for removing dead bindings.  Once successor nodes
are generated they can be safely removed.

This greatly reduces the amount of nodes that are generated in some case,
lowering the memory regression when analyzing Sema.cpp introduced by
r176010 from 14% to 2%.

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

11 years agoVarious additions to ASTMatcher library:
Edwin Vane [Mon, 25 Feb 2013 20:43:32 +0000 (20:43 +0000)]
Various additions to ASTMatcher library:

New type matchers:
* recordType
* elaboratedType

New narrowing matchers:
* hasQualifier
* namesType
* hasDeclContext

Added tests and updated LibASTMatchersReference.

Reviewers: klimek

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

11 years agoRevert "Add more attributes from the command line to functions."
Anna Zaks [Mon, 25 Feb 2013 19:51:03 +0000 (19:51 +0000)]
Revert "Add more attributes from the command line to functions."

This reverts commit 176009.

The commit is a likely cause of several buildbot failures.

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

11 years ago[analyzer] Address Jordan's code review of r175857.
Anna Zaks [Mon, 25 Feb 2013 19:50:50 +0000 (19:50 +0000)]
[analyzer] Address Jordan's code review of r175857.

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

11 years ago[analyzer] Handle reference parameters with default values.
Jordan Rose [Mon, 25 Feb 2013 19:45:34 +0000 (19:45 +0000)]
[analyzer] Handle reference parameters with default values.

r175026 added support for default values, but didn't take reference
parameters into account, which expect the default argument to be an
lvalue. Use createTemporaryRegionIfNeeded if we can evaluate the default
expr as an rvalue but the expected result is an lvalue.

Fixes the most recent report of PR12915. The original report predates
default argument support, so that can't be it.

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

11 years agoAdd a front-end test case for r176036.
Chad Rosier [Mon, 25 Feb 2013 19:13:23 +0000 (19:13 +0000)]
Add a front-end test case for r176036.

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

11 years agoFix empty declaration printing.
Michael Han [Mon, 25 Feb 2013 18:40:11 +0000 (18:40 +0000)]
Fix empty declaration printing.

Don't print the semicolon when visiting an empty declaration because the semicolon
will be printed as a terminator later.

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

11 years ago[analyzer] Base regions may be invalid when layered on symbolic regions.
Jordan Rose [Mon, 25 Feb 2013 18:36:15 +0000 (18:36 +0000)]
[analyzer] Base regions may be invalid when layered on symbolic regions.

While RegionStore checks to make sure casts on TypedValueRegions are valid,
it does not do the same for SymbolicRegions, which do not have perfect type
info anyway. Additionally, MemRegion::getAsOffset does not take a
ProgramState, so it can't use dynamic type info to determine a better type
for the regions. (This could also be dangerous if the type of a super-region
changes!)

Account for this by checking that a base object region is valid on top of a
symbolic region, and falling back to "symbolic offset" mode if not.

Fixes PR15345.

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

11 years agoAdd forgotten testcase.
Eric Christopher [Mon, 25 Feb 2013 18:19:32 +0000 (18:19 +0000)]
Add forgotten testcase.

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

11 years agoRe-add hack that caused regression.
Daniel Jasper [Mon, 25 Feb 2013 15:59:54 +0000 (15:59 +0000)]
Re-add hack that caused regression.

This fixes llvm.org/PR15350.

Before:
Constructor(int Parameter = 0)
    : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa),
                aaaaaaaaaaaa(aaaaaaaaaaaaaaaaa) {}

After:
Constructor(int Parameter = 0)
    : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa),
      aaaaaaaaaaaa(aaaaaaaaaaaaaaaaa) {}

I think the correct solution is to put the VariablePos into
ParenState, not LineState. Added FIXME.

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

11 years agoAdding hasDeclaration overload for TemplateSpecializationType
Edwin Vane [Mon, 25 Feb 2013 14:49:29 +0000 (14:49 +0000)]
Adding hasDeclaration overload for TemplateSpecializationType

TemplateSpecializationType doesn't quite have getDecl(). Need to go
through TemplateName to get a TemplateDecl.

Added test cases for the hasDeclaration() overload for
TemplateSpecializationType. Also introduced the type matcher
templateSpecializationType() used by the new hasDeclaration() test case.

Updated LibASTMatchersReference.

Reviewers: klimek

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

11 years agoSupport in hasDeclaration for types with getDecl()
Edwin Vane [Mon, 25 Feb 2013 14:32:42 +0000 (14:32 +0000)]
Support in hasDeclaration for types with getDecl()

Re-introducing r175532. The has_getDecl metafunction didn't compile with
Visual Studio. This revision uses approaches has_getDecl from a
different angle that isn't a problem for Visual Studio.

Added dedicated tests for the metafunction.

Reviewers: klimek

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

11 years agoReverting r176019. Corrupt patch.
Edwin Vane [Mon, 25 Feb 2013 14:09:28 +0000 (14:09 +0000)]
Reverting r176019. Corrupt patch.

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

11 years agoSupport in hasDeclaration for types with getDecl()
Edwin Vane [Mon, 25 Feb 2013 13:59:06 +0000 (13:59 +0000)]
Support in hasDeclaration for types with getDecl()

Re-introducing r175532. The has_getDecl metafunction didn't compile with Visual
Studio. This revision approaches has_getDecl from a different angle that isn't
a problem for Visual Studio.

Added dedicated tests for the metafunction.

Reviewers: klimek

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

11 years agoUpdate generated documentation after recent matcher addition.
Daniel Jasper [Mon, 25 Feb 2013 12:39:41 +0000 (12:39 +0000)]
Update generated documentation after recent matcher addition.

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

11 years agoAdd matcher for AccessSpecDecls.
Daniel Jasper [Mon, 25 Feb 2013 12:02:08 +0000 (12:02 +0000)]
Add matcher for AccessSpecDecls.

Also, add matchers isPrivate(), isProtected() and isPublic(), that
restrict the matching of such AccessSpecDecls and all other Decls.

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

11 years ago[analyzer] Relax assumption in FindLastStoreBRVisitor that the thing we are looking...
Ted Kremenek [Mon, 25 Feb 2013 07:37:18 +0000 (07:37 +0000)]
[analyzer] Relax assumption in FindLastStoreBRVisitor that the thing we are looking for is always a VarRegion.

This was triggering assertion failures when analyzing the LLVM codebase.  This
is fallout from r175988.

I've got delta chewing away on a test case, but I wanted the fix to go
in now.

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

11 years ago[analyzer] add the notion of an "interesting" lvalue expression for ExplodedNode...
Ted Kremenek [Mon, 25 Feb 2013 07:37:13 +0000 (07:37 +0000)]
[analyzer] add the notion of an "interesting" lvalue expression for ExplodedNode pruning.

r175988 modified the ExplodedGraph trimming algorithm to retain all
nodes for "lvalue" expressions.  This patch refines that notion to
only "interesting" expressions that would be used for diagnostics.

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

11 years agoAdd more attributes from the command line to functions.
Bill Wendling [Mon, 25 Feb 2013 07:15:16 +0000 (07:15 +0000)]
Add more attributes from the command line to functions.

This is an ongoing process. Any command line option which a back-end cares about
should be added here.

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

11 years agoDocumentation: add an idea for a (weird) clang tool
Dmitri Gribenko [Mon, 25 Feb 2013 01:14:45 +0000 (01:14 +0000)]
Documentation: add an idea for a (weird) clang tool

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

11 years agoUpdate Clang for a minor DIBuilder breaking change.
David Blaikie [Mon, 25 Feb 2013 01:07:08 +0000 (01:07 +0000)]
Update Clang for a minor DIBuilder breaking change.

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

11 years agoMoving initialization into the initializer list and correcting capitalization, as...
Aaron Ballman [Sun, 24 Feb 2013 19:08:10 +0000 (19:08 +0000)]
Moving initialization into the initializer list and correcting capitalization, as suggested by Chandler.

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

11 years agoDocumentation: add an idea for an automatic refactoring
Dmitri Gribenko [Sun, 24 Feb 2013 19:04:36 +0000 (19:04 +0000)]
Documentation: add an idea for an automatic refactoring

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

11 years agoAllow breaking between a type and name in variable declarations.
Daniel Jasper [Sun, 24 Feb 2013 18:54:32 +0000 (18:54 +0000)]
Allow breaking between a type and name in variable declarations.

This fixes llvm.org/PR14967 and is generall necessary to avoid
situations where the column limit is exceeded. The challenge is
restricting such lines splits, otherwise clang-format suddenly starts
breaking at bad places.

Before:
ReallyLongReturnType<TemplateParam1, TemplateParam2>
ReallyReallyLongFunctionName(
    const std::string &SomeParameter,
    const SomeType<string,
                   SomeOtherTemplateParameter> &ReallyReallyLongParameterName,
    const SomeType<string,
                   SomeOtherTemplateParameter> &AnotherLongParameterName) {}

After:
ReallyLongReturnType<TemplateParam1, TemplateParam2>
ReallyReallyLongFunctionName(
    const std::string &SomeParameter,
    const SomeType<string, SomeOtherTemplateParameter> &
        ReallyReallyLongParameterName,
    const SomeType<string, SomeOtherTemplateParameter> &
        AnotherLongParameterName) {}

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

11 years agoAdd the testcase from PR13573, this used to crash.
Benjamin Kramer [Sun, 24 Feb 2013 15:51:32 +0000 (15:51 +0000)]
Add the testcase from PR13573, this used to crash.

The error is a bit strange tbh, but better than crashing.

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

11 years ago[analyzer] tracking stores/constraints now works for ObjC ivars or struct fields.
Ted Kremenek [Sun, 24 Feb 2013 07:21:01 +0000 (07:21 +0000)]
[analyzer] tracking stores/constraints now works for ObjC ivars or struct fields.

This required more changes than I originally expected:

- ObjCIvarRegion implements "canPrintPretty" et al
- DereferenceChecker indicates the null pointer source is an ivar
- bugreporter::trackNullOrUndefValue() uses an alternate algorithm
  to compute the location region to track by scouring the ExplodedGraph.
  This allows us to get the actual MemRegion for variables, ivars,
  fields, etc.  We only hand construct a VarRegion for C++ references.
- ExplodedGraph no longer drops nodes for expressions that are marked
  'lvalue'.  This is to facilitate the logic in the previous bullet.
  This may lead to a slight increase in size in the ExplodedGraph,
  which I have not measured, but it is likely not to be a big deal.

I have validated each of the changed plist output.

Fixes <rdar://problem/12114812>

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

11 years agoAdd "KnownSVal" to represent SVals that cannot be UnknownSVal.
Ted Kremenek [Sun, 24 Feb 2013 07:20:53 +0000 (07:20 +0000)]
Add "KnownSVal" to represent SVals that cannot be UnknownSVal.

This provides a few sundry cleanups, and allows us to provide
a compile-time check for a case that was a runtime assertion.

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

11 years agoAdd regression test for serialized diagnostics for notes without locations.
Ted Kremenek [Sun, 24 Feb 2013 07:20:47 +0000 (07:20 +0000)]
Add regression test for serialized diagnostics for notes without locations.

This meant to be included in r175802.

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

11 years agoPR15338: Don't assert if -fsanitize=bounds sees array indexing on an incomplete
Richard Smith [Sun, 24 Feb 2013 01:56:24 +0000 (01:56 +0000)]
PR15338: Don't assert if -fsanitize=bounds sees array indexing on an incomplete
array type.

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

11 years ago[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
Argyrios Kyrtzidis [Sun, 24 Feb 2013 00:05:14 +0000 (00:05 +0000)]
[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where).

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

11 years agoAdd comments for the MacroDirective & MacroInfo classes.
Argyrios Kyrtzidis [Sun, 24 Feb 2013 00:05:05 +0000 (00:05 +0000)]
Add comments for the MacroDirective & MacroInfo classes.

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

11 years agoIn Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the consumer
Argyrios Kyrtzidis [Sun, 24 Feb 2013 00:05:01 +0000 (00:05 +0000)]
In Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the consumer
just using ASTConsumer::HandleCXXStaticMemberVarInstantiation(), don't pass it with
ASTConsumer::HandleTopLevelDecl.

ASTConsumer::HandleTopLevelDecl is intended for user-written top-level decls;
a consumer can treat an instantiated static data member however it wants of course.

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

11 years agoBetter formatting of conditional expressions.
Daniel Jasper [Sat, 23 Feb 2013 21:01:55 +0000 (21:01 +0000)]
Better formatting of conditional expressions.

In conditional expressions, if the condition is split over multiple
lines, also break before both operands.

This prevents formattings like:

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c;

Which are bad, because they suggestion incorrect operator precedence:

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
      (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c);

This lead to the discovery that the expression parser incorrectly
handled conditional operators and that it could also handle semicolons
(which in turn reduced the amount of special casing for for-loops). As a
side-effect, we can now apply the bin-packing configuration to the
sections of for-loops.

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

11 years agoReference the canonical commit (r175462) in the value casting release note.
David Blaikie [Sat, 23 Feb 2013 19:30:31 +0000 (19:30 +0000)]
Reference the canonical commit (r175462) in the value casting release note.

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

11 years agoDocument the value casting API changes.
David Blaikie [Sat, 23 Feb 2013 19:27:10 +0000 (19:27 +0000)]
Document the value casting API changes.

After changing the way several value inheritance hierarchies (TypeLoc,
CFGelement, ProgramPoint and SVal) handle casting, this documentation describes
how 3rd party code may need to be updated to compile with the new APIs.

As suggested by Sean Silva on cfe-dev.

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

11 years agoPrefer 'and' over '&' in comments.
David Blaikie [Sat, 23 Feb 2013 19:20:56 +0000 (19:20 +0000)]
Prefer 'and' over '&' in comments.

Post commit code review feedback from Matt Beaumont-Gay on r174248.

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

11 years agoShrink SmallPtrSet. It gets swapped a lot which copies the whole small part.
Benjamin Kramer [Sat, 23 Feb 2013 16:56:22 +0000 (16:56 +0000)]
Shrink SmallPtrSet. It gets swapped a lot which copies the whole small part.

Testing shows that it's empty in >99% of the cases and I couldn't find a case
where it contained more than 2 elements.

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

11 years agoAdd streamed versions of getQualifiedNameAsString.
Benjamin Kramer [Sat, 23 Feb 2013 13:53:57 +0000 (13:53 +0000)]
Add streamed versions of getQualifiedNameAsString.

Move the cold virtual method getNameForDiagnostic out of line.

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

11 years agoRemove data member MSAsmStmt::AsmLoc, wrongly hiding AsmStmt::AsmLoc.
Enea Zaffanella [Sat, 23 Feb 2013 12:27:19 +0000 (12:27 +0000)]
Remove data member MSAsmStmt::AsmLoc, wrongly hiding AsmStmt::AsmLoc.

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

11 years agoDon't recognize unnamed pointer parameters as casts.
Daniel Jasper [Sat, 23 Feb 2013 08:07:18 +0000 (08:07 +0000)]
Don't recognize unnamed pointer parameters as casts.

This fixes llvm.org/PR15061.

Before: virtual void f(int *)const;
After:  virtual void f(int *) const;

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

11 years agoAllow splitting between string literals and identifiers.
Daniel Jasper [Sat, 23 Feb 2013 07:46:38 +0000 (07:46 +0000)]
Allow splitting between string literals and identifiers.

Also don't break in long include directives as that is not desired.

We can now format:

  #include "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  #define LL_FORMAT "ll"
  printf("aaaaa: %d, bbbbbbbbb: %" LL_FORMAT "d, cccccccc: %" LL_FORMAT
         "d, ddddddddd: %" LL_FORMAT "d\n");

Before, this led to weird results.

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

11 years agoImplement __builtin_eh_return_data_regno() for ARM and MIPS.
Logan Chien [Sat, 23 Feb 2013 04:24:36 +0000 (04:24 +0000)]
Implement __builtin_eh_return_data_regno() for ARM and MIPS.

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

11 years agoclang/AST/Decl.h: Add "raw_ostream.h" to appease msvc.
NAKAMURA Takumi [Sat, 23 Feb 2013 03:59:16 +0000 (03:59 +0000)]
clang/AST/Decl.h: Add "raw_ostream.h" to appease msvc.

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

11 years agoubsan: Emit bounds checks for array indexing, vector indexing, and (in really simple...
Richard Smith [Sat, 23 Feb 2013 02:53:19 +0000 (02:53 +0000)]
ubsan: Emit bounds checks for array indexing, vector indexing, and (in really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information.

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

11 years agoTest that attribute(availability) doesn't override private_extern.
John McCall [Sat, 23 Feb 2013 01:15:17 +0000 (01:15 +0000)]
Test that attribute(availability) doesn't override private_extern.

rdar://12399248

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

11 years agoRemove the CFGElement "Invalid" state.
David Blaikie [Sat, 23 Feb 2013 00:29:34 +0000 (00:29 +0000)]
Remove the CFGElement "Invalid" state.

Use Optional<CFG*> where invalid states were needed previously. In the one case
where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy
CFGAutomaticObjDtor.

Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek
and Doug Gregor.

Post commit code review feedback on r175796 by Ted Kremenek.

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

11 years agoRemove the hack that avoided mangling static functions in extern C contexts.
Rafael Espindola [Sat, 23 Feb 2013 00:26:28 +0000 (00:26 +0000)]
Remove the hack that avoided mangling static functions in extern C contexts.

Weather we should give C language linkage to functions and variables with
internal linkage probably depends on how much code assumes it. The standard
says they should have no language linkage, but gcc and msvc assign them
C language linkage.

This commit removes the hack that was preventing the mangling on static
functions declare in extern C contexts. It is an experiment to see if we
can implement the rules in the standard.

If it turns out that many users depend on these functions and variables
having C language linkage, we should change isExternC instead and try
to convince the CWG to change the standard.

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

11 years agoRevert r175912, "Add support for coldcc to clang" at John's request.
Peter Collingbourne [Sat, 23 Feb 2013 00:06:18 +0000 (00:06 +0000)]
Revert r175912, "Add support for coldcc to clang" at John's request.

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

11 years agoPropagate the split dwarf file information through into the backend
Eric Christopher [Fri, 22 Feb 2013 23:50:16 +0000 (23:50 +0000)]
Propagate the split dwarf file information through into the backend
and through to the debug info in the module. In order to make the
testcase a bit more efficient allow the filename to go through
compilation for compile and not assemble jobs and turn off the
extract for cases where we don't create an object.

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

11 years ago[libclang] Fix assertion hit when code-completing inside a function macro with more
Argyrios Kyrtzidis [Fri, 22 Feb 2013 22:28:58 +0000 (22:28 +0000)]
[libclang] Fix assertion hit when code-completing inside a function macro with more
arguments than it should accept.

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

11 years agoobjective-C arg: provide fixit support when
Fariborz Jahanian [Fri, 22 Feb 2013 22:02:53 +0000 (22:02 +0000)]
objective-C arg: provide fixit support when
c++'s named cast need be replaced for bridge casting.
// rdar://12788838

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

11 years agoUpdate tests so that we don't test for function-only attributes on call sites.
Bill Wendling [Fri, 22 Feb 2013 21:12:51 +0000 (21:12 +0000)]
Update tests so that we don't test for function-only attributes on call sites.

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

11 years agoDriver: Pass down the -march setting down to -cc1as on x86 too.
Benjamin Kramer [Fri, 22 Feb 2013 20:55:17 +0000 (20:55 +0000)]
Driver: Pass down the -march setting down to -cc1as on x86 too.

The assembler historically didn't make use of any target features, but this has
changed when support for old CPUs that don't support long nops was added.

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

11 years agoMake sure we apply attributes to correct places.
Bill Wendling [Fri, 22 Feb 2013 20:53:29 +0000 (20:53 +0000)]
Make sure we apply attributes to correct places.

Some attributes make sense only on the function or on the call site, but not
both. Make this distinction here.

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

11 years agoSplit out the command handling for split debug info, we're going
Eric Christopher [Fri, 22 Feb 2013 20:12:52 +0000 (20:12 +0000)]
Split out the command handling for split debug info, we're going
to want to propagate some information through the module into
the back end and so need to pass it through to codegen.

Also make the methods file static so we can use them in other places.

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

11 years ago[analyzer] Don't canonicalize the RecordDecl used in CXXBaseObjectRegion.
Jordan Rose [Fri, 22 Feb 2013 19:33:13 +0000 (19:33 +0000)]
[analyzer] Don't canonicalize the RecordDecl used in CXXBaseObjectRegion.

This Decl shouldn't be the canonical Decl; it should be the Decl used by
the CXXBaseSpecifier in the subclass. Unfortunately, that means continuing
to throw getCanonicalDecl() on all comparisons.

This fixes MemRegion::getAsOffset's use of ASTRecordLayout when redeclarations
are involved.

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

11 years agoAdd support for coldcc to clang
Peter Collingbourne [Fri, 22 Feb 2013 19:24:35 +0000 (19:24 +0000)]
Add support for coldcc to clang

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

11 years ago[preprocessing record] Have the MacroDefinitions map point to the MacroDefinition...
Argyrios Kyrtzidis [Fri, 22 Feb 2013 18:35:59 +0000 (18:35 +0000)]
[preprocessing record] Have the MacroDefinitions map point to the MacroDefinition object instead
its index in the preprocessed entities vector.

This is because the order of the entities in the vector can change in some (uncommon) cases.

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

11 years agoReplace some typically large vectors with SmallVector.
Benjamin Kramer [Fri, 22 Feb 2013 18:29:39 +0000 (18:29 +0000)]
Replace some typically large vectors with SmallVector.

This may seem counter-intuitive but the POD-like optimization helps when the
vectors grow into multimegabyte buffers. SmallVector calls realloc which knows
how to twiddle virtual memory bits and avoids large copies.

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

11 years agoMake sure pragmas don't attach visibility attributes to auto variables with
Rafael Espindola [Fri, 22 Feb 2013 17:59:16 +0000 (17:59 +0000)]
Make sure pragmas don't attach visibility attributes to auto variables with
internal linkage.

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

11 years agoSuppress -Wswitch to unbreak the build.
David Blaikie [Fri, 22 Feb 2013 17:44:58 +0000 (17:44 +0000)]
Suppress -Wswitch to unbreak the build.

This may need to be fixed more intelligently - I don't have enough context to
be sure what the appropriate fix is right now.

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

11 years ago[Sema] Semantic analysis for empty-declaration and attribute-declaration.
Michael Han [Fri, 22 Feb 2013 17:15:32 +0000 (17:15 +0000)]
[Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.

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

11 years agoUse raw_ostream::indent, update comment.
Benjamin Kramer [Fri, 22 Feb 2013 16:13:34 +0000 (16:13 +0000)]
Use raw_ostream::indent, update comment.

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

11 years agoPush the raw_ostream through the template diffing code.
Benjamin Kramer [Fri, 22 Feb 2013 16:08:12 +0000 (16:08 +0000)]
Push the raw_ostream through the template diffing code.

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

11 years agoStreamify FormatASTNodeDiagnosticArgument.
Benjamin Kramer [Fri, 22 Feb 2013 15:46:08 +0000 (15:46 +0000)]
Streamify FormatASTNodeDiagnosticArgument.

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

11 years agoStreamify getNameForDiagnostic and remove the string versions of PrintTemplateArgumen...
Benjamin Kramer [Fri, 22 Feb 2013 15:46:01 +0000 (15:46 +0000)]
Streamify getNameForDiagnostic and remove the string versions of PrintTemplateArgumentList.

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

11 years agoComment parsing: add CommentOptions to allow specifying custom comment block commands
Dmitri Gribenko [Fri, 22 Feb 2013 14:21:27 +0000 (14:21 +0000)]
Comment parsing: add CommentOptions to allow specifying custom comment block commands

Add an ability to specify custom documentation block comment commands via a new
class CommentOptions.  The intention is that this class will hold future
customizations for comment parsing, including defining documentation comments
with specific numbers of parameters, etc.

CommentOptions instance is a member of LangOptions.

CommentOptions is controlled by a new command-line parameter
-fcomment-block-commands=Foo,Bar,Baz.

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

11 years agoStmtPrinter: Directly print types to the stream instead of taking a detour through...
Benjamin Kramer [Fri, 22 Feb 2013 14:19:01 +0000 (14:19 +0000)]
StmtPrinter: Directly print types to the stream instead of taking a detour through getAsString.

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

11 years agoFix MergeFunctionDecl implicit CC for static methods.
Timur Iskhodzhanov [Fri, 22 Feb 2013 12:42:50 +0000 (12:42 +0000)]
Fix MergeFunctionDecl implicit CC for static methods.

Patch by Alexander Zinenko!

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

11 years agoscan-build: Remove debug print.
Benjamin Kramer [Fri, 22 Feb 2013 12:07:39 +0000 (12:07 +0000)]
scan-build: Remove debug print.

PR15329.

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

11 years agoC++11 status page:
Richard Smith [Fri, 22 Feb 2013 09:31:00 +0000 (09:31 +0000)]
C++11 status page:
 * Mark attributes as done in SVN.
 * Downgrade alignment support from 'Clang 3.0' to 'SVN', now that we actually implement the rules.
 * Upgrade 'Dynamic initialization with concurrency' from 'No' to 'Clang 2.9' -- all that is required here is the ABI-mandated locking for the initialization of static locals.

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

11 years agoDon't crash if we try to apply 'alignas' to a variable declared with an
Richard Smith [Fri, 22 Feb 2013 09:21:42 +0000 (09:21 +0000)]
Don't crash if we try to apply 'alignas' to a variable declared with an
incomplete type.

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

11 years agoDon't accidentally and silently accept C++11 attributes in decl-specifier-seqs
Richard Smith [Fri, 22 Feb 2013 09:15:49 +0000 (09:15 +0000)]
Don't accidentally and silently accept C++11 attributes in decl-specifier-seqs
in C++98.

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

11 years agoUpdate to use references to attribute groups instead of listing the attributes on...
Bill Wendling [Fri, 22 Feb 2013 09:10:20 +0000 (09:10 +0000)]
Update to use references to attribute groups instead of listing the attributes on the call/invoke instructions.

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