]> granicus.if.org Git - clang/log
clang
12 years agoAdd a basic CallGraph to Analysis.
Anna Zaks [Thu, 8 Mar 2012 00:42:23 +0000 (00:42 +0000)]
Add a basic CallGraph to Analysis.

The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision.

The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph.

Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls.

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

12 years agoimprove on diagnostic and provide a fixit hint when
Fariborz Jahanian [Thu, 8 Mar 2012 00:22:50 +0000 (00:22 +0000)]
improve on diagnostic and provide a fixit hint when
an uninitialized block variable is being called inside the
block literal. // rdar://10817031

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

12 years ago[libclang] Enhance clang_getOverriddenCursors.
Argyrios Kyrtzidis [Thu, 8 Mar 2012 00:20:03 +0000 (00:20 +0000)]
[libclang] Enhance clang_getOverriddenCursors.

Basically the current design is:
-for an implementation method, show as overridden the interface method.
  This is not useful, and is inconsistent with the C++ side
-for an interface method, show as overridden the protocols methods (this is desirable)
  and the methods from the categories; methods from categories are not useful
  since they are considered the same method (same USR).
-If there is a protocol method or category method reported, it does not check the
  super class for overridden methods. This is really problematic since
  overridden methods from super class is what we want to give back.

Change clang_getOverriddenCursors to show as overridden any method in the class's
base class, its protocols, or its categories' protocols, that has the same
selector and is of the same kind (class or instance).
If no such method exists, the search continues to the class's superclass,
its protocols, and its categories, and so on. A method from an Objective-C
implementation is considered to override the same methods as its
corresponding method in the interface.

rdar://10967206

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

12 years agoWorkaround module test failures by removing the version info from module hashes.
Bob Wilson [Wed, 7 Mar 2012 23:50:05 +0000 (23:50 +0000)]
Workaround module test failures by removing the version info from module hashes.

PR12196: The module hash strings are not actually hashing the compiler version
string; the entire version string is being included in the hash.  Depending on
the module cache directory name, that can lead to failures where the path
names become too long.  As a temporary workaround, just remove the version
string from the hash.

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

12 years agoRemove unnecessary include in ExprObjC.h
Richard Trieu [Wed, 7 Mar 2012 17:47:10 +0000 (17:47 +0000)]
Remove unnecessary include in ExprObjC.h

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

12 years agoBe smarter in discovering list-initialization of temporaries. Fixes PR12182.
Sebastian Redl [Wed, 7 Mar 2012 16:10:45 +0000 (16:10 +0000)]
Be smarter in discovering list-initialization of temporaries. Fixes PR12182.

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

12 years agoCorrect the documentation to give a legal example of a raw string literal.
Richard Smith [Wed, 7 Mar 2012 08:57:31 +0000 (08:57 +0000)]
Correct the documentation to give a legal example of a raw string literal.

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

12 years agoAST representation for user-defined literals, plus just enough of semantic
Richard Smith [Wed, 7 Mar 2012 08:35:16 +0000 (08:35 +0000)]
AST representation for user-defined literals, plus just enough of semantic
analysis to make the AST representation testable. They are represented by a
new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic
properties, including full CodeGen support, are achieved for free by this
representation.

UserDefinedLiterals can never be dependent, so no custom instantiation
behavior is required. They are mangled as if they were direct calls to the
underlying literal operator. This matches g++'s apparent behavior (but not its
actual mangling, which is broken for literal-operator-ids).

User-defined *string* literals are now fully-operational, but the semantic
analysis is quite hacky and needs more work. No other forms of user-defined
literal are created yet, but the AST support for them is present.

This patch committed after midnight because we had already hit the quota for
new kinds of literal yesterday.

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

12 years agoTest fix-it added in r152198.
Richard Smith [Wed, 7 Mar 2012 03:18:34 +0000 (03:18 +0000)]
Test fix-it added in r152198.

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

