]> granicus.if.org Git - clang/log
clang
12 years agoIRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.
Daniel Dunbar [Sat, 10 Mar 2012 01:03:58 +0000 (01:03 +0000)]
IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.

 - We do this when it is easy to determine that the backend will pass them on
   the stack properly by itself.

Currently LLVM codegen is really bad in some cases with byval, for example, on
the test case here (which is derived from Sema code, which likes to pass
SourceLocations around)::

  struct s47 { unsigned a; };
  void f47(int,int,int,int,int,int,struct s47);
  void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); }

we used to emit code like this::

  ...
  movl %esi, -8(%rbp)
  movl -8(%rbp), %ecx
  movl %ecx, (%rsp)
  ...

to handle moving the struct onto the stack, which is just appalling.

Now we generate::

  movl %esi, (%rsp)

which seems better, no?

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

12 years agoMinor change to my last rewrite patch.
Fariborz Jahanian [Sat, 10 Mar 2012 00:53:02 +0000 (00:53 +0000)]
Minor change to my last rewrite patch.

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

12 years agoobjc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
Fariborz Jahanian [Sat, 10 Mar 2012 00:39:34 +0000 (00:39 +0000)]
objc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
// rdar://11023563

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

12 years agoQualifiers on a canonical array type go on the outermost type, not the
Douglas Gregor [Sat, 10 Mar 2012 00:29:33 +0000 (00:29 +0000)]
Qualifiers on a canonical array type go on the outermost type, not the
innermost type. Fixes PR12142.

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

12 years agoAssign APValues by swapping from a temporary. Removes a bunch of unnecessary
Richard Smith [Sat, 10 Mar 2012 00:28:11 +0000 (00:28 +0000)]
Assign APValues by swapping from a temporary. Removes a bunch of unnecessary
copy-construction, which Daniel Dunbar reports as giving a 0.75% speedup on
403.gcc/combine.c. The performance differences on my constexpr torture tests
are below the noise floor.

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

12 years agoobjective-c modern rewriter. More fixes related to rewriting
Fariborz Jahanian [Fri, 9 Mar 2012 23:46:23 +0000 (23:46 +0000)]
objective-c modern rewriter. More fixes related to rewriting
ivars in the modern rewriter.

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

12 years agoTeach RetainCountChecker about mixing method families with explicit annotations....
Ted Kremenek [Fri, 9 Mar 2012 23:34:08 +0000 (23:34 +0000)]
Teach RetainCountChecker about mixing method families with explicit annotations.  Fixes <rdar://problem/10824732>.

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

12 years agoDocument the conversion from a lambda closure type to a block pointer
Douglas Gregor [Fri, 9 Mar 2012 23:24:48 +0000 (23:24 +0000)]
Document the conversion from a lambda closure type to a block pointer
in Objective-C++.

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

12 years agoImprove diagnostics for UCNs referring to control characters and members of the
Richard Smith [Fri, 9 Mar 2012 22:27:51 +0000 (22:27 +0000)]
Improve diagnostics for UCNs referring to control characters and members of the
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in
literals in C++11. Extend such support to cover string literals as well as
character literals, and mark N2170 as done.

This seems too minor to warrant a release note to me. Let me know if you disagree.

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

12 years ago[Sema] Fix a diag change to include a range that appeared intended, but never
Daniel Dunbar [Fri, 9 Mar 2012 21:38:22 +0000 (21:38 +0000)]
[Sema] Fix a diag change to include a range that appeared intended, but never
actually happened.

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

12 years agoUpdate comment after r152140. Clarify a bit too.
Nico Weber [Fri, 9 Mar 2012 21:19:44 +0000 (21:19 +0000)]
Update comment after r152140. Clarify a bit too.

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

12 years ago[analyzer] Add support for NoRedundancy inlining mode.
Anna Zaks [Fri, 9 Mar 2012 21:14:01 +0000 (21:14 +0000)]
[analyzer] Add support for NoRedundancy inlining mode.

We do not reanalyze a function, which has already been analyzed as an
inlined callee. As per PRELIMINARY testing, this gives over
50% run time reduction on some benchmarks without decreasing of the
number of bugs found.

Turning the mode on by default.

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

12 years agoCallGraph: Add getNode() method, constify.
Anna Zaks [Fri, 9 Mar 2012 21:13:53 +0000 (21:13 +0000)]
CallGraph: Add getNode() method, constify.

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

