]> granicus.if.org Git - clang/log
clang
13 years agoImplement mcount profiling, enabled via -pg.
Roman Divacky [Thu, 10 Feb 2011 16:52:03 +0000 (16:52 +0000)]
Implement mcount profiling, enabled via -pg.

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

13 years agoDrop the 'InBits' part from the name of RecordSizeInBits as the value is in
Ken Dyck [Thu, 10 Feb 2011 12:36:29 +0000 (12:36 +0000)]
Drop the 'InBits' part from the name of RecordSizeInBits as the value is in
character units.

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

13 years agoEliminate some signed-to-unsigned comparision warnings introduced in
Ken Dyck [Thu, 10 Feb 2011 12:20:05 +0000 (12:20 +0000)]
Eliminate some signed-to-unsigned comparision warnings introduced in
r125156.

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

13 years agoCMake: LLVM_NO_RTTI must be obsolete now!
NAKAMURA Takumi [Thu, 10 Feb 2011 09:15:32 +0000 (09:15 +0000)]
CMake: LLVM_NO_RTTI must be obsolete now!

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

13 years agoMove the check that gives functions with unique-external types unique-external
John McCall [Thu, 10 Feb 2011 06:50:24 +0000 (06:50 +0000)]
Move the check that gives functions with unique-external types unique-external
linkage into Decl.cpp.  Disable this logic for extern "C" functions, because
the operative rule there is weaker.  Fixes rdar://problem/8898466

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

13 years agoRun ~GRState() when reclaiming GRStates.
Ted Kremenek [Thu, 10 Feb 2011 03:07:40 +0000 (03:07 +0000)]
Run ~GRState() when reclaiming GRStates.

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

13 years agostatic analyzer: Make GRStates reference counted, with reference counts managed by...
Ted Kremenek [Thu, 10 Feb 2011 02:21:52 +0000 (02:21 +0000)]
static analyzer: Make GRStates reference counted, with reference counts managed by ExplodedNodes.

This reduces memory usage of the analyzer on sqlite by another 5%.

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

13 years agoAdd hack to CMakeLists.txt so that StaticAnalyzer libraries find their corresponding...
Ted Kremenek [Thu, 10 Feb 2011 01:03:09 +0000 (01:03 +0000)]
Add hack to CMakeLists.txt so that StaticAnalyzer libraries find their corresponding headers.

This is a hack because we really should only search in the 'include/clang/StaticAnalyzer' directory
if we are in 'lib/StaticAnalyzer'.  My CMake knowledge is limited, so I appeal to anyone with
more expertise.

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

13 years agoSplit 'include/clang/StaticAnalyzer' into 'include/clang/StaticAnalyzer/Core' and...
Ted Kremenek [Thu, 10 Feb 2011 01:03:03 +0000 (01:03 +0000)]
Split 'include/clang/StaticAnalyzer' into 'include/clang/StaticAnalyzer/Core' and 'include/clang/StaticAnalyzer/Checkers'.

This layout matches lib/StaticAnalyzer, which corresponds to two StaticAnalyzer libraries.

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

13 years agoIf an aggregate is returned as 'sret' argument then let debugger know about this.
Devang Patel [Thu, 10 Feb 2011 00:40:52 +0000 (00:40 +0000)]
If an aggregate is returned as 'sret' argument then let debugger know about this.

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

13 years agoUpdate clang-wpa to pass extra argument to AnalysisManager constructor.
Ted Kremenek [Wed, 9 Feb 2011 22:59:20 +0000 (22:59 +0000)]
Update clang-wpa to pass extra argument to AnalysisManager constructor.

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

13 years agoAdd target triple.
Devang Patel [Wed, 9 Feb 2011 22:29:15 +0000 (22:29 +0000)]
Add target triple.

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

13 years agoFix scoping of method declarations and issue
Fariborz Jahanian [Wed, 9 Feb 2011 22:20:01 +0000 (22:20 +0000)]
Fix scoping of method declarations and issue
warning when same parameter name used multiple times.
// rdar://8877730

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

13 years agoParse: add support for parsing CUDA kernel calls
Peter Collingbourne [Wed, 9 Feb 2011 21:12:02 +0000 (21:12 +0000)]
Parse: add support for parsing CUDA kernel calls

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

13 years agoLexer: add CUDA kernel call tokens
Peter Collingbourne [Wed, 9 Feb 2011 21:08:21 +0000 (21:08 +0000)]
Lexer: add CUDA kernel call tokens

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