12 years agoAdd -Wc++11-compat warning for string and character literals followed by
Richard Smith [Wed, 7 Mar 2012 03:13:00 +0000 (03:13 +0000)]
Add -Wc++11-compat warning for string and character literals followed by
identifiers, in cases where those identifiers would be treated as
user-defined literal suffixes in C++11.

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

12 years agoDon't even try to directly emit the value of a DeclRefExpr if that declaration
Richard Smith [Wed, 7 Mar 2012 01:58:44 +0000 (01:58 +0000)]
Don't even try to directly emit the value of a DeclRefExpr if that declaration
is not usable in a constant expression. ~2.5% speedup on 403.gcc / combine.c.

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

12 years ago[PCH] Mark a PCH file with a flag to indicate if the serialized AST had
Argyrios Kyrtzidis [Wed, 7 Mar 2012 01:51:17 +0000 (01:51 +0000)]
[PCH] Mark a PCH file with a flag to indicate if the serialized AST had
compiler errors or not.

-Control whether ASTReader should reject such a PCH by a boolean flag at ASTReader's creation time.
By default, such a PCH file will be rejected with an error when trying to load it.

[libclang] Allow clang_saveTranslationUnit to create a PCH file even if compiler errors
occurred.
-Have libclang API calls accept a PCH that had compiler errors.

The general idea is that we want libclang to stay functional even if a PCH had a compiler error.
rdar://10976363.

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

12 years agoCorrect test from r152189.
Eli Friedman [Wed, 7 Mar 2012 01:13:38 +0000 (01:13 +0000)]
Correct test from r152189.

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

12 years agoMake sure we consistently canonicalize types when canonicalizing TemplateTemplateParm...
Eli Friedman [Wed, 7 Mar 2012 01:09:33 +0000 (01:09 +0000)]
Make sure we consistently canonicalize types when canonicalizing TemplateTemplateParmDecls.  PR12179.

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

12 years agoobjective-c lldb support: don't perform ivar access control check
Fariborz Jahanian [Wed, 7 Mar 2012 00:58:41 +0000 (00:58 +0000)]
objective-c lldb support: don't perform ivar access control check
when debugging. // rdar://10997647

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

12 years agoMore git-svn compatible version string, by request.
Andrew Trick [Wed, 7 Mar 2012 00:44:24 +0000 (00:44 +0000)]
More git-svn compatible version string, by request.

If you're using git-svn, the clang and llvm repository will typically
map to a different revision.

Before we had:
clang version 3.1 (trunk 152167 trunk 152162)

After this change:
clang version 3.1 (trunk 152167) (llvm/trunk 152162)

So it's self-descriptive with an extra parens group. Which is more
compatible with version string parsers is probably debatable, but this
style was requested.

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

12 years agoThe constant folder's diagnosic mechanism is irrelevant for C; don't bother
Richard Smith [Wed, 7 Mar 2012 00:30:44 +0000 (00:30 +0000)]
The constant folder's diagnosic mechanism is irrelevant for C; don't bother
producing a C-only diagnostic.

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

12 years ago[driver] Don't try to generate diagnostic information for linker crashes.
Chad Rosier [Wed, 7 Mar 2012 00:30:40 +0000 (00:30 +0000)]
[driver] Don't try to generate diagnostic information for linker crashes.
rdar://10993648

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

12 years agoSilence unused variable warnings.
Benjamin Kramer [Wed, 7 Mar 2012 00:14:40 +0000 (00:14 +0000)]
Silence unused variable warnings.

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

12 years agoRefactor Clang sema attribute handling.
Michael Han [Wed, 7 Mar 2012 00:12:16 +0000 (00:12 +0000)]
Refactor Clang sema attribute handling.

This submission improves Clang sema handling by using Clang tablegen
to generate common boilerplate code. As a start, it implements AttributeList
enumerator generation and case statements for AttributeList::getKind.

A new field "SemaHandler" is introduced in Attr.td and by default set to 1
as most of attributes in Attr.td have semantic checking in Sema. For a small
number of attributes that don't appear in Sema, the value is set to 0.

Also there are a small number of attributes that only appear in Sema but not
in Attr.td. Currently these attributes are still hardcoded in Sema AttributeList.

