]> granicus.if.org Git - clang/log
clang
13 years agoGive some convenient idiomatic accessors to Stmt::child_range and
John McCall [Sun, 13 Feb 2011 04:07:26 +0000 (04:07 +0000)]
Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.

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

13 years agoLook through array types when deciding whether a field requires non-trivial
John McCall [Sun, 13 Feb 2011 00:46:43 +0000 (00:46 +0000)]
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic.  Fixes PR 9197.

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

13 years agoImplement objective-c++'s block pointer type matching involving
Fariborz Jahanian [Sat, 12 Feb 2011 19:07:46 +0000 (19:07 +0000)]
Implement objective-c++'s block pointer type matching involving
types which are contravariance in argument types and covariance
in return types. // rdar://8979379.

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

13 years agoTeach the IdempotentOperations checker to ignore property setters.
Ted Kremenek [Sat, 12 Feb 2011 18:50:03 +0000 (18:50 +0000)]
Teach the IdempotentOperations checker to ignore property setters.

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

13 years agoWhen reading the AST, delay loading of the redeclaration chain to avoid deeply nested...
Argyrios Kyrtzidis [Sat, 12 Feb 2011 07:50:47 +0000 (07:50 +0000)]
When reading the AST, delay loading of the redeclaration chain to avoid deeply nested calls.
Temporarily set the first (canonical) declaration as the previous one, which is the one that
matters, and mark the real previous DeclID to be loaded & attached later on.

Fixes rdar://8956193.

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

13 years agoUpdate static analyzer build to checker-255.
Ted Kremenek [Sat, 12 Feb 2011 03:20:34 +0000 (03:20 +0000)]
Update static analyzer build to checker-255.

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

13 years agoWeaken the ObjCSelfInitChecker to only warn when one calls an 'init' method within...
Ted Kremenek [Sat, 12 Feb 2011 03:03:54 +0000 (03:03 +0000)]
Weaken the ObjCSelfInitChecker to only warn when one calls an 'init' method within an 'init' method.  This is a temporary stop gap to avoid false positives while we investigate how to make it smarter.

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

13 years agoAdd test case for <rdar://problem/6888289>.
Ted Kremenek [Sat, 12 Feb 2011 01:25:04 +0000 (01:25 +0000)]
Add test case for <rdar://problem/6888289>.

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

13 years agostatic analyzer: Also invalidate instance variables of a receiver in a message expres...
Ted Kremenek [Sat, 12 Feb 2011 01:01:31 +0000 (01:01 +0000)]
static analyzer: Also invalidate instance variables of a receiver in a message expression, just as we do with parameters.

Fixes <rdar://problem/8725041>.

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

13 years agoDon't emit a dead store for '++' operations unless it occurs with a return statement...
Ted Kremenek [Sat, 12 Feb 2011 00:17:19 +0000 (00:17 +0000)]
Don't emit a dead store for '++' operations unless it occurs with a return statement.  We've never seen any other cases that were real bugs.

Fixes <rdar://problem/6962292>.

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

13 years agoAdd CMake dependencies so that LLVM_USED_LIBS order doesn't matter.
Jeffrey Yasskin [Fri, 11 Feb 2011 23:46:38 +0000 (23:46 +0000)]
Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.

I also sorted the tools/driver dependencies since their order no
longer matters.

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

13 years agoDon't report dead stores on unreachable code paths. Fixes <rdar://problem/8405222>.
Ted Kremenek [Fri, 11 Feb 2011 23:24:26 +0000 (23:24 +0000)]
Don't report dead stores on unreachable code paths.  Fixes <rdar://problem/8405222>.

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

13 years agoUses llvm::sys::path instead of hand-rolled algorithm in FileManager.
Zhanyong Wan [Fri, 11 Feb 2011 21:25:35 +0000 (21:25 +0000)]
Uses llvm::sys::path instead of hand-rolled algorithm in FileManager.
Reviewed by dgregor.

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