12 years agoAllow serializing an invalid ParmVarDecl and don't set access to public for
Argyrios Kyrtzidis [Fri, 9 Mar 2012 21:09:04 +0000 (21:09 +0000)]
Allow serializing an invalid ParmVarDecl and don't set access to public for
invalid ParmVarDecls.

Part of rdar://11007039.

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

12 years agoRevert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
Daniel Dunbar [Fri, 9 Mar 2012 20:41:19 +0000 (20:41 +0000)]
Revert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
LLVM_READONLY.", getTypeInfo() is totally not READONLY, which I should have
probably noticed given that I made it so mere hours ago. Oops.

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

12 years agoAdd a helper to get a CXXConstructExpr from a CXXNewExpr.
Matt Beaumont-Gay [Fri, 9 Mar 2012 20:36:34 +0000 (20:36 +0000)]
Add a helper to get a CXXConstructExpr from a CXXNewExpr.

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

12 years agoImprove our semantic error recovery.
Argyrios Kyrtzidis [Fri, 9 Mar 2012 20:10:30 +0000 (20:10 +0000)]
Improve our semantic error recovery.

When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:

struct A {
  ~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".

This weird state was impending lookups in the records and hitting assertion in the ASTWriter.

Part of rdar://11007039

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

12 years ago[AST] Mark Expr::Ignore*() functions as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 20:02:56 +0000 (20:02 +0000)]
[AST] Mark Expr::Ignore*() functions as LLVM_READONLY.

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

12 years ago[AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 20:02:54 +0000 (20:02 +0000)]
[AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.

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

12 years ago[AST] Mark Expr::getExprLoc() as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 20:02:51 +0000 (20:02 +0000)]
[AST] Mark Expr::getExprLoc() as LLVM_READONLY.

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

12 years ago[Sema] Remove dead getSourceRange() call, caught by Clang after marking
Daniel Dunbar [Fri, 9 Mar 2012 20:02:47 +0000 (20:02 +0000)]
[Sema] Remove dead getSourceRange() call, caught by Clang after marking
LLVM_READONLY.

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

