]> granicus.if.org Git - clang/log
clang
12 years agoTurn explicit construction of temporaries using initializer list syntax into CXXTempo...
Sebastian Redl [Thu, 8 Mar 2012 21:05:45 +0000 (21:05 +0000)]
Turn explicit construction of temporaries using initializer list syntax into CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167.

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

12 years agoUntangle getUnderlyingDeclImpl, no functionality change.
Benjamin Kramer [Thu, 8 Mar 2012 21:00:45 +0000 (21:00 +0000)]
Untangle getUnderlyingDeclImpl, no functionality change.

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

12 years ago[utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failure
Argyrios Kyrtzidis [Thu, 8 Mar 2012 20:29:39 +0000 (20:29 +0000)]
[utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failure
without reverting the changes.

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

12 years ago[AST] Clean up NamedDecl::getUnderlyingDecl() change a bit.
Daniel Dunbar [Thu, 8 Mar 2012 20:29:02 +0000 (20:29 +0000)]
[AST] Clean up NamedDecl::getUnderlyingDecl() change a bit.

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

12 years agoRemove stray semi-colon.
Daniel Dunbar [Thu, 8 Mar 2012 20:28:59 +0000 (20:28 +0000)]
Remove stray semi-colon.

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

12 years ago[AST] APValue: Split the fast path of MakeUninit to be inline.
Daniel Dunbar [Thu, 8 Mar 2012 20:28:55 +0000 (20:28 +0000)]
[AST] APValue: Split the fast path of MakeUninit to be inline.
 - This change seems to be a tiny loss on 403.gcc/combine.c (.2%), but I think
   it is the right thing to do.

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

12 years ago[utils/FuzzTest] The help message says that if you don't specify --max-tests
Argyrios Kyrtzidis [Thu, 8 Mar 2012 20:11:06 +0000 (20:11 +0000)]
[utils/FuzzTest] The help message says that if you don't specify --max-tests
"the script will run forever continually picking new tests to run", make it so.

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

12 years ago[utils/FuzzTest] For --filelist the option type is string, not integer.
Argyrios Kyrtzidis [Thu, 8 Mar 2012 18:56:59 +0000 (18:56 +0000)]
[utils/FuzzTest] For --filelist the option type is string, not integer.

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

12 years ago[Basic] PartialDiagnostic: Manual split out the cold part of freeStorage(), the
Daniel Dunbar [Thu, 8 Mar 2012 18:43:59 +0000 (18:43 +0000)]
[Basic] PartialDiagnostic: Manual split out the cold part of freeStorage(), the
hot path will typically profitably get inlined (based on what I see from the
users of PartialDiagnostic).

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

12 years ago[AST] Change NamedDecl::getUnderlyingDecl() to inline the fast (and incredibly common...
Daniel Dunbar [Thu, 8 Mar 2012 18:20:41 +0000 (18:20 +0000)]
[AST] Change NamedDecl::getUnderlyingDecl() to inline the fast (and incredibly common) path.

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

12 years agoReplace MarkVarRequired with a more generic
Rafael Espindola [Thu, 8 Mar 2012 15:51:03 +0000 (15:51 +0000)]
Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.

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

12 years agoAlso test pr12104 with pch.
Rafael Espindola [Thu, 8 Mar 2012 15:07:42 +0000 (15:07 +0000)]
Also test pr12104 with pch.

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

12 years agoImplement -fno-dwarf2-cfi-asm on linux too.
Rafael Espindola [Thu, 8 Mar 2012 14:39:55 +0000 (14:39 +0000)]
Implement -fno-dwarf2-cfi-asm on linux too.

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

12 years agoEnsure we don't print 123ULL_foo when printing a user-defined integer literal.
Richard Smith [Thu, 8 Mar 2012 09:02:38 +0000 (09:02 +0000)]
Ensure we don't print 123ULL_foo when printing a user-defined integer literal.

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

12 years agoAdd support for cooked forms of user-defined-integer-literal and
Richard Smith [Thu, 8 Mar 2012 08:45:32 +0000 (08:45 +0000)]
Add support for cooked forms of user-defined-integer-literal and
user-defined-floating-literal. Support for raw forms of these literals
to follow.

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

12 years agoTaken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
Stepan Dyatkovskiy [Thu, 8 Mar 2012 07:06:48 +0000 (07:06 +0000)]
Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
  BasicBlock *BB = i.getCaseSuccessor();
  ConstantInt *V = i.getCaseValue();
  // Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.

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

12 years ago[AST] Change Type::isIntegerType to be inlined(). It is very popular.
Daniel Dunbar [Thu, 8 Mar 2012 02:52:18 +0000 (02:52 +0000)]
[AST] Change Type::isIntegerType to be inlined(). It is very popular.

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

12 years agoImplement C++11 [lex.ext]p10 for string and character literals: a ud-suffix not
Richard Smith [Thu, 8 Mar 2012 02:39:21 +0000 (02:39 +0000)]
Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix not
starting with an underscore is ill-formed.

Since this rule rejects programs that were using <inttypes.h>'s macros, recover
from this error by treating the ud-suffix as a separate preprocessing-token,
with a DefaultError ExtWarn. The approach of treating such cases as two tokens
is under discussion for standardization, but is in any case a conforming
extension and allows existing codebases to keep building while the committee
makes up its mind.

Reword the warning on the definition of literal operators not starting with
underscores (which are, strangely, legal) to more explicitly state that such
operators can't be called by literals. Remove the special-case diagnostic for
hexfloats, since it was both triggering in the wrong cases and incorrect.

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

12 years agoLoosen the precondition of isCXXInstanceMember() to simply return
Douglas Gregor [Thu, 8 Mar 2012 02:08:05 +0000 (02:08 +0000)]
Loosen the precondition of isCXXInstanceMember() to simply return
"false" for declarations that aren't members of classes. Fixes PR12106.

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

12 years agoSpelling.
Daniel Dunbar [Thu, 8 Mar 2012 01:54:33 +0000 (01:54 +0000)]
Spelling.

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

12 years agoSema: Don't emit a gajillion calls to sanity() -- an empty function -- in NDEBUG
Daniel Dunbar [Thu, 8 Mar 2012 01:43:06 +0000 (01:43 +0000)]
Sema: Don't emit a gajillion calls to sanity() -- an empty function -- in NDEBUG
builds. Sheesh.

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

12 years agoUser-defined literal support for character literals.
Richard Smith [Thu, 8 Mar 2012 01:34:56 +0000 (01:34 +0000)]
User-defined literal support for character literals.

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

12 years agoFix -Wuninitialized to catch the case of a class being initialized with a call
Richard Trieu [Thu, 8 Mar 2012 01:15:31 +0000 (01:15 +0000)]
Fix -Wuninitialized to catch the case of a class being initialized with a call
to its own member function.

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

12 years ago[libclang] Fix a crash when serializing a preprocessing record that contains
Argyrios Kyrtzidis [Thu, 8 Mar 2012 01:08:28 +0000 (01:08 +0000)]
[libclang] Fix a crash when serializing a preprocessing record that contains
an #include entry that did not resolve to header file.

Part of rdar://11007039

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

12 years agoStreamline BalancedDelimiterTracker, by eliminating the duplicate
Douglas Gregor [Thu, 8 Mar 2012 01:00:17 +0000 (01:00 +0000)]
Streamline BalancedDelimiterTracker, by eliminating the duplicate
paren/brace/bracket tracking (the Consume* functions already did it),
removing the use of ConsumeAnyToken(), and moving the hot paths inline
with the error paths out-of-line.

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

12 years agoimprove on diagnostic when block captures uninitialized
Fariborz Jahanian [Thu, 8 Mar 2012 00:52:24 +0000 (00:52 +0000)]
improve on diagnostic when block captures uninitialized
block variable. // rdar://10817031

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

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