Reviewed by Delesley Hutchins.

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

12 years agoAST: fix build since r152060
Dylan Noblesmith [Wed, 7 Mar 2012 00:01:18 +0000 (00:01 +0000)]
AST: fix build since r152060

The declarations of the operators no longer matched.
The definitions in ASTContext.h had 'throw()' removed,
but it was still present in Attr.h.

Somehow the buildbots missed this. clang merely warns about
a missing 'throw()' specification and suggested a Fix-It adding
it back, but gcc 4.5 is not so forgiving and gives an error.

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

12 years ago[AST] VarDecl::hasDefinition() - Early exit if we find a strong definition.
Daniel Dunbar [Tue, 6 Mar 2012 23:52:46 +0000 (23:52 +0000)]
[AST] VarDecl::hasDefinition() - Early exit if we find a strong definition.

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

12 years ago[AST] FunctionDecl::getBuiltinID() - Eliminate spurious calls to getASTContext
Daniel Dunbar [Tue, 6 Mar 2012 23:52:37 +0000 (23:52 +0000)]
[AST] FunctionDecl::getBuiltinID() - Eliminate spurious calls to getASTContext
-- which is very much not free -- in the common case.

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

12 years agoFix horrific CFG bug where '@autoreleasepool' would be put in a dangling block in...
Ted Kremenek [Tue, 6 Mar 2012 23:40:47 +0000 (23:40 +0000)]
Fix horrific CFG bug where '@autoreleasepool' would be put in a dangling block in the CFG.

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

12 years agoMissing period.
Chad Rosier [Tue, 6 Mar 2012 23:19:26 +0000 (23:19 +0000)]
Missing period.

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

12 years agoWhitespace.
Chad Rosier [Tue, 6 Mar 2012 23:14:35 +0000 (23:14 +0000)]
Whitespace.

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

12 years agoCleanup (style). Thanks to Argyrios for catching
Sean Callanan [Tue, 6 Mar 2012 23:12:57 +0000 (23:12 +0000)]
Cleanup (style).  Thanks to Argyrios for catching
this.

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

12 years agocommit access verified, revert change
Michael Han [Tue, 6 Mar 2012 22:55:51 +0000 (22:55 +0000)]
commit access verified, revert change

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

12 years agotest commit access
Michael Han [Tue, 6 Mar 2012 22:53:15 +0000 (22:53 +0000)]
test commit access

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

12 years agoCMake: Fix build to add clangEdit to USED_LIBS.
NAKAMURA Takumi [Tue, 6 Mar 2012 22:32:32 +0000 (22:32 +0000)]
CMake: Fix build to add clangEdit to USED_LIBS.

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

12 years ago[objcmt] Add a triple to test/ARCMT/objcmt-subscripting-literals.m
Argyrios Kyrtzidis [Tue, 6 Mar 2012 22:03:39 +0000 (22:03 +0000)]
[objcmt] Add a triple to test/ARCMT/objcmt-subscripting-literals.m

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

12 years agoExtended the UnknownAnyTy resolver to handle
Sean Callanan [Tue, 6 Mar 2012 21:34:12 +0000 (21:34 +0000)]
Extended the UnknownAnyTy resolver to handle
blocks with unknown return types.  This allows
LLDB to call blocks even when their return types
aren't provided in the debug information.

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

12 years agoget rid of an unsued variable warning.
Fariborz Jahanian [Tue, 6 Mar 2012 21:18:56 +0000 (21:18 +0000)]
get rid of an unsued variable warning.

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

12 years ago[driver] What was implemented in r152130 was actually -fno-inline-functions, not
Chad Rosier [Tue, 6 Mar 2012 21:17:19 +0000 (21:17 +0000)]
[driver] What was implemented in r152130 was actually -fno-inline-functions, not
-fno-inline.
Part of rdar://10972766

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

12 years agoJust use memcpy directly, uninitialized_copy requires an <algorithm> include.
Benjamin Kramer [Tue, 6 Mar 2012 20:39:11 +0000 (20:39 +0000)]
Just use memcpy directly, uninitialized_copy requires an <algorithm> include.

