]> granicus.if.org Git - clang/log
clang
15 years ago[class.local] p1 and p3. Also, add back the xcodeproj file.
Anders Carlsson [Wed, 24 Jun 2009 00:10:43 +0000 (00:10 +0000)]
[class.local] p1 and p3. Also, add back the xcodeproj file.

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

15 years agoSome changes to accomodate Doug's comment for
Fariborz Jahanian [Tue, 23 Jun 2009 23:42:10 +0000 (23:42 +0000)]
Some changes to accomodate Doug's comment for
implicit copy constructor definition determination.

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

15 years agoStart propagating template parameter lists to the right places to
Douglas Gregor [Tue, 23 Jun 2009 23:11:28 +0000 (23:11 +0000)]
Start propagating template parameter lists to the right places to
handle function templates. There's no actual code for function
templates yet, but at least we complain about typedef templates.

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

15 years agoFix warning when building w/o asserts.
Daniel Dunbar [Tue, 23 Jun 2009 23:09:58 +0000 (23:09 +0000)]
Fix warning when building w/o asserts.

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

15 years agoIntroduce SourceManager::ísBeforeInTranslationUnit() which can compare 2 source locat...
Argyrios Kyrtzidis [Tue, 23 Jun 2009 22:01:48 +0000 (22:01 +0000)]
Introduce SourceManager::ísBeforeInTranslationUnit() which can compare 2 source locations and determine which one comes before the other, relative to the translation unit.

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

15 years agoMove the command line source location parsing from clang-cc.cpp into "include/Fronten...
Argyrios Kyrtzidis [Tue, 23 Jun 2009 22:01:39 +0000 (22:01 +0000)]
Move the command line source location parsing from clang-cc.cpp into "include/Frontend/CommandLineSourceLoc.h".

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

15 years agoUpdate CMakeLists.txt
Argyrios Kyrtzidis [Tue, 23 Jun 2009 22:01:29 +0000 (22:01 +0000)]
Update CMakeLists.txt

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

15 years agoFix build.
Ted Kremenek [Tue, 23 Jun 2009 21:50:16 +0000 (21:50 +0000)]
Fix build.

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

15 years agoPatch fixes an obscure bug when 'used' attribute is applied to
Fariborz Jahanian [Tue, 23 Jun 2009 21:47:46 +0000 (21:47 +0000)]
Patch fixes an obscure bug when 'used' attribute is applied to
variables in ObjC's Next runtime mode. Next runtime also implicitly applies
'used' attribute on some of its meta-data. This results in two
'llvm.used' arrays to be generated, and one of them is renamed to
'llvm.used1'.

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

15 years agoEliminate DeclPtrTy() arguments to ActOnDeclarator that are just a very, very weird...
Douglas Gregor [Tue, 23 Jun 2009 21:43:56 +0000 (21:43 +0000)]
Eliminate DeclPtrTy() arguments to ActOnDeclarator that are just a very, very weird way to pass "false". No functionality change

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

15 years agoRemove GRStateManager::getRegion/getSelfRegion().
Ted Kremenek [Tue, 23 Jun 2009 21:37:46 +0000 (21:37 +0000)]
Remove GRStateManager::getRegion/getSelfRegion().

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

15 years agoRemove GRStateManager::BindLoc() and GRStateManager::Unbind().
Ted Kremenek [Tue, 23 Jun 2009 20:38:51 +0000 (20:38 +0000)]
Remove GRStateManager::BindLoc() and GRStateManager::Unbind().

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

15 years agoRemove GRStateManager::BindDecl() and GRStateManager::BindDeclWithInit().
Ted Kremenek [Tue, 23 Jun 2009 20:27:53 +0000 (20:27 +0000)]
Remove GRStateManager::BindDecl() and GRStateManager::BindDeclWithInit().

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

15 years agoMake sure that argument-dependent lookup looks into the global scope
Douglas Gregor [Tue, 23 Jun 2009 20:14:09 +0000 (20:14 +0000)]
Make sure that argument-dependent lookup looks into the global scope
when it should.

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