13 years agoAST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actions
Peter Collingbourne [Wed, 9 Feb 2011 21:07:24 +0000 (21:07 +0000)]
AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actions

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

13 years agoAST, Sema, Serialization: keep track of cudaConfigureCall
Peter Collingbourne [Wed, 9 Feb 2011 21:04:32 +0000 (21:04 +0000)]
AST, Sema, Serialization: keep track of cudaConfigureCall

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

13 years agoDo not emit AT_MIPS_linkage_name for Objective-C method static variable i.
Devang Patel [Wed, 9 Feb 2011 19:16:38 +0000 (19:16 +0000)]
Do not emit AT_MIPS_linkage_name for Objective-C method static variable i.

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

13 years agoFinish up the diagnostic client before we've torn down the ASTReader,
Douglas Gregor [Wed, 9 Feb 2011 18:47:31 +0000 (18:47 +0000)]
Finish up the diagnostic client before we've torn down the ASTReader,
since the diagnostic client might poke at source locations that have
not yet been deserialized.

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

13 years agoDriver/Frontend: Wire up -mregparm=.
Daniel Dunbar [Wed, 9 Feb 2011 17:54:19 +0000 (17:54 +0000)]
Driver/Frontend: Wire up -mregparm=.

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

13 years agoNon-void functions need to return some value.
Nick Lewycky [Wed, 9 Feb 2011 08:42:57 +0000 (08:42 +0000)]
Non-void functions need to return some value.

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

13 years agoGive these little helper functions definitions so that newer gccs stop
John McCall [Wed, 9 Feb 2011 08:31:17 +0000 (08:31 +0000)]
Give these little helper functions definitions so that newer gccs stop
complaining.

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

13 years agoRemove vtables from the Stmt hierarchy; this was pretty easy as
John McCall [Wed, 9 Feb 2011 08:16:59 +0000 (08:16 +0000)]
Remove vtables from the Stmt hierarchy;  this was pretty easy as
there were only three virtual methods of any significance.

The primary way to grab child iterators now is with
  Stmt::child_range children();
  Stmt::const_child_range children() const;
where a child_range is just a std::pair of iterators suitable for
being llvm::tie'd to some locals.  I've left the old child_begin()
and child_end() accessors in place, but it's probably a substantial
penalty to grab the iterators individually now, since the
switch-based dispatch is kindof inherently slower than vtable
dispatch.  Grabbing them together is probably a slight win over the
status quo, although of course we could've achieved that with vtables, too.

I also reclassified SwitchCase (correctly) as an abstract Stmt
class, which (as the first such class that wasn't an Expr subclass)
required some fiddling in a few places.

There are somewhat gross metaprogramming hooks in place to ensure
that new statements/expressions continue to implement
getSourceRange() and children().  I had to work around a recent clang
bug;  dgregor actually fixed it already, but I didn't want to
introduce a selfhosting dependency on ToT.

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

13 years agoFix a typo in a comment in tools/clang/unittests/Frontend/Makefile.
Zhanyong Wan [Wed, 9 Feb 2011 07:42:47 +0000 (07:42 +0000)]
Fix a typo in a comment in tools/clang/unittests/Frontend/Makefile.

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

13 years agoInitialize 'reclaimNodes'.
Ted Kremenek [Wed, 9 Feb 2011 06:04:59 +0000 (06:04 +0000)]
Initialize 'reclaimNodes'.

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

13 years agotest: CMake: Be aware of LLVM_LIT_TOOLS_DIR.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:19:57 +0000 (04:19 +0000)]
test: CMake: Be aware of LLVM_LIT_TOOLS_DIR.

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

13 years agoEmit debug info for objc_selector.
Devang Patel [Wed, 9 Feb 2011 03:15:05 +0000 (03:15 +0000)]
Emit debug info for objc_selector.

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

13 years agoCorrect units in comments describing Size and getSize().
Ken Dyck [Wed, 9 Feb 2011 02:06:44 +0000 (02:06 +0000)]
Correct units in comments describing Size and getSize().

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

13 years agoWhen IRgen refers to a function declaration that is not a definition,
Douglas Gregor [Wed, 9 Feb 2011 02:03:05 +0000 (02:03 +0000)]
When IRgen refers to a function declaration that is not a definition,
and we later find the definition, make sure that we add the definition
(not the declaration) to the list of deferred definitions to
emit. Fixes PR8864.