Newer libstdc++s don't include it transitively everywhere.

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

12 years agoAdd new code migrator support for migrating existing Objective-C code to use
Ted Kremenek [Tue, 6 Mar 2012 20:06:33 +0000 (20:06 +0000)]
Add new code migrator support for migrating existing Objective-C code to use
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax.

This introduces a new library, libEdit, which provides a new way to support
migration of code that improves on the original ARC migrator.  We now believe
that most of its functionality can be refactored into the existing libraries,
and thus this new library may shortly disappear.

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

12 years agoEnable default @synthesize by default.
Ted Kremenek [Tue, 6 Mar 2012 20:06:15 +0000 (20:06 +0000)]
Enable default @synthesize by default.

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

12 years agoAdd static analyzer support for new NSArray/NSDictionary/NSNumber literals.
Ted Kremenek [Tue, 6 Mar 2012 20:06:12 +0000 (20:06 +0000)]
Add static analyzer support for new NSArray/NSDictionary/NSNumber literals.

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

12 years agoAnd libclang cursor/indexing support for new Objective-C NSArray/NSDictionary/NSNumbe...
Ted Kremenek [Tue, 6 Mar 2012 20:06:06 +0000 (20:06 +0000)]
And libclang cursor/indexing support for new Objective-C NSArray/NSDictionary/NSNumber literals.

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

12 years agoAdd clang support for new Objective-C literal syntax for NSDictionary, NSArray,
Ted Kremenek [Tue, 6 Mar 2012 20:05:56 +0000 (20:05 +0000)]
Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals.  This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch.  It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

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

12 years agoWhitespace.
Chad Rosier [Tue, 6 Mar 2012 19:14:53 +0000 (19:14 +0000)]
Whitespace.

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

12 years agoMinor fix for r152130. Put -fno-inline in f_Group.
Chad Rosier [Tue, 6 Mar 2012 19:02:54 +0000 (19:02 +0000)]
Minor fix for r152130. Put -fno-inline in f_Group.

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

12 years ago[driver] Add support for -fno-inline.
Chad Rosier [Tue, 6 Mar 2012 18:49:20 +0000 (18:49 +0000)]
[driver] Add support for -fno-inline.
rdar://10972766

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

12 years agoUndo patch for // rdar://10735698
Fariborz Jahanian [Tue, 6 Mar 2012 18:41:35 +0000 (18:41 +0000)]
Undo patch for // rdar://10735698

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

12 years agoAST: Move several Type::is...Type() functions to be inline.
Daniel Dunbar [Tue, 6 Mar 2012 18:20:20 +0000 (18:20 +0000)]
AST: Move several Type::is...Type() functions to be inline.
 - These functions are both (a) very commonly called and (b) excellent
   candidates for CSE in the callers in which they are commonly used.
 - That isHalfType() is hot makes me sad, but it is trivially when inlined (and
   a huge waste of time when not!!!).
 - The extra IsEnumDeclComplete() function is a hack to break the cycle between
   Type.h and Decl.h, I'm not sure of how to do this more cleanly, but am open
   to ideas.

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

12 years agoNamespaceDecl: Call non-virtual method inside virtual method, not the other way round.
Benjamin Kramer [Tue, 6 Mar 2012 18:07:25 +0000 (18:07 +0000)]
NamespaceDecl: Call non-virtual method inside virtual method, not the other way round.

Moves the virtual call out of a hot path during lookup, no other functionality change.

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

12 years agoobjective-c modern translator. Don't ignore unnamed bitfields
Fariborz Jahanian [Tue, 6 Mar 2012 17:16:27 +0000 (17:16 +0000)]
objective-c modern translator. Don't ignore unnamed bitfields
when rewriting.

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

12 years agoUse newly introduced const-goodness of TinyPtrVector.
Argyrios Kyrtzidis [Tue, 6 Mar 2012 07:15:06 +0000 (07:15 +0000)]
Use newly introduced const-goodness of TinyPtrVector.

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