15 years ago- Add MemRegion::getMemorySpace()
Ted Kremenek [Tue, 23 Jun 2009 18:17:08 +0000 (18:17 +0000)]
- Add MemRegion::getMemorySpace()
- Change implementation of MemRegion::hasStackStorage()/hasHeapStorage() to use
  'getMemorySpace()'.  This avoids a double traversal up the region hierarchy
  and is simpler.
- Add MemRegion::hasHeapOrStackStorage() as a slightly more efficient
  alternative to 'hasStackStorage() || hasHeapStorage()'.

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

15 years agoFix some TableGen-related dependencies for the Clang CMake build
Douglas Gregor [Tue, 23 Jun 2009 18:15:28 +0000 (18:15 +0000)]
Fix some TableGen-related dependencies for the Clang CMake build

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

15 years agoMove 'hasStackStorage()' and 'hasHeapStorage()' from MemRegionManager to MemRegion.
Ted Kremenek [Tue, 23 Jun 2009 18:05:21 +0000 (18:05 +0000)]
Move 'hasStackStorage()' and 'hasHeapStorage()' from MemRegionManager to MemRegion.

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

15 years agoAPI cleanup: move more methods from GRStateManager to GRState.
Ted Kremenek [Tue, 23 Jun 2009 17:55:07 +0000 (17:55 +0000)]
API cleanup: move more methods from GRStateManager to GRState.

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

15 years agoRemove old Xcode project. We can now automatically generate an Xcode project that...
Ted Kremenek [Tue, 23 Jun 2009 17:14:59 +0000 (17:14 +0000)]
Remove old Xcode project.  We can now automatically generate an Xcode project that compiles all of LLVM (not just Clang) using CMake.

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

15 years agoUpdate CMake file.
Ted Kremenek [Tue, 23 Jun 2009 16:54:53 +0000 (16:54 +0000)]
Update CMake file.

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

15 years agoAdd a test illustrating our current inability to properly cope with the point of...
Douglas Gregor [Tue, 23 Jun 2009 15:45:29 +0000 (15:45 +0000)]
Add a test illustrating our current inability to properly cope with the point of instantation of a member function of a class template specialization

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

15 years agoNew test for when the subexpressions within a typeid are potentially evaluated. We...
Douglas Gregor [Tue, 23 Jun 2009 15:32:13 +0000 (15:32 +0000)]
New test for when the subexpressions within a typeid are potentially evaluated. We seem to be the only ones to get this right.

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

15 years agoMove all factory methods from SVal to ValueManager. API cleanup!
Zhongxing Xu [Tue, 23 Jun 2009 09:02:15 +0000 (09:02 +0000)]
Move all factory methods from SVal to ValueManager. API cleanup!

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

15 years agoSplit ValueManager method definitions into its own source file.
Zhongxing Xu [Tue, 23 Jun 2009 06:22:22 +0000 (06:22 +0000)]
Split ValueManager method definitions into its own source file.
No functionality change.

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

15 years agoValueManager::makeNonLoc -> ValueManager::makeIntVal
Zhongxing Xu [Tue, 23 Jun 2009 06:13:19 +0000 (06:13 +0000)]
ValueManager::makeNonLoc -> ValueManager::makeIntVal
Clean up code with ValueManager.

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

15 years agoIf the init list is fewer than the struct fields, bind the rest fields to 0
Zhongxing Xu [Tue, 23 Jun 2009 05:43:16 +0000 (05:43 +0000)]
If the init list is fewer than the struct fields, bind the rest fields to 0
explicitly. Make 0 value with the field type.

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

15 years agoInstead of setting the default value of the array region, bind the rest of the
Zhongxing Xu [Tue, 23 Jun 2009 05:23:38 +0000 (05:23 +0000)]
Instead of setting the default value of the array region, bind the rest of the
array elements to 0 explicitly. Create 0 values with the element type.

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

15 years agoFix our check for "random whitespace between a \ and newline" to work
Chris Lattner [Tue, 23 Jun 2009 05:15:06 +0000 (05:15 +0000)]
Fix our check for "random whitespace between a \ and newline" to work
with dos style newlines.  I have a trivial test for this:

// RUN: clang-cc %s -verify
#define test(x, y) \
   x ## y

but I don't know how to get svn to not change newlines and testrunner
doesn't work with dos style newlines either, so "not worth it". :)

rdar://6994000

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

15 years agoMemRegionManager: Migrate logic for getCodeTextRegion() over to using
Zhongxing Xu [Tue, 23 Jun 2009 03:50:30 +0000 (03:50 +0000)]
MemRegionManager: Migrate logic for getCodeTextRegion() over to using
trait-based MemRegion creation.

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

15 years agoRemove duplicated methods.
Zhongxing Xu [Tue, 23 Jun 2009 02:51:21 +0000 (02:51 +0000)]
Remove duplicated methods.

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

15 years agoadd a fixme.
Zhongxing Xu [Tue, 23 Jun 2009 02:08:56 +0000 (02:08 +0000)]
add a fixme.

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

15 years agofix PR4423.
Chris Lattner [Tue, 23 Jun 2009 01:38:41 +0000 (01:38 +0000)]
fix PR4423.

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

15 years agoCheck in a new template argument list builder that should work better for variadic...
Anders Carlsson [Tue, 23 Jun 2009 01:26:57 +0000 (01:26 +0000)]
Check in a new template argument list builder that should work better for variadic templates.

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

15 years agoswitch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
Chris Lattner [Tue, 23 Jun 2009 01:20:39 +0000 (01:20 +0000)]
switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
Among other things, this makes the warning about unknown warning options mappable.
For example:

$ clang t.c -Werror -Wfoo
error: unknown warning option '-Wfoo' [-Wunknown-warning-option]

For another thing, they are properly color coded now too :)

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

15 years agoMemRegions:
Ted Kremenek [Tue, 23 Jun 2009 00:46:41 +0000 (00:46 +0000)]
MemRegions:
- Embed a reference to MemRegionManager objects in MemSpaceRegion objects
- Use this embedded reference for MemRegion objects to access ASTContext objects without external help
- Use this access to ASTContext to simplify 'isBoundable' (no ASTContext& argument required)

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

15 years ago__APPLE_CC__ should only be set when building for darwin targets.
Chris Lattner [Tue, 23 Jun 2009 00:43:21 +0000 (00:43 +0000)]
__APPLE_CC__ should only be set when building for darwin targets.

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

15 years agoRemove operator '<=' overload for SourceLocation.
Argyrios Kyrtzidis [Tue, 23 Jun 2009 00:42:21 +0000 (00:42 +0000)]
Remove operator '<=' overload for SourceLocation.

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

15 years agoDon't use operator overload '<' for SourceLocation, it has not semantic meaning.
Argyrios Kyrtzidis [Tue, 23 Jun 2009 00:42:15 +0000 (00:42 +0000)]
Don't use operator overload '<' for SourceLocation, it has not semantic meaning.

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

15 years agoIn SourceManager::createFileID missed setting ContentCache's FirstFID in another...
Argyrios Kyrtzidis [Tue, 23 Jun 2009 00:42:06 +0000 (00:42 +0000)]
In SourceManager::createFileID missed setting ContentCache's FirstFID in another place.

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

15 years agoAdd a comment.
Argyrios Kyrtzidis [Tue, 23 Jun 2009 00:42:00 +0000 (00:42 +0000)]
Add a comment.

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

15 years agoMemRegionManager: Migrate logic for getAllocaRegion() over to using trait-based MemRe...
Ted Kremenek [Tue, 23 Jun 2009 00:15:41 +0000 (00:15 +0000)]
MemRegionManager: Migrate logic for getAllocaRegion() over to using trait-based MemRegion creation.

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

15 years agoMemRegionManager: Migrate getObjCObjectRegion() and getTypedViewRegion() to use
Ted Kremenek [Tue, 23 Jun 2009 00:04:09 +0000 (00:04 +0000)]
MemRegionManager: Migrate getObjCObjectRegion() and getTypedViewRegion() to use
the new trait-based construction of MemRegion objects.

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