13 years agoAdd test case for PR 8646.
Ted Kremenek [Fri, 11 Feb 2011 20:13:27 +0000 (20:13 +0000)]
Add test case for PR 8646.

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

13 years agoReject forbidden storage class specifiers in OpenCL. Patch by George Russell!
Peter Collingbourne [Fri, 11 Feb 2011 19:59:54 +0000 (19:59 +0000)]
Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!

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

13 years agoRemove RegionStoreManager::evalBinOp(), which is now handled by the SValBuilder.
Ted Kremenek [Fri, 11 Feb 2011 19:48:19 +0000 (19:48 +0000)]
Remove RegionStoreManager::evalBinOp(), which is now handled by the SValBuilder.

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

13 years agoRename 'InvalidateRegions()' to 'invalidateRegions()'.
Ted Kremenek [Fri, 11 Feb 2011 19:48:15 +0000 (19:48 +0000)]
Rename 'InvalidateRegions()' to 'invalidateRegions()'.

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

13 years agoRename the operation that loads a preprocessed entity from a given offset to indicate...
Douglas Gregor [Fri, 11 Feb 2011 19:46:30 +0000 (19:46 +0000)]
Rename the operation that loads a preprocessed entity from a given offset to indicate that we're loading from an offset, not an index, lest one be confused. No functionality change.

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

13 years agoFix a block sema bug where result type of initializer
Fariborz Jahanian [Fri, 11 Feb 2011 18:46:17 +0000 (18:46 +0000)]
Fix a block sema bug where result type of initializer
is unqualified but its initialized is qualified.
This is for c only and fixes the imm. problem.
c++ is more involved and is wip.
// rdar://8979379

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

13 years agoImproves Clang's virtual file handling.
Zhanyong Wan [Fri, 11 Feb 2011 18:44:49 +0000 (18:44 +0000)]
Improves Clang's virtual file handling.

This patch contains:

- making some of the existing comments more accurate in the presence
of virtual files/directories.

- renaming some private data members of FileManager to match their roles better.

- creating 'DirectorEntry's for the parent directories of virtual
files, such that we can tell whether two virtual files are from the
same directory.  This is useful for injecting virtual files whose
directories don't exist in the real file system.

- minor clean-ups and adding comments for class
FileManager::UniqueDirContainer and FileManager::UniqueFileContainer.

- adding statistics on virtual files to FileManager::PrintStats().

- adding unit tests to verify the existing and new behavior of FileManager.

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

13 years agoDon't compare llvm::Optional<> objects directly; compare their
Douglas Gregor [Fri, 11 Feb 2011 18:08:15 +0000 (18:08 +0000)]
Don't compare llvm::Optional<> objects directly; compare their
contents when it's safe. I just *love* C++ some days.

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

13 years agoInitHeaderSearch.cpp: [PR8298] Don't touch drive G: on Windows hosts!
NAKAMURA Takumi [Fri, 11 Feb 2011 05:25:56 +0000 (05:25 +0000)]
InitHeaderSearch.cpp: [PR8298] Don't touch drive G: on Windows hosts!

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

13 years agoAllow the 'Eng' entry in GRStateManager to be a (possibly null) pointer instead of...
Ted Kremenek [Fri, 11 Feb 2011 04:20:16 +0000 (04:20 +0000)]
Allow the 'Eng' entry in GRStateManager to be a (possibly null) pointer instead of a reference.

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

13 years agoFor consistency, use llvm::raw_ostream in the rest of the mangle api.
Rafael Espindola [Fri, 11 Feb 2011 02:52:17 +0000 (02:52 +0000)]
For consistency, use llvm::raw_ostream in the rest of the mangle api.

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