12 years agoUser-defined literals: reject string and character UDLs in all places where the
Richard Smith [Tue, 6 Mar 2012 03:21:47 +0000 (03:21 +0000)]
User-defined literals: reject string and character UDLs in all places where the
grammar requires a string-literal and not a user-defined-string-literal. The
two constructs are still represented by the same TokenKind, in order to prevent
a combinatorial explosion of different kinds of token. A flag on Token tracks
whether a ud-suffix is present, in order to prevent clients from needing to look
at the token's spelling.

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

12 years agoUse TinyPtrVector instead of UsuallyTinyPtrVector.
Argyrios Kyrtzidis [Tue, 6 Mar 2012 03:00:11 +0000 (03:00 +0000)]
Use TinyPtrVector instead of UsuallyTinyPtrVector.

The latter is just a worse version of the former.

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

12 years agoMove clang/Basic/UsuallyTinyPtrVector.h to llvm/ADT/UsuallyTinyPtrVector.h.
Argyrios Kyrtzidis [Tue, 6 Mar 2012 02:09:28 +0000 (02:09 +0000)]
Move clang/Basic/UsuallyTinyPtrVector.h to llvm/ADT/UsuallyTinyPtrVector.h.

Depends on llvm commit r152090.

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

12 years ago[analyzer] add a diagnostic event when entering a call via inlining, within the calle...
Ted Kremenek [Tue, 6 Mar 2012 01:25:01 +0000 (01:25 +0000)]
[analyzer] add a diagnostic event when entering a call via inlining, within the callee, and add an edge.

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

12 years ago[analyzer] 'Looping back to the head of the loop' diagnostics are prunable.
Ted Kremenek [Tue, 6 Mar 2012 01:00:36 +0000 (01:00 +0000)]
[analyzer] 'Looping back to the head of the loop' diagnostics are prunable.

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

12 years agoMove include/clang/AST/UsuallyTinyPtrVector.h -> include/clang/Basic/UsuallyTinyPtrVe...
Argyrios Kyrtzidis [Tue, 6 Mar 2012 00:49:28 +0000 (00:49 +0000)]
Move include/clang/AST/UsuallyTinyPtrVector.h -> include/clang/Basic/UsuallyTinyPtrVector.h
and add an erase method to it.

Patch by Andrew Craik!

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

12 years ago[analyzer] Remove now-unused constant. No functionality change.
Jordy Rose [Tue, 6 Mar 2012 00:33:35 +0000 (00:33 +0000)]
[analyzer] Remove now-unused constant. No functionality change.

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

12 years ago[analyzer] Fix unnecessary dyn_cast_or_null. No functionality change.
Jordy Rose [Tue, 6 Mar 2012 00:28:20 +0000 (00:28 +0000)]
[analyzer] Fix unnecessary dyn_cast_or_null. No functionality change.

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

12 years agoAdd some doxygen comments.
Argyrios Kyrtzidis [Tue, 6 Mar 2012 00:16:36 +0000 (00:16 +0000)]
Add some doxygen comments.

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

12 years ago[tablegen] Make sure that the code that is determining the order of warning groups
Argyrios Kyrtzidis [Tue, 6 Mar 2012 00:00:38 +0000 (00:00 +0000)]
[tablegen] Make sure that the code that is determining the order of warning groups
is shared to avoid any "misalignment" if indices.

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

12 years agoTeak CallAndMessageChecker to only warn about uninitialized struct fields in call...
Ted Kremenek [Mon, 5 Mar 2012 23:57:14 +0000 (23:57 +0000)]
Teak CallAndMessageChecker to only warn about uninitialized struct fields in call arguments
when the called function is never inlined.

Fixes <rdar://problem/10977037>.

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

12 years ago[analyzer] Bump up the size of the functions that should be
Anna Zaks [Mon, 5 Mar 2012 23:54:55 +0000 (23:54 +0000)]
[analyzer]  Bump up the size of the functions that should be
considered for inlining to 200 BBs.