15 years agoSome semantic tests for implicit instantiations
Douglas Gregor [Mon, 22 Jun 2009 23:57:29 +0000 (23:57 +0000)]
Some semantic tests for implicit instantiations

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

15 years agopatch to mark use of implicit copy constructors.
Fariborz Jahanian [Mon, 22 Jun 2009 23:34:40 +0000 (23:34 +0000)]
patch to mark use of implicit copy constructors.

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

15 years agoMigrate factory methods for FieldRegion and ObjCIVarRegion creation to use the
Ted Kremenek [Mon, 22 Jun 2009 23:34:21 +0000 (23:34 +0000)]
Migrate factory methods for FieldRegion and ObjCIVarRegion creation to use the
new generalized region-construction code.

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

15 years agoRobustify a bunch of C++-related declaration actions.
Douglas Gregor [Mon, 22 Jun 2009 23:20:33 +0000 (23:20 +0000)]
Robustify a bunch of C++-related declaration actions.

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

15 years agoRefactor some of the logic in MemRegionManager for constructing regions using
Ted Kremenek [Mon, 22 Jun 2009 23:13:13 +0000 (23:13 +0000)]
Refactor some of the logic in MemRegionManager for constructing regions using
member template functions and traits. The idea is to allow MemRegionManager to
construct subclasses of MemRegion that aren't declared in MemRegion.h (e.g.,
checker-specific regions).

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

15 years agoImplement implicit instantiation of the member functions of a class template
Douglas Gregor [Mon, 22 Jun 2009 23:06:13 +0000 (23:06 +0000)]
Implement implicit instantiation of the member functions of a class template
specialization. At present, all implicit instantiations occur at the
end of the translation unit.

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

15 years agoadd a warning group for unavailable decls that mirrors the one for
Chris Lattner [Mon, 22 Jun 2009 23:04:45 +0000 (23:04 +0000)]
add a warning group for unavailable decls that mirrors the one for
deprecated decls.

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

15 years agoRework the way we track which declarations are "used" during
Douglas Gregor [Mon, 22 Jun 2009 20:57:11 +0000 (20:57 +0000)]
Rework the way we track which declarations are "used" during
compilation, and (hopefully) introduce RAII objects for changing the
"potentially evaluated" state at all of the necessary places within
Sema and Parser. Other changes:

  - Set the unevaluated/potentially-evaluated context appropriately
    during template instantiation.
  - We now recognize three different states while parsing or
    instantiating expressions: unevaluated, potentially evaluated, and
    potentially potentially evaluated (for C++'s typeid).
  - When we're in a potentially potentially-evaluated context, queue
    up MarkDeclarationReferenced calls in a stack. For C++ typeid
    expressions that are potentially evaluated, we will play back
    these MarkDeclarationReferenced calls when we exit the
    corresponding potentially potentially-evaluated context.
  - Non-type template arguments are now parsed as constant
    expressions, so they are not potentially-evaluated.

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

15 years agoChanges made per Doug's comments.
Fariborz Jahanian [Mon, 22 Jun 2009 20:37:23 +0000 (20:37 +0000)]
Changes made per Doug's comments.

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

15 years agoRemove ImplicitMustBeDefined, use universal 'Used' flag
Fariborz Jahanian [Mon, 22 Jun 2009 17:30:33 +0000 (17:30 +0000)]
Remove ImplicitMustBeDefined, use universal 'Used' flag
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.

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

15 years agoAddressing Doug's suggestions:
Argyrios Kyrtzidis [Mon, 22 Jun 2009 17:13:31 +0000 (17:13 +0000)]
Addressing Doug's suggestions:

-Added comment for FunctionDecl::EndRangeLoc
-Removed a redundant check from FunctionDecl::setBody

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

15 years agoFixed text of a diagnostics.
Fariborz Jahanian [Mon, 22 Jun 2009 16:33:37 +0000 (16:33 +0000)]
Fixed text of a diagnostics.

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

15 years agoAllow CodeTextRegion to be cast to 'void *'.
Zhongxing Xu [Mon, 22 Jun 2009 08:36:10 +0000 (08:36 +0000)]
Allow CodeTextRegion to be cast to 'void *'.

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

15 years agoRenamed Protocol as TheProtocol so people can use clang header for
Fariborz Jahanian [Sun, 21 Jun 2009 18:26:03 +0000 (18:26 +0000)]
Renamed Protocol as TheProtocol so people can use clang header for
building obj-c++ clients. "Protocol" is a class name in Cocoa.h

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

15 years agoReturn UnknownVal for pointer arithmetic on struct fields.
Zhongxing Xu [Sun, 21 Jun 2009 13:24:24 +0000 (13:24 +0000)]
Return UnknownVal for pointer arithmetic on struct fields.

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

15 years agoMade improvements in c++'s object model patch on Doug's review.
Fariborz Jahanian [Sat, 20 Jun 2009 20:23:38 +0000 (20:23 +0000)]
Made improvements in c++'s object model patch on Doug's review.

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

15 years agoSlight modification to column checking inside SourceManager::getLocation().
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:40:15 +0000 (08:40 +0000)]
Slight modification to column checking inside SourceManager::getLocation().

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

