]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer] Mark ConstraintManager::canReasonAbout as protected.
Anna Zaks [Mon, 5 Dec 2011 21:33:06 +0000 (21:33 +0000)]
[analyzer] Mark ConstraintManager::canReasonAbout as protected.

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

12 years ago[analyzer] Simplify the condition.
Anna Zaks [Mon, 5 Dec 2011 21:33:01 +0000 (21:33 +0000)]
[analyzer] Simplify the condition.

This is a fixup for r145832.

The extra clauses do not matter after we remove the dependency on canReasonAbout(InitVal) in r145832.

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

12 years ago[analyzer] Simplify the expected-warning statement.
Anna Zaks [Mon, 5 Dec 2011 21:32:58 +0000 (21:32 +0000)]
[analyzer] Simplify the expected-warning statement.

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

12 years agoAdd a warning for implicit conversion from function literals (and static
Lang Hames [Mon, 5 Dec 2011 20:49:50 +0000 (20:49 +0000)]
Add a warning for implicit conversion from function literals (and static
methods) to bool. E.g.

void foo() {}
if (f) { ... // <- Warns here.
}

Only applies to non-weak functions, and does not apply if the function address
is taken explicitly with the addr-of operator.

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

12 years agoMake isWeakDecl available as a method on ValueDecl.
Lang Hames [Mon, 5 Dec 2011 20:16:26 +0000 (20:16 +0000)]
Make isWeakDecl available as a method on ValueDecl.

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

12 years agoMore objc rewriter refactoring.
Fariborz Jahanian [Mon, 5 Dec 2011 19:50:04 +0000 (19:50 +0000)]
More objc rewriter refactoring.

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

12 years ago[analyzer] Add a missing taint tester warning.
Anna Zaks [Mon, 5 Dec 2011 18:58:33 +0000 (18:58 +0000)]
[analyzer] Add a missing taint tester warning.

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

12 years ago[analyzer] Unify SymbolVal and SymExprVal under a single SymbolVal
Anna Zaks [Mon, 5 Dec 2011 18:58:30 +0000 (18:58 +0000)]
[analyzer] Unify SymbolVal and SymExprVal under a single SymbolVal
class.

We are going into the direction of handling SymbolData and other SymExpr
uniformly, so it makes less sense to keep two different SVal classes.
For example, the checkers would have to take an extra step to reason
about each type separately.

The classes have the same members, we were just using the SVal kind
field for easy differentiation in 3 switch statements. The switch
statements look more ugly now, but we can make the code more readable in
other ways, for example, moving some code into separate functions.

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

12 years ago[analyzer] Remove all uses of ConstraintManager::canResonAbout() from
Anna Zaks [Mon, 5 Dec 2011 18:58:25 +0000 (18:58 +0000)]
[analyzer] Remove all uses of ConstraintManager::canResonAbout() from
ExprEngine.

Teach SimpleConstraintManager::assumeSymRel() to propagate constraints
to symbolic expressions.

+ One extra warning (real bug) is now generated due to enhanced
assumeSymRel().

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

12 years ago[analyzer] First step toward removing
Anna Zaks [Mon, 5 Dec 2011 18:58:19 +0000 (18:58 +0000)]
[analyzer] First step toward removing
ConstraintManager::canReasonAbout() from the ExprEngine.

ExprEngine should not care if the constraint solver can reason about
something or not. The solver should be able to handle all the SymExprs.

To do this, the solver should be able to keep track of not only the
SymbolData but of all SymExprs. This is why we change SymbolRef to be an
alias of SymExpr*. When encountering an expression it cannot simplify,
the solver should just add the constraints to it.

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

12 years ago[analyzer] Minor improvements on RangeConstraint pretty-printing.
Anna Zaks [Mon, 5 Dec 2011 18:58:14 +0000 (18:58 +0000)]
[analyzer] Minor improvements on RangeConstraint pretty-printing.

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

12 years ago[analyzer] Change RetainCountChecker to use symbol dump method instead
Anna Zaks [Mon, 5 Dec 2011 18:58:11 +0000 (18:58 +0000)]
[analyzer] Change RetainCountChecker to use symbol dump method instead
of relying on SymbolID.

This way any expression can be printed (not only SymbolData).

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

12 years ago[analyzer] Add ability to do a simple ProgramState dump() without
Anna Zaks [Mon, 5 Dec 2011 18:58:08 +0000 (18:58 +0000)]
[analyzer] Add ability to do a simple ProgramState dump() without
requiring CFG.

Adding more ugly code; the evnvironment printing should be moved to
envirnment at some point.

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

12 years ago[analyzer] Add a debug checker to test for tainted data.
Anna Zaks [Mon, 5 Dec 2011 18:58:01 +0000 (18:58 +0000)]
[analyzer] Add a debug checker to test for tainted data.

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

12 years agoSome early refactoring of objective-c rewriter.
Fariborz Jahanian [Mon, 5 Dec 2011 18:43:13 +0000 (18:43 +0000)]
Some early refactoring of objective-c rewriter.

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

12 years ago[asan] don't require libstdc++ for asan on linux. Mac fix will go separately
Kostya Serebryany [Mon, 5 Dec 2011 18:32:37 +0000 (18:32 +0000)]
[asan] don't require libstdc++ for asan on linux. Mac fix will go separately

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

12 years agowe got badgered into supporting multi-alternative constraints.
Chris Lattner [Mon, 5 Dec 2011 18:29:03 +0000 (18:29 +0000)]
we got badgered into supporting multi-alternative constraints.

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

12 years agoInferred framework modules automatically export anything they import
Douglas Gregor [Mon, 5 Dec 2011 17:40:25 +0000 (17:40 +0000)]
Inferred framework modules automatically export anything they import
(i.e., 'export *'), to better match the semantics of headers.

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

12 years agoFix printing of wildcard exports.
Douglas Gregor [Mon, 5 Dec 2011 17:34:59 +0000 (17:34 +0000)]
Fix printing of wildcard exports.

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

12 years agoImplement support for wildcard exports in modules, allowing a module
Douglas Gregor [Mon, 5 Dec 2011 17:28:06 +0000 (17:28 +0000)]
Implement support for wildcard exports in modules, allowing a module
to re-export anything that it imports. This opt-in feature makes a
module behave more like a header, because it can be used to re-export
the transitive closure of a (sub)module's dependencies.

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

12 years agoActually add a useful bit to the comment pre-FIXME
Douglas Gregor [Mon, 5 Dec 2011 16:35:23 +0000 (16:35 +0000)]
Actually add a useful bit to the comment pre-FIXME

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

12 years agoWhen writing a module file, keep track of the set of (sub)modules that
Douglas Gregor [Mon, 5 Dec 2011 16:33:54 +0000 (16:33 +0000)]
When writing a module file, keep track of the set of (sub)modules that
it imports, establishing dependencies at the (sub)module
granularity. This is not a user-visible change (yet).

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

12 years agoinclude/clang*/Makefile: Tweak installation to work with CLANG_SRCDIR.
NAKAMURA Takumi [Mon, 5 Dec 2011 06:13:20 +0000 (06:13 +0000)]
include/clang*/Makefile: Tweak installation to work with CLANG_SRCDIR.

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

12 years agoSupport decltype in nested-name-specifiers.
David Blaikie [Sun, 4 Dec 2011 05:04:18 +0000 (05:04 +0000)]
Support decltype in nested-name-specifiers.

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

12 years agoMove block return type inference diagnostic to a common place where
Fariborz Jahanian [Sat, 3 Dec 2011 23:53:56 +0000 (23:53 +0000)]
Move block return type inference diagnostic to a common place where
Function or array lvalue conversions happens.

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

12 years agoFix mangling substitutions for address-space-qualified class
Douglas Gregor [Sat, 3 Dec 2011 18:24:43 +0000 (18:24 +0000)]
Fix mangling substitutions for address-space-qualified class
types. Patch from Dmitri Rubinstein!

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

12 years agoImplement support for the __is_final type trait, to determine whether
Douglas Gregor [Sat, 3 Dec 2011 18:14:24 +0000 (18:14 +0000)]
Implement support for the __is_final type trait, to determine whether
a class is marked 'final', from Alberto Ganesh Barbati! Fixes
PR11462.

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

12 years agoIf block literal return type is not specified, return type of the block is
Fariborz Jahanian [Sat, 3 Dec 2011 17:47:53 +0000 (17:47 +0000)]
If block literal return type is not specified, return type of the block is
inferred from return types. All the return statements have to agree about the type.
// rdar://10466373

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

12 years agoIn Microsoft mode, don't perform typo correction in a template member function depend...
Francois Pichet [Sat, 3 Dec 2011 15:55:29 +0000 (15:55 +0000)]
In Microsoft mode, don't perform typo correction in a template member function dependent context because it interferes with the "lookup into dependent bases of class templates" feature.

Basically typo correction will try to offer a correction instead of looking into type dependent base classes.

I found this problem while parsing Microsoft ATL code with clang.

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

12 years agoImplement overload resolution for reference-typed parameters supplied with initialize...
Sebastian Redl [Sat, 3 Dec 2011 14:54:30 +0000 (14:54 +0000)]
Implement overload resolution for reference-typed parameters supplied with initializer lists.

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

12 years agoSwitch LValue so that it exposes alignment in CharUnits. (No functional change.)
Eli Friedman [Sat, 3 Dec 2011 04:14:32 +0000 (04:14 +0000)]
Switch LValue so that it exposes alignment in CharUnits.  (No functional change.)

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

12 years ago[PCH] Make sure that the SourceExpr of a OpaqueValueExpr is always initialized
Argyrios Kyrtzidis [Sat, 3 Dec 2011 03:49:52 +0000 (03:49 +0000)]
[PCH] Make sure that the SourceExpr of a OpaqueValueExpr is always initialized
when deserialized, fixing random crashes in libclang.

Also simplifies how OpaqueValueExprs are [de]serialized.
The reader/writer automatically retains pointer equality of sub-statements (when a
statement node is referenced in multiple nodes), so no need to manually handle it.

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

12 years ago[libclang] Fix infinite loop when doing visitation of an OpaqueValueExpr.
Argyrios Kyrtzidis [Sat, 3 Dec 2011 03:49:47 +0000 (03:49 +0000)]
[libclang] Fix infinite loop when doing visitation of an OpaqueValueExpr.

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

12 years ago[libclang] Allow indexing/get-cursor/etc. for the exception variable in a C++ catch.
Argyrios Kyrtzidis [Sat, 3 Dec 2011 03:49:44 +0000 (03:49 +0000)]
[libclang] Allow indexing/get-cursor/etc. for the exception variable in a C++ catch.

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

12 years agoAdd a utility to get a RValue for a given LValue for an aggregate; switch a few place...
Eli Friedman [Sat, 3 Dec 2011 03:08:40 +0000 (03:08 +0000)]
Add a utility to get a RValue for a given LValue for an aggregate; switch a few places over to it.

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

12 years agoSwitch the Alignment argument on AggValueSlot over to CharUnits, per John's review...
Eli Friedman [Sat, 3 Dec 2011 02:13:40 +0000 (02:13 +0000)]
Switch the Alignment argument on AggValueSlot over to CharUnits, per John's review comment.

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

12 years agoModule files representing actual modules don't need to know the set of modules they...
Douglas Gregor [Sat, 3 Dec 2011 01:15:29 +0000 (01:15 +0000)]
Module files representing actual modules don't need to know the set of modules they import, since that information isn't actually used. Drop it from the AST file

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

12 years agoImplement support for precompiled headers, preambles, and serialized
Douglas Gregor [Sat, 3 Dec 2011 00:59:55 +0000 (00:59 +0000)]
Implement support for precompiled headers, preambles, and serialized
"main" files that import modules. When loading any of these kinds of
AST files, we make the modules that were imported visible into the
translation unit that loaded the PCH file or preamble.

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

12 years agoTrack alignment in AggValueSlot. No functional change in this patch, but I'll be...
Eli Friedman [Sat, 3 Dec 2011 00:54:26 +0000 (00:54 +0000)]
Track alignment in AggValueSlot.  No functional change in this patch, but I'll be introducing uses of the specified alignment soon.

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

12 years agoKeep track of all of the import declarations that are parsed or
Douglas Gregor [Sat, 3 Dec 2011 00:30:27 +0000 (00:30 +0000)]
Keep track of all of the import declarations that are parsed or
implicitly generated in a translation unit. Modules will need this
information to identify the actual imports that occurred.

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

12 years agoWhen we treat an #include or #import as a module import, create an
Douglas Gregor [Fri, 2 Dec 2011 23:42:12 +0000 (23:42 +0000)]
When we treat an #include or #import as a module import, create an
implicit ImportDecl in the translation unit to record the presence of
the import.

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

12 years agoIntroduce a module import declaration, so that we properly represent, e.g.,
Douglas Gregor [Fri, 2 Dec 2011 23:23:56 +0000 (23:23 +0000)]
Introduce a module import declaration, so that we properly represent, e.g.,

  __import_module__ std.vector;

in the AST.

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

12 years agoRevert r145697 and dependent patch r145702. It added a dependency from
Nick Lewycky [Fri, 2 Dec 2011 23:21:43 +0000 (23:21 +0000)]
Revert r145697 and dependent patch r145702. It added a dependency from
lib/Analysis to lib/Sema which is cyclical.

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

12 years agoUpdate for change to LLVM TargetMachine API in r145714.
Nick Lewycky [Fri, 2 Dec 2011 22:17:00 +0000 (22:17 +0000)]
Update for change to LLVM TargetMachine API in r145714.

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

12 years agoAdd missing test header
Douglas Gregor [Fri, 2 Dec 2011 21:59:41 +0000 (21:59 +0000)]
Add missing test header

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

12 years agoOnly perform checking of the predefines buffer when loading a
Douglas Gregor [Fri, 2 Dec 2011 21:56:05 +0000 (21:56 +0000)]
Only perform checking of the predefines buffer when loading a
precompiled header. Previously, we were trying to gather predefines
buffers from all kinds of AST files (which doesn't make sense) and
were performing some validation when AST files were loaded as main
files.

With these tweaks, using PCH files that import modules no longer fails
immediately (due to mismatched predefines buffers). However, module
visibility is lost, so this feature does not yet work.

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

12 years agoMake r145697 actually work.
Hans Wennborg [Fri, 2 Dec 2011 20:32:01 +0000 (20:32 +0000)]
Make r145697 actually work.

Use the canonical type of the typedef to compare with the underlying type.

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

12 years agoMake sure that name lookup in C checks whether a name is hidden.
Douglas Gregor [Fri, 2 Dec 2011 20:08:44 +0000 (20:08 +0000)]
Make sure that name lookup in C checks whether a name is hidden.

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

12 years agoMake conversion specifier warning refer to typedef if possible.
Hans Wennborg [Fri, 2 Dec 2011 19:22:15 +0000 (19:22 +0000)]
Make conversion specifier warning refer to typedef if possible.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

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

12 years agoWhen making a module visible, also make any of its exported modules
Douglas Gregor [Fri, 2 Dec 2011 19:11:09 +0000 (19:11 +0000)]
When making a module visible, also make any of its exported modules
visible, allowing one to create modules that import (and then
re-export) other modules.

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

12 years agoImplement (de-)serialization of the set of exported modules in a
Douglas Gregor [Fri, 2 Dec 2011 18:58:38 +0000 (18:58 +0000)]
Implement (de-)serialization of the set of exported modules in a
module map.

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

12 years agoNotify the AST writer (via ASTDeserializationListener) when a
Douglas Gregor [Fri, 2 Dec 2011 17:30:13 +0000 (17:30 +0000)]
Notify the AST writer (via ASTDeserializationListener) when a
(sub)module is read from an AST file. This makes sure that the AST
writer knows how to map all modules to their global IDs.

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

12 years agoImplement name hiding for macro definitions within modules, such that
Douglas Gregor [Fri, 2 Dec 2011 15:45:10 +0000 (15:45 +0000)]
Implement name hiding for macro definitions within modules, such that
only the macro definitions from visible (sub)modules will actually be
visible. This provides the same behavior for macros that r145640
provided for declarations.

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

12 years agoFix bitfield handling for record layout with #pragma pack. <rdar://problem/10494810...
Eli Friedman [Fri, 2 Dec 2011 02:38:48 +0000 (02:38 +0000)]
Fix bitfield handling for record layout with #pragma pack.  <rdar://problem/10494810> and PR9560.

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

12 years agoruntime/Linux: Initial support for tying compiler-rt build into Clang build on
Daniel Dunbar [Fri, 2 Dec 2011 02:31:32 +0000 (02:31 +0000)]
runtime/Linux: Initial support for tying compiler-rt build into Clang build on
Linux.
 - Currently just builds a full library, and only on x86, and only for the
   target arch.

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

12 years agoAdd support for AVX registers to clang inline asm. Add a small testcase
Eric Christopher [Fri, 2 Dec 2011 02:12:16 +0000 (02:12 +0000)]
Add support for AVX registers to clang inline asm. Add a small testcase
and update the Sema testcase with a register that we won't hit for a while
I hope.

Fixes rdar://10510405

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

12 years agoClean up some oddly gratuitous vertical whitespace.
Eric Christopher [Fri, 2 Dec 2011 02:12:12 +0000 (02:12 +0000)]
Clean up some oddly gratuitous vertical whitespace.

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

12 years agoRename function.
Eric Christopher [Fri, 2 Dec 2011 02:12:09 +0000 (02:12 +0000)]
Rename function.

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

12 years agoImplementing parsing and resolution of module export declarations
Douglas Gregor [Fri, 2 Dec 2011 01:47:07 +0000 (01:47 +0000)]
Implementing parsing and resolution of module export declarations
within module maps, which will (eventually) be used to re-export a
module from another module. There are still some pieces missing,
however.

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

12 years agoFix test regression introduced by r145656. When seeing a string literal that isn...
Ted Kremenek [Fri, 2 Dec 2011 01:30:14 +0000 (01:30 +0000)]
Fix test regression introduced by r145656.  When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'.

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

12 years agoDiagnose use of wide string literal in 'asm' instead of crashing. Fixes <rdar:/...
Ted Kremenek [Fri, 2 Dec 2011 00:35:46 +0000 (00:35 +0000)]
Diagnose use of wide string literal in 'asm' instead of crashing.  Fixes <rdar://problem/10465079>.

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

12 years agoFix wrong-code bug when a const automatic variable of struct type has both a
Richard Smith [Fri, 2 Dec 2011 00:30:33 +0000 (00:30 +0000)]
Fix wrong-code bug when a const automatic variable of struct type has both a
mutable member and a constant initializer. We'd previously promoted such
variables to global constants, resulting in nasal demons if the mutable member
was modified.

This is only a temporary fix. The subtle interplay between isConstantInitializer
and CGExprConstant is very bug-prone; there are some other issues in this area
which I will be addressing in subsequent, more major reworking of this code.

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

12 years ago[asan] update docs to allow, but discourage, -O0
Kostya Serebryany [Fri, 2 Dec 2011 00:24:42 +0000 (00:24 +0000)]
[asan] update docs to allow, but discourage, -O0

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

12 years agoWhen we're passing a vector with an illegal type through memory on x86-64, use byval...
Eli Friedman [Fri, 2 Dec 2011 00:11:43 +0000 (00:11 +0000)]
When we're passing a vector with an illegal type through memory on x86-64, use byval so we're sure the backend does the right thing.  Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors.

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

12 years agoDriver/Darwin: Add ASAN runtime library link support.
Daniel Dunbar [Thu, 1 Dec 2011 23:40:18 +0000 (23:40 +0000)]
Driver/Darwin: Add ASAN runtime library link support.

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

12 years agoImplement name hiding for declarations deserialized from a non-visible
Douglas Gregor [Thu, 1 Dec 2011 22:20:10 +0000 (22:20 +0000)]
Implement name hiding for declarations deserialized from a non-visible
module. When that module becomes visible, so do those declarations.

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

12 years agoFix -forwardingTargetForSelector: (GNUstep runtime) which was broken for the
David Chisnall [Thu, 1 Dec 2011 18:40:09 +0000 (18:40 +0000)]
Fix -forwardingTargetForSelector: (GNUstep runtime) which was broken for the
old dispatch mechanism when I introduced the new one.

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

12 years agoAdd support for AMD's bulldozer.
Benjamin Kramer [Thu, 1 Dec 2011 18:23:59 +0000 (18:23 +0000)]
Add support for AMD's bulldozer.

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

12 years agoIntroduce the notion of name visibility into modules. For a given
Douglas Gregor [Thu, 1 Dec 2011 17:11:21 +0000 (17:11 +0000)]
Introduce the notion of name visibility into modules. For a given
(sub)module, all of the names may be hidden, just the macro names may
be exposed (for example, after the preprocessor has seen the import of
the module but the parser has not), or all of the names may be
exposed. Importing a module makes its names, and the names in any of
its non-explicit submodules, visible to name lookup (transitively).

This commit only introduces the notion of name visible and marks
modules and submodules as visible when they are imported. The actual
name-hiding logic in the AST reader will follow (along with test cases).

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

12 years ago[analyzer] Make KeychainAPI checker less aggressive. radar://10508828
Anna Zaks [Thu, 1 Dec 2011 16:41:58 +0000 (16:41 +0000)]
[analyzer] Make KeychainAPI checker less aggressive. radar://10508828

We trigger an error if free is called after a possibly failed allocation. Do not trigger the error if we know that the buffer is not null.

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

12 years agoWhen typo-correction an Objective-C superclass name, don't
Douglas Gregor [Thu, 1 Dec 2011 15:37:53 +0000 (15:37 +0000)]
When typo-correction an Objective-C superclass name, don't
typo-correct to ourselves.

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

12 years agoAdd Microsoft mangling of constructors and destructors. Patch by Dmitry!
Michael J. Spencer [Thu, 1 Dec 2011 09:55:00 +0000 (09:55 +0000)]
Add Microsoft mangling of constructors and destructors. Patch by Dmitry!

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

12 years agoChange the Microsoft __interface keyword to be an alias for struct (not class) since...
Francois Pichet [Thu, 1 Dec 2011 08:30:47 +0000 (08:30 +0000)]
Change the Microsoft __interface keyword to be an alias for struct (not class) since members are public by default.

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

12 years agoFix typo.
Ted Kremenek [Thu, 1 Dec 2011 07:39:23 +0000 (07:39 +0000)]
Fix typo.

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

12 years ago[analyzer] Refactor checkers to use helper function for getting callee Decl and name.
Anna Zaks [Thu, 1 Dec 2011 05:57:37 +0000 (05:57 +0000)]
[analyzer] Refactor checkers to use helper function for getting callee Decl and name.

We are getting name of the called function or it's declaration in a few checkers. Refactor them to use the helper function in the CheckerContext.

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

12 years agoWhen analyzing a C++ method (without a specific caller), assume 'this' is non-null...
Ted Kremenek [Thu, 1 Dec 2011 05:29:42 +0000 (05:29 +0000)]
When analyzing a C++ method (without a specific caller), assume 'this' is non-null.  Fixes <rdar://problem/10508787>.

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

12 years agoDon't use a varargs convention for calls unprototyped functions where one of the...
Eli Friedman [Thu, 1 Dec 2011 04:53:19 +0000 (04:53 +0000)]
Don't use a varargs convention for calls unprototyped functions where one of the arguments is an AVX vector.

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

12 years ago[libclang] Create a diagnostic set to pass at the end of indexing.
Argyrios Kyrtzidis [Thu, 1 Dec 2011 02:42:50 +0000 (02:42 +0000)]
[libclang] Create a diagnostic set to pass at the end of indexing.

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

12 years agoInfer the submodule ID for a given declaration based on the location
Douglas Gregor [Thu, 1 Dec 2011 02:07:58 +0000 (02:07 +0000)]
Infer the submodule ID for a given declaration based on the location
of that declaration, and encode the submodule ID in each declaration
stored in an AST file.

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

12 years agoWhen sending a message to a receiver that has "unknown any" type,
Douglas Gregor [Thu, 1 Dec 2011 01:37:36 +0000 (01:37 +0000)]
When sending a message to a receiver that has "unknown any" type,
force the unknown any type to "id" so that the message send can be
completed without requiring a case. Fixes <rdar://problem/10506646>.

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

12 years agoParmVarDecls have no linkage. Previously we would report that parameters
Argyrios Kyrtzidis [Thu, 1 Dec 2011 01:28:21 +0000 (01:28 +0000)]
ParmVarDecls have no linkage. Previously we would report that parameters
in type signatures have external linkage.

Fixes rdar://10058317.

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

12 years agoSwitch the ID numbers used for submodule IDs in the AST reader over to
Douglas Gregor [Thu, 1 Dec 2011 00:59:36 +0000 (00:59 +0000)]
Switch the ID numbers used for submodule IDs in the AST reader over to
a standard global/local scheme, so that submodule definitions will
eventually be able to refer to submodules in other top-level
modules. We'll need this functionality soonish.

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

12 years agoSpecially whitelist the selector 'addOperationWithBlock:' for the retain-cycle checki...
Ted Kremenek [Thu, 1 Dec 2011 00:59:21 +0000 (00:59 +0000)]
Specially whitelist the selector 'addOperationWithBlock:' for the retain-cycle checking in -Warc-retain-cycles.  This commonly
is hit by users using NSOperationQueue.  Fixes <rdar://problem/10465721>.

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

12 years agoFurther tweak -Wurneachable-code and templates by allowing the warning to run on
Ted Kremenek [Thu, 1 Dec 2011 00:59:17 +0000 (00:59 +0000)]
Further tweak -Wurneachable-code and templates by allowing the warning to run on
explicit template specializations (which represent actual functions somebody wrote).

Along the way, refactor some other code which similarly cares about whether or
not they are looking at a template instantiation.

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

12 years agoFix MSVC class layout for empty classes. Patch by Dmitry Sokolov.
Eli Friedman [Thu, 1 Dec 2011 00:37:01 +0000 (00:37 +0000)]
Fix MSVC class layout for empty classes.  Patch by Dmitry Sokolov.

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

12 years agoAnother GCC fix
Douglas Gregor [Wed, 30 Nov 2011 23:48:34 +0000 (23:48 +0000)]
Another GCC fix

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

12 years agoRevert most of r145372 for now. Lookahead beyond the ';' in a function
Richard Smith [Wed, 30 Nov 2011 23:45:35 +0000 (23:45 +0000)]
Revert most of r145372 for now. Lookahead beyond the ';' in a function
declaration tickles a bug in the way we handle visibility pragmas.

The improvement to error recovery for template function definitions declared
with the 'typedef' specifier in r145372 is unrelated and not reverted here.

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

12 years agoUnbreak build with GCC. Clang is too lame to diagnose this particular ill-formedness
Douglas Gregor [Wed, 30 Nov 2011 23:29:56 +0000 (23:29 +0000)]
Unbreak build with GCC. Clang is too lame to diagnose this particular ill-formedness

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

12 years agoPromote ModuleMap::Module to a namespace-scope class in the Basic
Douglas Gregor [Wed, 30 Nov 2011 23:21:26 +0000 (23:21 +0000)]
Promote ModuleMap::Module to a namespace-scope class in the Basic
library, since modules cut across all of the libraries. Rename
serialization::Module to serialization::ModuleFile to side-step the
annoying naming conflict. Prune a bunch of ModuleMap.h includes that
are no longer needed (most files only needed the Module type).

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

12 years ago[PCH] In ASTReader::FinishedDeserializing, after we do PassInterestingDeclsToConsumer
Argyrios Kyrtzidis [Wed, 30 Nov 2011 23:18:26 +0000 (23:18 +0000)]
[PCH] In ASTReader::FinishedDeserializing, after we do PassInterestingDeclsToConsumer
we may end up having added more pending stuff to do, so go in a loop until everything
is cleared out.

This fixes the error in rdar://10278815 which has a certain David Lynch-esque quality..

  error: unknown type name 'BOOL'; did you mean 'BOOL'?

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

12 years agoTest case for fix committed in r145441.
Lang Hames [Wed, 30 Nov 2011 23:03:25 +0000 (23:03 +0000)]
Test case for fix committed in r145441.

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

12 years agomake asan work at -O0, clang part. Patch by glider@google.com
Kostya Serebryany [Wed, 30 Nov 2011 22:20:21 +0000 (22:20 +0000)]
make asan work at -O0, clang part. Patch by glider@google.com

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

12 years agoPer an offline conversation with John McCall, have StmtPrinter actually print out...
Ted Kremenek [Wed, 30 Nov 2011 22:08:08 +0000 (22:08 +0000)]
Per an offline conversation with John McCall, have StmtPrinter actually print out the source expression for OpaqueValueExpr.

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

12 years agoDon't run -Wunreachable-code on template instantiations. Different instantiations...
Ted Kremenek [Wed, 30 Nov 2011 21:22:09 +0000 (21:22 +0000)]
Don't run -Wunreachable-code on template instantiations.  Different instantiations may produce different unreachable code results, and it is very difficult for us to prove that ALL instantiations of a template have specific unreachable code.  If we come up with a better solution, then we can revisit this, but this approach will at least greatly reduce the noise of this warning for code that makes use of templates.

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

12 years agoDon't collide loop variable names (to appease GCC)
Matt Beaumont-Gay [Wed, 30 Nov 2011 19:41:21 +0000 (19:41 +0000)]
Don't collide loop variable names (to appease GCC)

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

12 years agoNote that we'll need to handle __include_macros specially in the module loader
Douglas Gregor [Wed, 30 Nov 2011 19:39:08 +0000 (19:39 +0000)]
Note that we'll need to handle __include_macros specially in the module loader

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

12 years agoGet the -march argument based on the target MIPS architecture or cpu and pass
Akira Hatanaka [Wed, 30 Nov 2011 19:31:38 +0000 (19:31 +0000)]
Get the -march argument based on the target MIPS architecture or cpu and pass
it to GNU assembler. In addition, change function getMipsArchFromCPU() so that
it can be reused in ConstructJob().

Patch by Simon Atanasyan.

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

12 years agoUpdate CMake build.
Benjamin Kramer [Wed, 30 Nov 2011 18:56:24 +0000 (18:56 +0000)]
Update CMake build.

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

12 years agoMove the module auto-import logic after the logic that allows a
Douglas Gregor [Wed, 30 Nov 2011 18:12:06 +0000 (18:12 +0000)]
Move the module auto-import logic after the logic that allows a
callback client to suggest an alternative search path and after we
complain when the included file can't be found. The former can't be
tested in isolation, the latter doesn't actually matter (because we
won't make a module suggestion if no header is available). However,
the flow is better this way.

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

12 years agoTrivial indentation fix for the code I just committed
Douglas Gregor [Wed, 30 Nov 2011 18:03:26 +0000 (18:03 +0000)]
Trivial indentation fix for the code I just committed

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