Setting the max to 10 BBs introduced several false negatives, we'll
reevaluate the setting later on along with other inlining heuristics.

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

12 years agoMinor refactoring for previous patch for // rdar://10735698
Fariborz Jahanian [Mon, 5 Mar 2012 23:38:41 +0000 (23:38 +0000)]
Minor refactoring for previous patch for // rdar://10735698

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

12 years agostatic_assert: Allow any string-literal as the message, not just a character
Richard Smith [Mon, 5 Mar 2012 23:20:05 +0000 (23:20 +0000)]
static_assert: Allow any string-literal as the message, not just a character
string literal, and adjust the diagnostic code to match. This also causes us
to escape any control characters in the message.

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

12 years agoTeach SimpleSValBuilder that (in the absence of more information) stack memory doesn...
Ted Kremenek [Mon, 5 Mar 2012 23:06:19 +0000 (23:06 +0000)]
Teach SimpleSValBuilder that (in the absence of more information) stack memory doesn't alias symbolic memory.  This is a heuristic/hack, but works well in practice.  Fixes <rdar://problem/10978247>.

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

12 years agoAST/stats: Don't effectively use an out-of-line function to return a static
Daniel Dunbar [Mon, 5 Mar 2012 21:42:49 +0000 (21:42 +0000)]
AST/stats: Don't effectively use an out-of-line function to return a static
bool. Ugh.

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

12 years agoASTContext: Don't use nothrow specifications on the new operators for allocating
Daniel Dunbar [Mon, 5 Mar 2012 21:02:05 +0000 (21:02 +0000)]
ASTContext: Don't use nothrow specifications on the new operators for allocating
from the ASTContext.
 - Doing so requires the compiler to generate null checks against the returned
   result, but the BumpPtrAllocator never returns null pointers.
 - The optimizer can usually eliminate such checks, but not always, so this
   gives us tighter codegen in some places.
 - It would be really nice if we could just use __builtin_unreachable or
   something to tell the optimizer that the allocator never returns null, but
   LLVM isn't currently that smart.

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

12 years ago[analyzer] Time the execution (per each TU) with -analyzer-stats.
Anna Zaks [Mon, 5 Mar 2012 20:53:59 +0000 (20:53 +0000)]
[analyzer] Time the execution (per each TU) with -analyzer-stats.

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

12 years agobuild/compiler-rt: Stop forcing off -integrated-as for compiler-rt builds.
Daniel Dunbar [Mon, 5 Mar 2012 20:19:03 +0000 (20:19 +0000)]
build/compiler-rt: Stop forcing off -integrated-as for compiler-rt builds.

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

12 years agoIf the element type of an initializer list has a destructor, make sure we check it...
Sebastian Redl [Mon, 5 Mar 2012 19:35:43 +0000 (19:35 +0000)]
If the element type of an initializer list has a destructor, make sure we check it. Fixes PR12178.

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

12 years agopatch to optionally warn for block implementations without explicit
Fariborz Jahanian [Mon, 5 Mar 2012 19:34:00 +0000 (19:34 +0000)]
patch to optionally warn for block implementations without explicit
return types that return non-void values. // rdar://10735698

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

12 years agoAdd MCRegisterInfo to the MCInstPrinter factory function interface.
Jim Grosbach [Mon, 5 Mar 2012 19:33:41 +0000 (19:33 +0000)]
Add MCRegisterInfo to the MCInstPrinter factory function interface.

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

12 years ago[analyzer] False positive in SelfInit - teach the checker about method
Anna Zaks [Mon, 5 Mar 2012 18:58:25 +0000 (18:58 +0000)]
[analyzer] False positive in SelfInit - teach the checker about method
calls with self as a parameter.

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

12 years ago[analyzer] Malloc should assume that ownership is transfered when
Anna Zaks [Mon, 5 Mar 2012 17:42:10 +0000 (17:42 +0000)]
[analyzer] Malloc should assume that ownership is transfered when
calling an ObjC method ending with 'NoCopy'.

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

12 years agoAvoid double lookup.
Benjamin Kramer [Mon, 5 Mar 2012 17:20:04 +0000 (17:20 +0000)]
Avoid double lookup.

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