15 years agoAdd the license part to the new source files.
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:27:14 +0000 (08:27 +0000)]
Add the license part to the new source files.

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

15 years agoIntroduce SourceManager::getLocation() to get a source location out of a "file:line...
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:09:57 +0000 (08:09 +0000)]
Introduce SourceManager::getLocation() to get a source location out of a "file:line:column" triplet.

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

15 years agoSerialize FunctionDecl's EndRangeLoc out to the PCH file.
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:09:34 +0000 (08:09 +0000)]
Serialize FunctionDecl's EndRangeLoc out to the PCH file.

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

15 years agoIntroduce Decl::getSourceRange() which, like Stmt::getSourceRange(), represents the...
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:09:14 +0000 (08:09 +0000)]
Introduce Decl::getSourceRange() which, like Stmt::getSourceRange(), represents the range that the declaration covers.

Add initial support for NamespaceDecl, VarDecl, and FunctionDecl:
-NamespaceDecl range is from name to '}'
-VarDecl is from name to possible init expression
-FunctionDecl is from name to last parameter name or to end of its function body.

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

15 years agoAdd operator '<=' for comparing SourceLocations.
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:08:38 +0000 (08:08 +0000)]
Add operator '<=' for comparing SourceLocations.

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

15 years agoIntroduce the ASTUnit class.
Argyrios Kyrtzidis [Sat, 20 Jun 2009 08:08:23 +0000 (08:08 +0000)]
Introduce the ASTUnit class.

ASTUnit is a helper class to allow easy loading of an ASTContext from a PCH file. No users for now.

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

15 years agoParsing and AST support for using declarations, from John Thompson!
Douglas Gregor [Sat, 20 Jun 2009 00:51:54 +0000 (00:51 +0000)]
Parsing and AST support for using declarations, from John Thompson!

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

15 years agoAdd -fblocks
Douglas Gregor [Sat, 20 Jun 2009 00:29:46 +0000 (00:29 +0000)]
Add -fblocks

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

15 years agoAdded writing and reading of the ConstQualAdded flag of
Fariborz Jahanian [Sat, 20 Jun 2009 00:02:26 +0000 (00:02 +0000)]
Added writing and reading of the ConstQualAdded flag of
BlockDeclRefExpr to PCH.

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

15 years agoKeep track of when declarations are "used" according to C and
Douglas Gregor [Fri, 19 Jun 2009 23:52:42 +0000 (23:52 +0000)]
Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.

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

15 years agoUse QualType to represent block's implicit return type as
Fariborz Jahanian [Fri, 19 Jun 2009 23:37:08 +0000 (23:37 +0000)]
Use QualType to represent block's implicit return type as
to not lose its 'const/volatile' qualifier.

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

15 years agoPatch for implementation of C++'s object model. This is
Fariborz Jahanian [Fri, 19 Jun 2009 19:55:27 +0000 (19:55 +0000)]
Patch for implementation of C++'s object model. This is
work in progress.

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