Thanks to Nick Lewycky for testing this patch out

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

13 years agoConvert RecordLayout::Size to CharUnits from bits. No changes to
Ken Dyck [Wed, 9 Feb 2011 01:59:34 +0000 (01:59 +0000)]
Convert RecordLayout::Size to CharUnits from bits. No changes to
functionality intended.

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

13 years agostatic analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3...
Ted Kremenek [Wed, 9 Feb 2011 01:27:33 +0000 (01:27 +0000)]
static analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3 by 7-10% by recylcing "uninteresting" ExplodedNodes.

The optimization involves eagerly pruning ExplodedNodes from the ExplodedGraph that contain
practically no difference between the predecessor and successor nodes.  For example, if
the state is different between a predecessor and a node, the node is left in.  Only for
the 'environment' component of the state do we not care if the ExplodedNodes are different.
This paves the way for future optimizations where we can reclaim the environment objects.

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

13 years agoMake ProgramPoint::getTag() public.
Ted Kremenek [Wed, 9 Feb 2011 01:27:27 +0000 (01:27 +0000)]
Make ProgramPoint::getTag() public.

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

13 years agoNonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.
John McCall [Wed, 9 Feb 2011 01:13:10 +0000 (01:13 +0000)]
NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.

Also, reorganize and make very explicit the logic for determining
the value kind and type of a referenced declaration.

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

13 years agoIf an aggregate argument is passed indirectly because it has non trivial
Devang Patel [Wed, 9 Feb 2011 00:37:30 +0000 (00:37 +0000)]
If an aggregate argument is passed indirectly because it has non trivial
destructor or copy constructor than let debug info know about it.

Radar 8945514.

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

13 years agoNo longer pass deprecated '-nodistribute' flag to xcodebuild.
Ted Kremenek [Tue, 8 Feb 2011 22:54:30 +0000 (22:54 +0000)]
No longer pass deprecated '-nodistribute' flag to xcodebuild.

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

13 years agoanalyzer, retain/release checker: Remove hack where objects passed in message to...
Ted Kremenek [Tue, 8 Feb 2011 22:54:26 +0000 (22:54 +0000)]
analyzer, retain/release checker: Remove hack where objects passed in message to 'self' are no longer tracked.

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

13 years agoUpdate for API change.
Rafael Espindola [Tue, 8 Feb 2011 22:44:16 +0000 (22:44 +0000)]
Update for API change.

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

13 years agoWhen checking the 'weak' and 'weakref' attributes, look for non-external
John McCall [Tue, 8 Feb 2011 22:35:49 +0000 (22:35 +0000)]
When checking the 'weak' and 'weakref' attributes, look for non-external
linkage rather than the presence of the 'static' storage class specifier.
Fixes rdar://problem/8814626.

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

13 years agoFix an IRGen bug in property setter calls when
Fariborz Jahanian [Tue, 8 Feb 2011 22:33:23 +0000 (22:33 +0000)]
Fix an IRGen bug in property setter calls when
setter and getter types mismatch. // rdar://8966864

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