12 years agoProperly handle non-canonical underlying types in
Peter Collingbourne [Mon, 5 Mar 2012 16:02:06 +0000 (16:02 +0000)]
Properly handle non-canonical underlying types in
ASTContext::getUnaryTransformType.  This can happen if, for example,
an enumeration's underlying type is a typedef.

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

12 years agoFix a -Wstring-plus-int warning.
Nico Weber [Mon, 5 Mar 2012 15:48:34 +0000 (15:48 +0000)]
Fix a -Wstring-plus-int warning.

Patch from Sean Silva <silvas@purdue.edu>!

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

12 years agoTargetInfo: create less temporary strings.
Benjamin Kramer [Mon, 5 Mar 2012 15:10:44 +0000 (15:10 +0000)]
TargetInfo: create less temporary strings.

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

12 years agoFix a small difference in sema and codegen views of what needs to be output.
Rafael Espindola [Mon, 5 Mar 2012 10:54:55 +0000 (10:54 +0000)]
Fix a small difference in sema and codegen views of what needs to be output.

In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.

This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.

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

12 years agoFix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not...
James Molloy [Mon, 5 Mar 2012 09:59:43 +0000 (09:59 +0000)]
Fix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not be seen to be in ::std::.

Migrate two other places where the same logic is used to use the helper function that already exists.

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

12 years ago[arcmt]
Argyrios Kyrtzidis [Mon, 5 Mar 2012 08:46:24 +0000 (08:46 +0000)]
[arcmt]
-Make sure we don't change to '__weak' a __block variable used as output.
-Make sure we don't apply __weak twice.

Fixes rdar://10520757&10521362

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