15 years agoRemove more GetSVal/GetLValue methods in GRExprEngine/GRState, instead
Ted Kremenek [Fri, 19 Jun 2009 17:10:32 +0000 (17:10 +0000)]
Remove more GetSVal/GetLValue methods in GRExprEngine/GRState, instead
preferring to use their replacements in GRState. This further unifies the code
paths for such logic and leads to some code reduction.

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

15 years agoFix bug in the new PCHReader constructor. PP and Context should be initialized to 0.
Argyrios Kyrtzidis [Fri, 19 Jun 2009 07:55:35 +0000 (07:55 +0000)]
Fix bug in the new PCHReader constructor. PP and Context should be initialized to 0.

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

15 years agoTiny correction on the command-line source location parser.
Argyrios Kyrtzidis [Fri, 19 Jun 2009 06:32:46 +0000 (06:32 +0000)]
Tiny correction on the command-line source location parser.

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

15 years agoA further step of r73690: associate the cast-to type with the created symbol,
Zhongxing Xu [Fri, 19 Jun 2009 06:00:32 +0000 (06:00 +0000)]
A further step of r73690: associate the cast-to type with the created symbol,
because the type of the symbol is used to create the default range. We need the
sign to be consistent.

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

15 years agoIf the SymbolicRegion was cast to another type, use that type to create the
Zhongxing Xu [Fri, 19 Jun 2009 04:51:14 +0000 (04:51 +0000)]
If the SymbolicRegion was cast to another type, use that type to create the
ElementRegion.

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

15 years agoMake changes to PCHReader to allow reading a PCH file without having a pre-initialize...
Argyrios Kyrtzidis [Fri, 19 Jun 2009 00:03:23 +0000 (00:03 +0000)]
Make changes to PCHReader to allow reading a PCH file without having a pre-initialized Preprocessor.

-Introduce 'PCHReaderListener' which is an abstract interface for getting various information from the PCHReader.
-If PCHReader is constructed without a Preprocessor, it can still load the file and invoke the callbacks of PCHReaderListener.
-If PCHReader is constructed with an initialized Preprocessor, PCHValidator is used as a PCHReaderListener to validate the contents of the PCH file against the given Preprocessor.

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

15 years agoMove clients over from using GRStateManager::BindXXX and friends to
Ted Kremenek [Thu, 18 Jun 2009 23:58:37 +0000 (23:58 +0000)]
Move clients over from using GRStateManager::BindXXX and friends to
GRState->bindXXX and friends (and constify some arguments along the way).

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

15 years agoRemove GRStateManager& field from SimpleConstraintManager.
Ted Kremenek [Thu, 18 Jun 2009 23:20:05 +0000 (23:20 +0000)]
Remove GRStateManager& field from SimpleConstraintManager.

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

15 years agolibAnalysis:
Ted Kremenek [Thu, 18 Jun 2009 22:57:13 +0000 (22:57 +0000)]
libAnalysis:
- Remove the 'isFeasible' flag from all uses of 'Assume'.
- Remove the 'Assume' methods from GRStateManager.  Now the only way to
  create a new GRState with an assumption is to use the new 'assume' methods
  in GRState.

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

15 years agoSome cleanups suggested by Chris
Douglas Gregor [Thu, 18 Jun 2009 18:45:36 +0000 (18:45 +0000)]
Some cleanups suggested by Chris

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

15 years agoMove the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
Douglas Gregor [Thu, 18 Jun 2009 16:11:24 +0000 (16:11 +0000)]
Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.

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

15 years agoAdd some missing CMake dependencies
Douglas Gregor [Thu, 18 Jun 2009 15:05:47 +0000 (15:05 +0000)]
Add some missing CMake dependencies

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

15 years agoModify test case comments.
Zhongxing Xu [Thu, 18 Jun 2009 06:49:35 +0000 (06:49 +0000)]
Modify test case comments.

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

15 years agoWhen casting region, if we do not create an element region, record the cast-to
Zhongxing Xu [Thu, 18 Jun 2009 06:29:10 +0000 (06:29 +0000)]
When casting region, if we do not create an element region, record the cast-to
type.