13 years agoConvert RecordLayout::DataSize to CharUnits from bits, eliminating two
Ken Dyck [Fri, 11 Feb 2011 02:20:09 +0000 (02:20 +0000)]
Convert RecordLayout::DataSize to CharUnits from bits, eliminating two
unnecessary calls to RoundUpToAlignment. No changes to functionality
intended.

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

13 years agoAdd a helper function, ASTContext::toBits(), that converts sizes in
Ken Dyck [Fri, 11 Feb 2011 01:54:29 +0000 (01:54 +0000)]
Add a helper function, ASTContext::toBits(), that converts sizes in
CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.

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

13 years agoUse raw_ostream instead of raw_svector_ostream.
Rafael Espindola [Fri, 11 Feb 2011 01:41:00 +0000 (01:41 +0000)]
Use raw_ostream instead of raw_svector_ostream.

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

13 years agobuild/compiler-rt: Fake Clang into using the right assembler to build the ARM
Daniel Dunbar [Fri, 11 Feb 2011 01:29:49 +0000 (01:29 +0000)]
build/compiler-rt: Fake Clang into using the right assembler to build the ARM
bits for the runtime libraries.

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

13 years agoEliminate a major performance problem with chained PCH, where we were
Douglas Gregor [Fri, 11 Feb 2011 00:52:17 +0000 (00:52 +0000)]
Eliminate a major performance problem with chained PCH, where we were
causing the deserialization of a large number of declarations when
writing the visible-updates record for the translation unit in C. This
takes us from:

*** AST File Statistics:
  2 stat cache hits
  6 stat cache misses
  1/64463 source location entries read (0.001551%)
  15606/16956 types read (92.038216%)
  59266/89334 declarations read (66.342041%)
  38952/61393 identifiers read (63.446976%)
  0/7778 selectors read (0.000000%)
  24192/34644 statements read (69.830276%)
  388/8809 macros read (4.404586%)
  2095/5189 lexical declcontexts read (40.373867%)
  0/4587 visible declcontexts read (0.000000%)
  0/7716 method pool entries read (0.000000%)
  0 method pool misses

to

*** AST File Statistics:
  2 stat cache hits
  6 stat cache misses
  1/64463 source location entries read (0.001551%)
  26/16956 types read (0.153338%)
  18/89334 declarations read (0.020149%)
  145/61393 identifiers read (0.236183%)
  0/7778 selectors read (0.000000%)
  21/34644 statements read (0.060617%)
  0/8809 macros read (0.000000%)
  0/5189 lexical declcontexts read (0.000000%)
  0/4587 visible declcontexts read (0.000000%)
  0/7716 method pool entries read (0.000000%)
  0 method pool misses

when generating a chained PCH for a header that #includes Cocoa.h
(from a PCH file) and adds one simple function declaration. The
generated PCH file is now only 9580 bytes (down from > 2MB).

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

13 years agoImplement AST/PCH chaining support for macro definitions. Previously,
Douglas Gregor [Fri, 11 Feb 2011 00:26:14 +0000 (00:26 +0000)]
Implement AST/PCH chaining support for macro definitions. Previously,
we would deserialize all of the macro definitions we knew about while
serializing the macro definitions at the end of the AST/PCH file. Even
though we skipped most of them (since they were unchanged), it's still
a performance problem.

Now, we do the standard AST/PCH chaining trick: watch what identifiers
are deserialized as macro names, and consider only those identifiers
(along with macro definitions that have been deserialized/written in
the source) when serializing the preprocessor state.

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

13 years agoUse raw_svector_ostream in more places in the mangler.
Rafael Espindola [Thu, 10 Feb 2011 23:59:36 +0000 (23:59 +0000)]
Use raw_svector_ostream in more places in the mangler.

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

13 years agoAdd braces to quiet a gcc warning.
Matt Beaumont-Gay [Thu, 10 Feb 2011 20:35:01 +0000 (20:35 +0000)]
Add braces to quiet a gcc warning.

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