12 years ago[preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional...
Argyrios Kyrtzidis [Mon, 5 Mar 2012 05:48:17 +0000 (05:48 +0000)]
[preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional directives.

Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns
true if a given range intersects with a conditional directive block.

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

12 years ago[preprocessor] Enhance the preprocessor callbacks:
Argyrios Kyrtzidis [Mon, 5 Mar 2012 05:48:09 +0000 (05:48 +0000)]
[preprocessor] Enhance the preprocessor callbacks:

-Add location parameter for the directives callbacks
-Skip callbacks if the directive is inside a skipped range.
-Make sure the directive callbacks are invoked in source order.

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

12 years agoMore tests for r152012.
Richard Smith [Mon, 5 Mar 2012 04:06:25 +0000 (04:06 +0000)]
More tests for r152012.

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

12 years agoLexing support for user-defined literals. Currently these lex as the same token
Richard Smith [Mon, 5 Mar 2012 04:02:15 +0000 (04:02 +0000)]
Lexing support for user-defined literals. Currently these lex as the same token
kinds as the underlying string literals, and we silently drop the ud-suffix;
those issues will be fixed by subsequent patches.

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

12 years ago[clang.py] Return bool from Cursor.__eq__
Gregory Szorc [Mon, 5 Mar 2012 00:42:15 +0000 (00:42 +0000)]
[clang.py] Return bool from Cursor.__eq__

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

12 years agoRemove a recursive visitation in ExprEngine that is no longer needed because the...
Erik Verbruggen [Sun, 4 Mar 2012 18:12:21 +0000 (18:12 +0000)]
Remove a recursive visitation in ExprEngine that is no longer needed because the CFG is fully linearized.

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

12 years agoSilence a GCC warning about a set-but-not-used variable in release builds.
Chandler Carruth [Sun, 4 Mar 2012 12:16:40 +0000 (12:16 +0000)]
Silence a GCC warning about a set-but-not-used variable in release builds.

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

12 years agoAdd tests for [over.literal]. Fix a few bugs which were exposed by the tests.
Richard Smith [Sun, 4 Mar 2012 09:41:16 +0000 (09:41 +0000)]
Add tests for [over.literal]. Fix a few bugs which were exposed by the tests.

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

12 years agoFrom his comment in PR12168, Eli seems confused about the alignment assumptions
Chris Lattner [Sun, 4 Mar 2012 00:56:24 +0000 (00:56 +0000)]
From his comment in PR12168, Eli seems confused about the alignment assumptions
we're making.  We only ignore implicit casts.  Add a testcase showing that
we get the right behavior with explicit casts.

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

12 years agoadd a testcase for PR12094 and fix a crash on pointer to incomplete type,
Chris Lattner [Sun, 4 Mar 2012 00:52:12 +0000 (00:52 +0000)]
add a testcase for PR12094 and fix a crash on pointer to incomplete type,
reported by Richard Smith.

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

12 years agoAdd a pile of tests for unrestricted unions, and advertise support for them.
Richard Smith [Sat, 3 Mar 2012 23:51:05 +0000 (23:51 +0000)]
Add a pile of tests for unrestricted unions, and advertise support for them.

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

12 years agoconstexpr: Remove APValue/CCValue distinction. It is no longer useful given the
Richard Smith [Sat, 3 Mar 2012 22:46:17 +0000 (22:46 +0000)]
constexpr: Remove APValue/CCValue distinction. It is no longer useful given the
resolution of core issue 1454.

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

12 years agoRemove unused variable.
Benjamin Kramer [Sat, 3 Mar 2012 21:52:22 +0000 (21:52 +0000)]
Remove unused variable.

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

12 years agoFix Typo in 'objc changes' anchor.
Jean-Daniel Dupas [Sat, 3 Mar 2012 13:37:22 +0000 (13:37 +0000)]
Fix Typo in 'objc changes' anchor.

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

12 years agoAvoid an unnecessary recursive loop between type canonicalization and NNS canonicaliz...
Eli Friedman [Sat, 3 Mar 2012 04:09:56 +0000 (04:09 +0000)]
Avoid an unnecessary recursive loop between type canonicalization and NNS canonicalization which would (rarely) lead to memory corruption.  While I'm here, simplify.  Fixes PR12166.  Not committing a testcase because it's impossible to reduce it.

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

12 years ago[analyzer] do not warn about returning stack-allocated memory when it comes from...
Ted Kremenek [Sat, 3 Mar 2012 01:22:03 +0000 (01:22 +0000)]
[analyzer] do not warn about returning stack-allocated memory when it comes from an ancestor stack frame.

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

12 years agoFactor bitfields of LangOptions out into a base class in order to make them
Richard Smith [Sat, 3 Mar 2012 00:52:40 +0000 (00:52 +0000)]
Factor bitfields of LangOptions out into a base class in order to make them
trivially-copyable. 50KiB reduction in clang binary size.

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

12 years agoFrontend: Default to creating output files using temporary files + rename.
Daniel Dunbar [Sat, 3 Mar 2012 00:36:06 +0000 (00:36 +0000)]
Frontend: Default to creating output files using temporary files + rename.
 - This is a more reliable default, as it behaves better on failure and also
   ensures that we create *new* files (instead of reusing existing inodes). This
   is useful for other applications (like lldb) which want to cache inode's to
   know when a file has been rewritten.

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

12 years agoFrontend: Don't automatically create missing directories when using temporary files...
Daniel Dunbar [Sat, 3 Mar 2012 00:36:02 +0000 (00:36 +0000)]
Frontend: Don't automatically create missing directories when using temporary files with createOutputFile()
 - This would otherwise happen as a side effect of llvm::sys::fs::unique_file creating parent directories.

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

12 years agoThread safety analysis: expand set of expressions that can be used to denote locks.
DeLesley Hutchins [Fri, 2 Mar 2012 23:36:05 +0000 (23:36 +0000)]
Thread safety analysis: expand set of expressions that can be used to denote locks.

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

12 years agoReinstate r151879, r151880, reverted in r151922, along with a bugfix for
Richard Smith [Fri, 2 Mar 2012 23:27:11 +0000 (23:27 +0000)]
Reinstate r151879, r151880, reverted in r151922, along with a bugfix for
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.

In addition to the extra unit testing, this has successfully bootstrapped.

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