When retrieving the region value, if we are going to create a symbol value, use
the cast-to type if possible.

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

15 years agoFix a crash that can occur when a #pragma handler eats to the end of the
Chris Lattner [Thu, 18 Jun 2009 05:55:53 +0000 (05:55 +0000)]
Fix a crash that can occur when a #pragma handler eats to the end of the
line, and when the pragma is at the end of a file.  In this case, the last
token consumed could pop the lexer, invalidating CurPPLexer.  Thanks to
Peter Thoman for pointing it out.

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

15 years agoMore GRStateRef removal fix.
Zhongxing Xu [Thu, 18 Jun 2009 03:42:19 +0000 (03:42 +0000)]
More GRStateRef removal fix.

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

15 years agoAdd a target triple to a couple of tests which depend on it. Reported
Eli Friedman [Thu, 18 Jun 2009 02:04:19 +0000 (02:04 +0000)]
Add a target triple to a couple of tests which depend on it.  Reported
by Mark Cianciosa on cfe-dev.

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

15 years agoRemove GRStateRef.
Ted Kremenek [Thu, 18 Jun 2009 01:33:24 +0000 (01:33 +0000)]
Remove GRStateRef.

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

15 years agoRemove more dependencies on GRStateRef. As a consequence, we can now
Ted Kremenek [Thu, 18 Jun 2009 01:23:53 +0000 (01:23 +0000)]
Remove more dependencies on GRStateRef.  As a consequence, we can now
pretty-print a GRState object anywhere it is referenced (instead of
needing a GRStateRef of a GRStateManager handy).

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

15 years agoRemove another dependency on GRStateRef.
Ted Kremenek [Thu, 18 Jun 2009 00:49:02 +0000 (00:49 +0000)]
Remove another dependency on GRStateRef.

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

15 years agoDiagnose class members that shadow a template parameter. Fixes
Douglas Gregor [Wed, 17 Jun 2009 23:37:01 +0000 (23:37 +0000)]
Diagnose class members that shadow a template parameter. Fixes
<rdar://problem/6952203>.

To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.

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

15 years agoFix regression testing in Xcode, again
Douglas Gregor [Wed, 17 Jun 2009 23:35:04 +0000 (23:35 +0000)]
Fix regression testing in Xcode, again

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

15 years agoFix some erroneous comments due to trigger-happy copy&paste.
Argyrios Kyrtzidis [Wed, 17 Jun 2009 23:19:02 +0000 (23:19 +0000)]
Fix some erroneous comments due to trigger-happy copy&paste.

No functionality change.

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

15 years agoFactor out some common code into Sema::EnterDeclaratorContext/ExitDeclaratorContext.
Argyrios Kyrtzidis [Wed, 17 Jun 2009 23:15:40 +0000 (23:15 +0000)]
Factor out some common code into Sema::EnterDeclaratorContext/ExitDeclaratorContext.

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

15 years agoImplement correct name lookup inside an initializer of a C++ class static data member.
Argyrios Kyrtzidis [Wed, 17 Jun 2009 22:50:06 +0000 (22:50 +0000)]
Implement correct name lookup inside an initializer of a C++ class static data member.

Fixes "test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp" test case.

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

15 years agoMove CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.
Argyrios Kyrtzidis [Wed, 17 Jun 2009 22:49:50 +0000 (22:49 +0000)]
Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

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

15 years agoRemoved deadcode related to addition of constructor
Fariborz Jahanian [Wed, 17 Jun 2009 22:44:31 +0000 (22:44 +0000)]
Removed deadcode related to addition of constructor
decls to a class.

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

15 years agoFirst step toward fixing <rdar://problem/6613046> refactor clang objc type representa...
Steve Naroff [Wed, 17 Jun 2009 22:40:22 +0000 (22:40 +0000)]
First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).

No functionality change.

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

15 years agoRemove more uses of GRStateRef.
Ted Kremenek [Wed, 17 Jun 2009 22:28:13 +0000 (22:28 +0000)]
Remove more uses of GRStateRef.

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