13 years agoFix think-o I committed without testing, shameful.
Daniel Dunbar [Thu, 10 Feb 2011 18:29:28 +0000 (18:29 +0000)]
Fix think-o I committed without testing, shameful.

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

13 years agoFix a gcc Wuninitialized false positive.
Daniel Dunbar [Thu, 10 Feb 2011 18:24:25 +0000 (18:24 +0000)]
Fix a gcc Wuninitialized false positive.

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

13 years agoWhen we're writing macro definitions to an AST/PCH File, sort the
Douglas Gregor [Thu, 10 Feb 2011 18:20:09 +0000 (18:20 +0000)]
When we're writing macro definitions to an AST/PCH File, sort the
macro definitions by macro name first. That way, we'll get a stable
ordering in the AST/PCH file.

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

13 years agoFor -Woverloaded-virtual take into account canonical methods. Fixes rdar://8979966...
Argyrios Kyrtzidis [Thu, 10 Feb 2011 18:13:41 +0000 (18:13 +0000)]
For -Woverloaded-virtual take into account canonical methods. Fixes rdar://8979966 & http://llvm.org/PR9182.

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

13 years agoFix family-friendly-o, tsk tsk.
Daniel Dunbar [Thu, 10 Feb 2011 18:10:07 +0000 (18:10 +0000)]
Fix family-friendly-o, tsk tsk.

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

13 years agoIRgen: Fix an immediate-exit-from-fn style nit.
Daniel Dunbar [Thu, 10 Feb 2011 17:32:22 +0000 (17:32 +0000)]
IRgen: Fix an immediate-exit-from-fn style nit.

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

13 years agoImplement two related optimizations that make de-serialization of
Douglas Gregor [Thu, 10 Feb 2011 17:09:37 +0000 (17:09 +0000)]
Implement two related optimizations that make de-serialization of
AST/PCH files more lazy:
  - Don't preload all of the file source-location entries when reading
  the AST file. Instead, load them lazily, when needed.
  - Only look up header-search information (whether a header was already
  #import'd, how many times it's been included, etc.) when it's needed
  by the preprocessor, rather than pre-populating it.

Previously, we would pre-load all of the file source-location entries,
which also populated the header-search information structure. This was
a relatively minor performance issue, since we would end up stat()'ing
all of the headers stored within a AST/PCH file when the AST/PCH file
was loaded. In the normal PCH use case, the stat()s were cached, so
the cost--of preloading ~860 source-location entries in the Cocoa.h
case---was relatively low.

However, the recent optimization that replaced stat+open with
open+fstat turned this into a major problem, since the preloading of
source-location entries would now end up opening those files. Worse,
those files wouldn't be closed until the file manager was destroyed,
so just opening a Cocoa.h PCH file would hold on to ~860 file
descriptors, and it was easy to blow through the process's limit on
the number of open file descriptors.

By eliminating the preloading of these files, we neither open nor stat
the headers stored in the PCH/AST file until they're actually needed
for something. Concretely, we went from

*** HeaderSearch Stats:
835 files tracked.
  364 #import/#pragma once files.
  823 included exactly once.
  6 max times a file is included.
  3 #include/#include_next/#import.
    0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
835 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

with a trivial program that uses a chained PCH including a Cocoa PCH
to

*** HeaderSearch Stats:
4 files tracked.
  1 #import/#pragma once files.
  3 included exactly once.
  2 max times a file is included.
  3 #include/#include_next/#import.
    0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
3 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

for the same program.

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

13 years agoAdjust the object files to be linked in when mcount profiling
Roman Divacky [Thu, 10 Feb 2011 16:59:40 +0000 (16:59 +0000)]
Adjust the object files to be linked in when mcount profiling
is specified in the FreeBSD linker driver.

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

13 years agoAdd a testcase for the mcount profiling.
Roman Divacky [Thu, 10 Feb 2011 16:52:35 +0000 (16:52 +0000)]
Add a testcase for the mcount profiling.

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

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