12 years ago[AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 19:35:29 +0000 (19:35 +0000)]
[AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
 - The theory here is that we have these functions sprinkled in all over the
   place. This should allow the optimizer to at least realize it can still do
   load CSE across these calls.
 - I blindly marked all instances as such, even though the optimizer can infer
   this attribute in some instances (some of the inline ones) as that was easier
   and also, when given the choice between thinking and not thinking, I prefer
   the latter.

You might think this is mere frivolity, but actually this is good for a .7 -
1.1% speedup on 403.gcc/combine.c, JSC/Interpreter.cpp,
OGF/NSBezierPath-OAExtensions.m.

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

12 years agoAdd user-defined literals to release notes.
Richard Smith [Fri, 9 Mar 2012 19:09:47 +0000 (19:09 +0000)]
Add user-defined literals to release notes.

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

12 years agolldb support: under debugger support flag, when sending message
Fariborz Jahanian [Fri, 9 Mar 2012 18:47:16 +0000 (18:47 +0000)]
lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//10988847

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

12 years ago[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
Daniel Dunbar [Fri, 9 Mar 2012 18:35:03 +0000 (18:35 +0000)]
[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
 - getSourceRange().getBegin() is about as awesome a pattern as .copy().size().

I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.

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

12 years ago[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc...
Daniel Dunbar [Fri, 9 Mar 2012 18:34:54 +0000 (18:34 +0000)]
[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.

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

12 years ago[AST] Define a few more key getLocStart() implementations.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:24 +0000 (15:39 +0000)]
[AST] Define a few more key getLocStart() implementations.
 - This cuts the # of getSourceRange calls by 60% on
   OGF/NSBezierPath-OAExtensions.m.

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

12 years ago[AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:19 +0000 (15:39 +0000)]
[AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
 - getSourceRange() can be very expensive, we should try to avoid it if at all possible.

In conjunction with the previous commit I measured a ~2% speedup on 403.gcc/combine.c and a 3% speedup on OmniGroupFrameworks/NSBezierPath-OAExtensions.m.

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

12 years ago[AST] Add {DeclRefExpr,MemberExpr,ImplicitCastExpr}::{getLocStart,getLocEnd} methods.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:15 +0000 (15:39 +0000)]
[AST] Add {DeclRefExpr,MemberExpr,ImplicitCastExpr}::{getLocStart,getLocEnd} methods.
 - There are probably a lot more of these worth adding, but these are a start at hitting some of the exprs for which getSourceRange().getBegin() is a poor substitute for getLocStart().

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

12 years ago[AST] Add DeclaratioName::getLoc{Start,End} for consistency.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:11 +0000 (15:39 +0000)]
[AST] Add DeclaratioName::getLoc{Start,End} for consistency.

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

12 years ago[Basic] Rename LangOptions::NoInline to NoInlineDefine, to make things a bit
Daniel Dunbar [Fri, 9 Mar 2012 15:39:08 +0000 (15:39 +0000)]
[Basic] Rename LangOptions::NoInline to NoInlineDefine, to make things a bit
more obvious.

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

12 years agoHarden test for 32 bit platforms, where size_t is unsigned int (not unsigned long).
Benjamin Kramer [Fri, 9 Mar 2012 13:17:27 +0000 (13:17 +0000)]
Harden test for 32 bit platforms, where size_t is unsigned int (not unsigned long).

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

12 years ago-Wformat-non-iso: warn about positional arguments (pr12017)
Hans Wennborg [Fri, 9 Mar 2012 10:10:54 +0000 (10:10 +0000)]
-Wformat-non-iso: warn about positional arguments (pr12017)

This renames the -Wformat-non-standard flag to -Wformat-non-iso,
rewords the current warnings a bit (pointing out that a format string
is not supported by ISO C rather than being "non standard"),
and adds a warning about positional arguments.

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

12 years agoFix statement printing for raw and template user-defined literals.
Richard Smith [Fri, 9 Mar 2012 10:10:02 +0000 (10:10 +0000)]
Fix statement printing for raw and template user-defined literals.

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

12 years agoUser-defined literals are done.
Richard Smith [Fri, 9 Mar 2012 08:41:27 +0000 (08:41 +0000)]
User-defined literals are done.

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

12 years agoLiteral operator suffixes and regular names live in separate namespaces.
Richard Smith [Fri, 9 Mar 2012 08:37:16 +0000 (08:37 +0000)]
Literal operator suffixes and regular names live in separate namespaces.

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

12 years agoLiteral operators can't have default arguments.
Richard Smith [Fri, 9 Mar 2012 08:16:22 +0000 (08:16 +0000)]
Literal operators can't have default arguments.

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

12 years agoSupport for raw and template forms of numeric user-defined literals,
Richard Smith [Fri, 9 Mar 2012 08:00:36 +0000 (08:00 +0000)]
Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.

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

12 years agoRemove accidental binary commit.
John McCall [Fri, 9 Mar 2012 04:18:33 +0000 (04:18 +0000)]
Remove accidental binary commit.

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

12 years ago[AST] Memoize ASTContext::getTypeInfo().
Daniel Dunbar [Fri, 9 Mar 2012 04:12:54 +0000 (04:12 +0000)]
[AST] Memoize ASTContext::getTypeInfo().
 - On -emit-llvm-only of 403.gcc/combine.c, for example, we make 160k calls to
   getTypeInfo but only ever deal with 680 some distinct types.

I saw these speedups (user time):
  403.gcc/combine.c -- 3.1%
  OmniGroupFrameworks/NSBezierPath-OAExtensions.m -- 3.6%
  JavaScriptCore/Interpreter.cpp -- 1.4%
which seems pretty sweet.

I ran some histograms on those compiles and we end up doing a ton of
getTypeInfo() on 'char' and 'int'. I tried splitting out a fast path for builtin
types, but this wasn't a win. Still kinda seems like we could be doing better
here.

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

12 years agoPerform l2r conversions on delete operands before doing
John McCall [Fri, 9 Mar 2012 04:08:29 +0000 (04:08 +0000)]
Perform l2r conversions on delete operands before doing
type-analysis;  otherwise, we just completely do the
wrong thing for placeholders.

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

12 years agoMake sure we update the static local decl address map when we are forced to rebuild...
Eli Friedman [Fri, 9 Mar 2012 03:27:46 +0000 (03:27 +0000)]
Make sure we update the static local decl address map when we are forced to rebuild a global because of the initializer.  <rdar://problem/10957867>.

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

12 years agoMake sure constant emission handles initializer lists with strings correctly. Part...
Eli Friedman [Fri, 9 Mar 2012 03:06:56 +0000 (03:06 +0000)]
Make sure constant emission handles initializer lists with strings correctly.  Part of <rdar://problem/10957867>.

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

12 years ago[AST] NestedNameSpecifier's ctor/dtor are trivial and should be inlined.
Daniel Dunbar [Fri, 9 Mar 2012 01:51:59 +0000 (01:51 +0000)]
[AST] NestedNameSpecifier's ctor/dtor are trivial and should be inlined.

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

12 years ago[AST] Type::isVoidType() is trivial and should be inlined.
Daniel Dunbar [Fri, 9 Mar 2012 01:51:56 +0000 (01:51 +0000)]
[AST] Type::isVoidType() is trivial and should be inlined.

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

12 years ago[AST] Reduce Decl::getASTContext() calls.
Daniel Dunbar [Fri, 9 Mar 2012 01:51:51 +0000 (01:51 +0000)]
[AST] Reduce Decl::getASTContext() calls.
 - This function is not at all free; pass it around along some hot paths instead
   of recomputing it deep inside various VarDecl methods.

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

12 years ago[analyzer] Implement basic path diagnostic pruning based on "interesting" symbols...
Ted Kremenek [Fri, 9 Mar 2012 01:13:14 +0000 (01:13 +0000)]
[analyzer] Implement basic path diagnostic pruning based on "interesting" symbols and regions.
Essentially, a bug centers around a story for various symbols and regions.  We should only include
the path diagnostic events that relate to those symbols and regions.

The pruning is done by associating a set of interesting symbols and regions with a BugReporter, which
can be modified at BugReport creation or by BugReporterVisitors.

This patch reduces the diagnostics emitted in several of our test cases.  I've vetted these as
having desired behavior.  The only regression is a missing null check diagnostic for the return
value of realloc() in test/Analysis/malloc-plist.c.  This will require some investigation to fix,
and I have added a FIXME to the test case.

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

12 years ago[analyzer] Use call graph to determine order in which functions are
Anna Zaks [Thu, 8 Mar 2012 23:16:38 +0000 (23:16 +0000)]
[analyzer] Use call graph to determine order in which functions are
analyzed.

The CallGraph is used when inlining is on, which is the current default.

This alone does not bring any performance improvement. It's a
stepping stone for the upcoming optimization in which we do not
re-analyze a function that has already been analyzed while inlined in
other functions. Using the call graph makes it easier to play with
the order of functions to minimize redundant analyzes.

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

12 years ago[analyzer] Rework inlining related command line options.
Anna Zaks [Thu, 8 Mar 2012 23:16:35 +0000 (23:16 +0000)]
[analyzer] Rework inlining related command line options.
 - Remove -analyzer-inline-call.
 - Add -analyzer-ipa=[none|inlining]
 - Add -analyzer-inlining-mode to allow experimentation for
different performance tuning methods.

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

12 years agoCall Graph: Only the root node is allowed to have an invalid Decl*.
Anna Zaks [Thu, 8 Mar 2012 23:16:26 +0000 (23:16 +0000)]
Call Graph: Only the root node is allowed to have an invalid Decl*.

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

12 years agoRemove a test FIXME for a case which is already fixed.
Richard Smith [Thu, 8 Mar 2012 23:08:29 +0000 (23:08 +0000)]
Remove a test FIXME for a case which is already fixed.

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

12 years agoFix a couple of issues with literal-operator-id parsing, and provide recovery
Richard Smith [Thu, 8 Mar 2012 23:06:02 +0000 (23:06 +0000)]
Fix a couple of issues with literal-operator-id parsing, and provide recovery
for a few kinds of error. Specifically:

Since we're after translation phase 6, the "" token might be formed by multiple
source-level string literals. Checking the token width is not a correct way of
detecting empty string literals, due to escaped newlines. Diagnose and recover
from a missing space between "" and suffix, and from string literals other than
"", which are followed by a suffix.

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

12 years agoDon't crash when a statement in a block is ill-formed but
John McCall [Thu, 8 Mar 2012 22:00:17 +0000 (22:00 +0000)]
Don't crash when a statement in a block is ill-formed but
introduces cleanups anyway.

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

12 years agoWhen checking the encoding of an 8-bit string literal, don't just check the
Richard Smith [Thu, 8 Mar 2012 21:59:28 +0000 (21:59 +0000)]
When checking the encoding of an 8-bit string literal, don't just check the
first codepoint! Also, don't reject empty raw string literals for spurious
"encoding" issues. Also, don't rely on undefined behavior in ConvertUTF.c.

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

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