13 years ago[analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:36 +0000 (22:30 +0000)]
[analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.

Eventually there will also be a lib/StaticAnalyzer/Frontend that will handle initialization and checker registration.
Yet another library to avoid cyclic dependencies between Core and Checkers.

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

13 years ago[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.cpp -> lib/Static...
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:15 +0000 (22:30 +0000)]
[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.cpp -> lib/StaticAnalyzer/Checkers/ExperimentalChecks.cpp

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

13 years ago[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> lib/StaticAn...
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:11 +0000 (22:30 +0000)]
[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> lib/StaticAnalyzer/Checkers/ExperimentalChecks.h

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

13 years ago[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineInternalChecks.h -> lib/StaticAnalyz...
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:02 +0000 (22:30 +0000)]
[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineInternalChecks.h -> lib/StaticAnalyzer/Checkers/InternalChecks.h

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

13 years agoTest case accidentally left out of my last commit.
John McCall [Tue, 8 Feb 2011 22:28:39 +0000 (22:28 +0000)]
Test case accidentally left out of my last commit.

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

13 years agoSplit the serialized representation for the detailed preprocessing
Douglas Gregor [Tue, 8 Feb 2011 21:58:10 +0000 (21:58 +0000)]
Split the serialized representation for the detailed preprocessing
record away from the core processor record. The tangling of these two
data structures led to some inefficiencies (e.g., deserializing all
of the detailed preprocessing record when we didn't need it, such as
while performing code completion) along with some unnecessary
ugliness.

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

13 years agoAST: support for pre-arg expressions on CallExpr subclasses
Peter Collingbourne [Tue, 8 Feb 2011 21:18:02 +0000 (21:18 +0000)]
AST: support for pre-arg expressions on CallExpr subclasses

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

13 years agoStmtPrinter: factor out arg printing code to PrintCallArgs
Peter Collingbourne [Tue, 8 Feb 2011 21:17:54 +0000 (21:17 +0000)]
StmtPrinter: factor out arg printing code to PrintCallArgs

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

13 years agoAllow multiple -B prefixes. Patch by Joerg Sonnenberger.
Benjamin Kramer [Tue, 8 Feb 2011 20:31:42 +0000 (20:31 +0000)]
Allow multiple -B prefixes. Patch by Joerg Sonnenberger.

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

13 years agoClear the linkage cache recursively. Fixes PR8926.
John McCall [Tue, 8 Feb 2011 19:01:05 +0000 (19:01 +0000)]
Clear the linkage cache recursively.  Fixes PR8926.

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

13 years agoIn Sema::CheckShadow, get the DeclContext from the variable that we are checking
Argyrios Kyrtzidis [Tue, 8 Feb 2011 18:21:25 +0000 (18:21 +0000)]
In Sema::CheckShadow, get the DeclContext from the variable that we are checking
instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them.

Fixes http://llvm.org/PR9160 & rdar://problem/8966163.

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

13 years agoSupport for objextive-c++ use of property-dot syntax as receiver
Fariborz Jahanian [Tue, 8 Feb 2011 18:05:59 +0000 (18:05 +0000)]
Support for objextive-c++ use of property-dot syntax as receiver
in liu of a class method getter.
// rdar://8962253

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

13 years agoUpdate the writing of the block-information block in the AST file
Douglas Gregor [Tue, 8 Feb 2011 16:34:17 +0000 (16:34 +0000)]
Update the writing of the block-information block in the AST file
format, so that llvm-bcanalyzer knows about all of the various record
kinds.

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

13 years agoReorganize CodeGen{Function,Module} to eliminate the unfortunate
John McCall [Tue, 8 Feb 2011 08:22:06 +0000 (08:22 +0000)]
Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class.  Minor other refactorings.

Fixed a few address-space bugs while I was there.

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

13 years agoExtend the const capture optimization to C++ record types with no
John McCall [Tue, 8 Feb 2011 03:07:00 +0000 (03:07 +0000)]
Extend the const capture optimization to C++ record types with no
mutable fields and with trivial destructors and copy constructors.

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

13 years agoSema::MaybeBindToTemporary() shouldn't treat any expression returning
Douglas Gregor [Tue, 8 Feb 2011 02:14:35 +0000 (02:14 +0000)]
Sema::MaybeBindToTemporary() shouldn't treat any expression returning
a glvalue as a temporary. Previously, we were enumerating all of the
cases that coul return glvalues and might be called with
Sema::MaybeBindToTemporary(), but that was gross and we missed the
Objective-C property reference case.

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

13 years agoConvert RecordLayout::NonVirtualAlign to CharUnits. No change in
Ken Dyck [Tue, 8 Feb 2011 02:02:47 +0000 (02:02 +0000)]
Convert RecordLayout::NonVirtualAlign to CharUnits. No change in
functionality intended.

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

13 years agodgregor accidentally killed this assert, but on investigation, it can fire
John McCall [Tue, 8 Feb 2011 01:59:10 +0000 (01:59 +0000)]
dgregor accidentally killed this assert, but on investigation, it can fire
on invalid code and we don't really care, so kill it harder.

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

13 years agoSupport for objc use of property-dot syntax as receiver
Fariborz Jahanian [Tue, 8 Feb 2011 00:23:07 +0000 (00:23 +0000)]
Support for objc use of property-dot syntax as receiver
in liu of a class method getter. objc++ uses a different
code path and is more involved (TBD).

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

13 years agoWhen copy-capturing values for a nested capture, use a BlockDeclRefExpr.
John McCall [Mon, 7 Feb 2011 18:37:40 +0000 (18:37 +0000)]
When copy-capturing values for a nested capture, use a BlockDeclRefExpr.

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

13 years agoMove uninitialized variable checking back under -Wuninitialized-experimental. It...
Ted Kremenek [Mon, 7 Feb 2011 17:38:38 +0000 (17:38 +0000)]
Move uninitialized variable checking back under -Wuninitialized-experimental.  It is clear from user feedback that this warning is not quite ready.

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

13 years agoA few more tweaks to the blocks AST representation:
John McCall [Mon, 7 Feb 2011 10:33:21 +0000 (10:33 +0000)]
A few more tweaks to the blocks AST representation:
  - BlockDeclRefExprs always store VarDecls
  - BDREs no longer store copy expressions
  - BlockDecls now store a list of captured variables, information about
    how they're captured, and a copy expression if necessary

With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.

Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.

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

13 years agopre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)
Anton Yartsev [Mon, 7 Feb 2011 02:17:30 +0000 (02:17 +0000)]
pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)

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

13 years agoAdd another test that we can fully devirtualize now.
Anders Carlsson [Sun, 6 Feb 2011 20:16:20 +0000 (20:16 +0000)]
Add another test that we can fully devirtualize now.

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

13 years agoFix self-host; if a thunk already exists and has available_externally linkage, we...
Anders Carlsson [Sun, 6 Feb 2011 20:09:44 +0000 (20:09 +0000)]
Fix self-host; if a thunk already exists and has available_externally linkage, we should change its linkage instead of asserting.

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

13 years agoWhen building with optimizations, emit thunks with available_externally linkage so...
Anders Carlsson [Sun, 6 Feb 2011 18:31:40 +0000 (18:31 +0000)]
When building with optimizations, emit thunks with available_externally linkage so devirtualized function calls can also be de-thunked.

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

13 years agoSimplify thunks code.
Anders Carlsson [Sun, 6 Feb 2011 17:15:43 +0000 (17:15 +0000)]
Simplify thunks code.

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

13 years agoCLANG_BINARY_DIR is not the same thing as LLVM_BINARY_DIR when Clang
Oscar Fuentes [Sun, 6 Feb 2011 15:33:08 +0000 (15:33 +0000)]
CLANG_BINARY_DIR is not the same thing as LLVM_BINARY_DIR when Clang
is built as part of LLVM.

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

13 years agoadd some missing builtins.
Chris Lattner [Sun, 6 Feb 2011 12:45:51 +0000 (12:45 +0000)]
add some missing builtins.

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

13 years agoSupport running tests from the VS IDE and XCode.
Oscar Fuentes [Sat, 5 Feb 2011 21:37:51 +0000 (21:37 +0000)]
Support running tests from the VS IDE and XCode.

Untested, but should work :)

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

13 years agoRemove the clang++ symlink with `make clean'.
Oscar Fuentes [Sat, 5 Feb 2011 21:37:37 +0000 (21:37 +0000)]
Remove the clang++ symlink with `make clean'.

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

13 years agoAdd a __has_feature check for default template arguments in function
Douglas Gregor [Sat, 5 Feb 2011 20:35:30 +0000 (20:35 +0000)]
Add a __has_feature check for default template arguments in function
templates, a C++0x feature.

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

13 years agoCMake: libclang shall be named libclang.so, not liblibclang.so.
Oscar Fuentes [Sat, 5 Feb 2011 20:00:13 +0000 (20:00 +0000)]
CMake: libclang shall be named libclang.so, not liblibclang.so.

It is not possible to simply change that target name to `clang'
because we already have one.

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

13 years agoImprove our uniquing of file entries when files are re-saved or are
Douglas Gregor [Sat, 5 Feb 2011 19:42:43 +0000 (19:42 +0000)]
Improve our uniquing of file entries when files are re-saved or are
overridden via remapping. Thus, when we create a "virtual" file in the
file manager, we still stat() the real file that lives behind it so
that we can provide proper uniquing based on inodes. This helps keep
the file manager much more consistent.

To take advantage of this when reparsing files in libclang, we disable
the use of the stat() cache when reparsing or performing code
completion, since the stat() cache is very likely to be out of date in
this use case.

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

13 years agoBasic implementation of inherited constructors. Only generates declarations, and...
Sebastian Redl [Sat, 5 Feb 2011 19:23:19 +0000 (19:23 +0000)]
Basic implementation of inherited constructors. Only generates declarations, and probably only works for very basic use cases.

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

13 years agoSupport `make clang-test' when Clang is compiled outside of LLVM.
Oscar Fuentes [Sat, 5 Feb 2011 19:08:56 +0000 (19:08 +0000)]
Support `make clang-test' when Clang is compiled outside of LLVM.

This may not work on build platforms that place the binaries on
special folders ($build_dir/bin/Release/) such as the VS IDE and
XCode. For fixing this it is necessary to add a lit.py configuration
option for saying where the Clang binaries are, and apply to that path
the same magit that is used with the path to the LLVM tools binary
directory. Doing this requires a bit of autoconf work.

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

13 years agoPass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunctio...
Anders Carlsson [Sat, 5 Feb 2011 18:48:55 +0000 (18:48 +0000)]
Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we
won't assert when building a thunk for an implicit virtual member function that is not marked used.

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

13 years agopython bindings: Add support for different kind of completion chunks
Tobias Grosser [Sat, 5 Feb 2011 17:54:10 +0000 (17:54 +0000)]
python bindings: Add support for different kind of completion chunks

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

13 years agopython bindings: Get the string representation of a CompletionChunk
Tobias Grosser [Sat, 5 Feb 2011 17:54:07 +0000 (17:54 +0000)]
python bindings: Get the string representation of a CompletionChunk

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

13 years agopython bindings: Add CodeCompletionResults
Tobias Grosser [Sat, 5 Feb 2011 17:54:04 +0000 (17:54 +0000)]
python bindings: Add CodeCompletionResults

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

13 years agopython bindings: Add support for translationUnit.reparse().
Tobias Grosser [Sat, 5 Feb 2011 17:54:00 +0000 (17:54 +0000)]
python bindings: Add support for translationUnit.reparse().

This is the first step to make the clang_complete vim plugin work with
libclang. Reparsing improves parsing time from 0.8 to 0.25 secs for
one of my LLVM .cpp files.

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

13 years agopython bindings: Include local headers the right way.
Tobias Grosser [Sat, 5 Feb 2011 17:53:55 +0000 (17:53 +0000)]
python bindings: Include local headers the right way.

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

13 years agopython bindings: Remove unneeded instruction
Tobias Grosser [Sat, 5 Feb 2011 17:53:53 +0000 (17:53 +0000)]
python bindings: Remove unneeded instruction

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

13 years agopython bindings: fix Diagnostics.range iterator
Tobias Grosser [Sat, 5 Feb 2011 17:53:51 +0000 (17:53 +0000)]
python bindings: fix Diagnostics.range iterator

The iterator did never throw an IndexError. It was therefore not possible
to use it in a normal foreach loop as that loop would never stop.

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

13 years agopython bindings: Use python Diagnostics as function arguments
Tobias Grosser [Sat, 5 Feb 2011 17:53:48 +0000 (17:53 +0000)]
python bindings: Use python Diagnostics as function arguments

This improves the readability of the code and fixes one testsuite bug.

The bug happend, because we only stored the pointer to the diagnostic in the
FixIt iterator, but not the python Diagnostic object. So it could happen that
the FixIt iterator still exists, but the python Diagnostic object is freed.
However, as the python Diagnostic is freed the pointer to the diagnostic is also
freed and the FixIt iterator is referencing a freed pointer.

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

13 years agopython bindings: Synchronize cursor kinds
Tobias Grosser [Sat, 5 Feb 2011 17:53:47 +0000 (17:53 +0000)]
python bindings: Synchronize cursor kinds

clang-c/Index.h contained cursor kinds not yet available in the python bindings.

Contributed-By: jmuizelaar@mozilla.com
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124951 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix a false positive of the 'self' initialization checker.
Argyrios Kyrtzidis [Sat, 5 Feb 2011 05:54:53 +0000 (05:54 +0000)]
[analyzer] Fix a false positive of the 'self' initialization checker.

A common pattern in classes with multiple initializers is to put the
subclass's common initialization bits into a static function that receives
the value of 'self', e.g:

   if (!(self = [super init]))
     return nil;
   if (!(self = _commonInit(self)))
     return nil;

It was reported that 'self' was not set to the result of [super init].
Until we can use inter-procedural analysis, in such a call, transfer the
ObjCSelfInitChecker flags associated with 'self' to the result of the call.

Fixes rdar://8937441 & http://llvm.org/PR9094

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

13 years agoWhen the out-of-line definition differs from the declaration in the return type,
Argyrios Kyrtzidis [Sat, 5 Feb 2011 05:54:49 +0000 (05:54 +0000)]
When the out-of-line definition differs from the declaration in the return type,
say "out-of-line definition differ from the declaration in the return type" instead of
the silly "functions that differ only in their return type cannot be overloaded".

Addresses rdar://7980179.

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

13 years agoRe-land r124768, with a fix for PR9130.
Anders Carlsson [Sat, 5 Feb 2011 04:35:53 +0000 (04:35 +0000)]
Re-land r124768, with a fix for PR9130.

We now emit everything except unused implicit virtual member functions when building the vtable.

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

13 years agoDon't suggest -Wuninitialized fixits for uninitialized enum types.
Ted Kremenek [Sat, 5 Feb 2011 01:18:18 +0000 (01:18 +0000)]
Don't suggest -Wuninitialized fixits for uninitialized enum types.

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

13 years agoDon't crash when generating USRs for ObjC methods in protocols.
Ted Kremenek [Sat, 5 Feb 2011 01:10:26 +0000 (01:10 +0000)]
Don't crash when generating USRs for ObjC methods in protocols.

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

13 years agoRestore a test which I accientally overwrote in my last
Fariborz Jahanian [Fri, 4 Feb 2011 23:30:23 +0000 (23:30 +0000)]
Restore a test which I accientally overwrote in my last
patch.

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

13 years ago-Wselector should warn on implemented selectors only
Fariborz Jahanian [Fri, 4 Feb 2011 23:19:27 +0000 (23:19 +0000)]
-Wselector should warn on implemented selectors only
when selector metadata is generated, which is triggered
by at least on class implementation. This is to match gcc's
behavior. // rdar://8851684.

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

13 years agoAssert during instantiation of blocks that we've captured everything that
John McCall [Fri, 4 Feb 2011 18:33:18 +0000 (18:33 +0000)]
Assert during instantiation of blocks that we've captured everything that
we captured in the dependent case.

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

13 years agoAdd better support for ARM EABI triples.
Bob Wilson [Fri, 4 Feb 2011 17:59:28 +0000 (17:59 +0000)]
Add better support for ARM EABI triples.
Patch by Renato Golin!

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

13 years agoDriver: Fix spurious warning (from -cc1) about unused -fapple-kext on C inputs.
Daniel Dunbar [Fri, 4 Feb 2011 17:24:47 +0000 (17:24 +0000)]
Driver: Fix spurious warning (from -cc1) about unused -fapple-kext on C inputs.

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

13 years agobuild: Prevent duplicate inclusion of Makefile.rules, which causes make to warn
Daniel Dunbar [Fri, 4 Feb 2011 17:12:27 +0000 (17:12 +0000)]
build: Prevent duplicate inclusion of Makefile.rules, which causes make to warn
like crazy.
 - How no one else is bothered by this I can't understand!

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

13 years agoImprove our handling of the current instantiation for qualified
Douglas Gregor [Fri, 4 Feb 2011 13:35:07 +0000 (13:35 +0000)]
Improve our handling of the current instantiation for qualified
id-expression, e.g.,

  CurrentClass<T>::member

Previously, if CurrentClass<T> was dependent and not complete, we
would treat it as a dependent-scoped declaration reference expression,
even if CurrentClass<T> referred to the current instantiation.

Fixes PR8966 and improves type checking of templates.

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

13 years agoBefore checking bitfield initialization, make sure that neither the
Douglas Gregor [Fri, 4 Feb 2011 13:09:01 +0000 (13:09 +0000)]
Before checking bitfield initialization, make sure that neither the
bit-field width nor the initializer value are type- or
value-dependent. Fixes PR8712.

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

13 years agoWhen calling a bound pointer to member function, check the
Douglas Gregor [Fri, 4 Feb 2011 12:57:49 +0000 (12:57 +0000)]
When calling a bound pointer to member function, check the
cv-qualifiers on the object against the cv-qualifiers on the member
function. Fixes PR8315.

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

13 years agoTweak my fix for PR8748, and update the incorrect PR number in the test case.
Douglas Gregor [Fri, 4 Feb 2011 12:22:53 +0000 (12:22 +0000)]
Tweak my fix for PR8748, and update the incorrect PR number in the test case.

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