]> granicus.if.org Git - clang/log
clang
14 years agoMinor cleanup: move typedef out of anonymous namespace (which now contains nothing...
Ted Kremenek [Sat, 17 Oct 2009 17:45:11 +0000 (17:45 +0000)]
Minor cleanup: move typedef out of anonymous namespace (which now contains nothing) and into RemoveDeadBindings.  No functionality change.

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

14 years agoWrite the preprocessor block after we write out types + declarations,
Douglas Gregor [Sat, 17 Oct 2009 17:25:45 +0000 (17:25 +0000)]
Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.

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

14 years agoSuppress -Asserts warning.
Daniel Dunbar [Sat, 17 Oct 2009 09:39:30 +0000 (09:39 +0000)]
Suppress -Asserts warning.

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

14 years agoRemove a FIXME that doesn't belong, there are numerous other places that use
Daniel Dunbar [Sat, 17 Oct 2009 09:38:57 +0000 (09:38 +0000)]
Remove a FIXME that doesn't belong, there are numerous other places that use
alignment in bits in clang. If we really want to fix this, it should be a bugzilla.

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

14 years agoSimplify (move guard to caller instead of callee).
Daniel Dunbar [Sat, 17 Oct 2009 09:04:56 +0000 (09:04 +0000)]
Simplify (move guard to caller instead of callee).

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

14 years agoPer discussion with Ted, the 'FromSuper'/'FromSub' logic is invalid. Simplify
Zhongxing Xu [Sat, 17 Oct 2009 08:39:24 +0000 (08:39 +0000)]
Per discussion with Ted, the 'FromSuper'/'FromSub' logic is invalid. Simplify
the code to standard worklist algorithm. Always add both sub and super
regions of live regions.

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

14 years agoFix another static analyzer crash due to a corner case in "folding" symbolic values...
Ted Kremenek [Sat, 17 Oct 2009 07:39:35 +0000 (07:39 +0000)]
Fix another static analyzer crash due to a corner case in "folding" symbolic values that are constrained to be a constant.

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

14 years agoActually all regions whose super region is not MemSpaceRegion are of these 3
Zhongxing Xu [Sat, 17 Oct 2009 07:32:08 +0000 (07:32 +0000)]
Actually all regions whose super region is not MemSpaceRegion are of these 3
kinds. This means we are visiting all regions 'from super region'.

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

14 years agoFix compiler warning: "ISO C90 forbids mixed declarations and code"
Ted Kremenek [Sat, 17 Oct 2009 06:42:15 +0000 (06:42 +0000)]
Fix compiler warning: "ISO C90 forbids mixed declarations and code"

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

14 years agoFix warning: 'warning: C++ style comments are not allowed in ISO C90'
Ted Kremenek [Sat, 17 Oct 2009 06:37:16 +0000 (06:37 +0000)]
Fix warning: 'warning: C++ style comments are not allowed in ISO C90'

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

14 years agoResolve FIXME: delete the 'Program' object in the destructor of CIndexer.
Ted Kremenek [Sat, 17 Oct 2009 06:21:47 +0000 (06:21 +0000)]
Resolve FIXME: delete the 'Program' object in the destructor of CIndexer.

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

14 years agoDon't crash when dumping pretty stack traces, if the current tok is an
Daniel Dunbar [Sat, 17 Oct 2009 06:13:04 +0000 (06:13 +0000)]
Don't crash when dumping pretty stack traces, if the current tok is an
annotation token.
 - I'm not sure what the best thing to print is, for now we just print the token
   location and 'at annotation token'.

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

14 years agoFix PR5211: codegen shouldn't assume that the result of ||/&& is int
Chris Lattner [Sat, 17 Oct 2009 04:24:20 +0000 (04:24 +0000)]
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
anymore.  In C++ it is bool.

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

14 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:56 +0000 (03:28 +0000)]
Simplify.

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

14 years agoAdd IdentiferInfo::getNameStr() -> StringRef.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:48 +0000 (03:28 +0000)]
Add IdentiferInfo::getNameStr() -> StringRef.

Also, add getNameStart as a synonym for getName(). getName() is now deprecated,
when all clients are updated then getNameStr() should be renamed to
getName(). PR5218.

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

14 years agoFix sentence-o.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:37 +0000 (03:28 +0000)]
Fix sentence-o.

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

14 years agoAdd Ubuntu 9.04 C++ search path.
Daniel Dunbar [Sat, 17 Oct 2009 03:19:56 +0000 (03:19 +0000)]
Add Ubuntu 9.04 C++ search path.

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

14 years agoAdd 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created...
Ted Kremenek [Sat, 17 Oct 2009 00:34:24 +0000 (00:34 +0000)]
Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.

Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().

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

14 years agoMerge the "types" and "declarations" blocks in the precompiled header
Douglas Gregor [Sat, 17 Oct 2009 00:13:19 +0000 (00:13 +0000)]
Merge the "types" and "declarations" blocks in the precompiled header
format, so that we don't end up with multiple declaration and types
blocks. Also, fix a few obscure bugs with PCH loading and generation:

  - If the DeclIDs DenseMap reallocates while we are writing a
    declaration (due to recursively writing other declarations), we
    could end up writing a bad ID to ExternalDefinitions.
  - When loading an ArrayLoc (part of DeclaratorInfo), we need to set
    the size expression to NULL if no size expression was provided.

PCH -> AST rewriting is still partly broken, unfortunately.

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

14 years agoPatch to clean up and improve visual display of
Fariborz Jahanian [Fri, 16 Oct 2009 23:25:02 +0000 (23:25 +0000)]
Patch to clean up and improve visual display of
builtin function ambiguity.

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

14 years agoWhile writing source-location entries to a PCH file, go through an
Douglas Gregor [Fri, 16 Oct 2009 22:46:09 +0000 (22:46 +0000)]
While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).

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

14 years agoAllow TypeLocs to be fully initialized with a single SourceLocation. This
John McCall [Fri, 16 Oct 2009 22:31:57 +0000 (22:31 +0000)]
Allow TypeLocs to be fully initialized with a single SourceLocation.  This
will be the keystone of converting existing rewrites to be rewrites on TypeLocs.

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

14 years agoUse VisibleQuals to control setting of Volatile/Restrict qualifiers on
Fariborz Jahanian [Fri, 16 Oct 2009 22:08:05 +0000 (22:08 +0000)]
Use VisibleQuals to control setting of Volatile/Restrict qualifiers on
candidate types in BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants
further trimming the overload candidate set.

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

14 years agoFactor out routines to encode/decode DeclaratorInfos and move them into the
John McCall [Fri, 16 Oct 2009 21:56:05 +0000 (21:56 +0000)]
Factor out routines to encode/decode DeclaratorInfos and move them into the
core PCH reader/writer implementation files.

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

14 years agoAdd an accessor to extra the type directly from a DeclaratorInfo
John McCall [Fri, 16 Oct 2009 21:42:04 +0000 (21:42 +0000)]
Add an accessor to extra the type directly from a DeclaratorInfo
without an opaque call.

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

14 years agoMake CIndex and c-index-test a little bit more robust. The only
Douglas Gregor [Fri, 16 Oct 2009 21:24:31 +0000 (21:24 +0000)]
Make CIndex and c-index-test a little bit more robust. The only
substantive change is that clang_getCursorSource() now returns the
file in which a macro was instantiated when the cursor points into a
macro instantiation, rather than crashing.

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

14 years agoFix static analyzer crash due to recently add symbolic-value constant folding. The...
Ted Kremenek [Fri, 16 Oct 2009 20:46:24 +0000 (20:46 +0000)]
Fix static analyzer crash due to recently add symbolic-value constant folding. The issue was falsely
converting the constant value of the LHS of a '<<'/'>>' operation to the same APSInt value of the
RHS.

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

14 years agoProvide 'static' version of BinaryOperator::isShiftOp().
Ted Kremenek [Fri, 16 Oct 2009 20:45:04 +0000 (20:45 +0000)]
Provide 'static' version of BinaryOperator::isShiftOp().

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

14 years agoKeep track of whether declararions were loaded from a precompiled
Douglas Gregor [Fri, 16 Oct 2009 20:01:17 +0000 (20:01 +0000)]
Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.

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

14 years agodynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld synta...
Edward O'Callaghan [Fri, 16 Oct 2009 19:44:18 +0000 (19:44 +0000)]
dynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld syntax in AuroraUX toolchain.

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

14 years agoImplement derived-to-base AST/code gen. There is a
Fariborz Jahanian [Fri, 16 Oct 2009 19:20:59 +0000 (19:20 +0000)]
Implement derived-to-base AST/code gen. There is a
FIXME in CGCXX.cpp that I would like Anders to
take a look at.

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

14 years agoAdd support for a chain of stat caches in the FileManager, rather than
Douglas Gregor [Fri, 16 Oct 2009 18:18:30 +0000 (18:18 +0000)]
Add support for a chain of stat caches in the FileManager, rather than
only supporting a single stat cache. The immediate benefit of this
change is that we can now generate a PCH/AST file when including
another PCH file; in the future, the chain of stat caches will likely
be useful with multiple levels of PCH files.

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

14 years agoImplement PR4407 - missing warnings on case value overflow,
Chris Lattner [Fri, 16 Oct 2009 16:45:22 +0000 (16:45 +0000)]
Implement PR4407 - missing warnings on case value overflow,
patch by Zhanyong Wan!

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

14 years agoignore 'using' directive in CodeGenFunction::EmitDecl(). this fixes PR5085
Nuno Lopes [Fri, 16 Oct 2009 14:40:52 +0000 (14:40 +0000)]
ignore 'using' directive in CodeGenFunction::EmitDecl(). this fixes PR5085

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

14 years agofix -ansi in c++: it means -std=c++98
Nuno Lopes [Fri, 16 Oct 2009 14:28:06 +0000 (14:28 +0000)]
fix -ansi in c++: it means -std=c++98

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

14 years agoAdd CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.
Anders Carlsson [Fri, 16 Oct 2009 05:23:41 +0000 (05:23 +0000)]
Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.

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

14 years agoMake CheckVectorCast return a CastKind. Reduce nesting of if statements in CheckCastT...
Anders Carlsson [Fri, 16 Oct 2009 02:48:28 +0000 (02:48 +0000)]
Make CheckVectorCast return a CastKind. Reduce nesting of if statements in CheckCastTypes.

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

14 years agoAdd a ToVoid cast kind and start using it.
Anders Carlsson [Fri, 16 Oct 2009 02:35:04 +0000 (02:35 +0000)]
Add a ToVoid cast kind and start using it.

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

14 years agoincrease helpfulness of assert message.
Chris Lattner [Fri, 16 Oct 2009 02:34:51 +0000 (02:34 +0000)]
increase helpfulness of assert message.

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

14 years agoBuiltin types are subsitutable if they are qualified. Fixes PR5196.
Anders Carlsson [Fri, 16 Oct 2009 02:06:06 +0000 (02:06 +0000)]
Builtin types are subsitutable if they are qualified. Fixes PR5196.

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

14 years agoThe result type of logical || and && is bool in C++. Fixes PR5206.
Anders Carlsson [Fri, 16 Oct 2009 01:44:21 +0000 (01:44 +0000)]
The result type of logical || and && is bool in C++. Fixes PR5206.

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

14 years agoWork-around wchar_t and __pragma problem in VC headers
John Thompson [Fri, 16 Oct 2009 01:12:00 +0000 (01:12 +0000)]
Work-around wchar_t and __pragma problem in VC headers

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

14 years agoretain/release checker: Stop tracking reference counts for any symbols touched by...
Ted Kremenek [Fri, 16 Oct 2009 00:30:49 +0000 (00:30 +0000)]
retain/release checker: Stop tracking reference counts for any symbols touched by StoreManager::InvalidateRegion().

This fixes <rdar://problem/7257223> and <rdar://problem/7283470>.

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

14 years agoRemove the ConstantArrayType subtypes. This information is preserved in the
John McCall [Fri, 16 Oct 2009 00:14:28 +0000 (00:14 +0000)]
Remove the ConstantArrayType subtypes.  This information is preserved in the
TypeLoc records for declarations;  it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.

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

14 years agoAdd a few passing test cases for finding leaks of retained objects stored to arrays...
Ted Kremenek [Thu, 15 Oct 2009 23:44:02 +0000 (23:44 +0000)]
Add a few passing test cases for finding leaks of retained objects stored to arrays (<rdar://problem/7283470>).

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

14 years agoUse an std::vector<> instead of an array of ARG_MAX size, as ARG_MAX may not be defin...
Ted Kremenek [Thu, 15 Oct 2009 23:21:22 +0000 (23:21 +0000)]
Use an std::vector<> instead of an array of ARG_MAX size, as ARG_MAX may not be defined everywhere.

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

14 years agoDisallow arbitrary custom inline asm constraints for msp430.
Anton Korobeynikov [Thu, 15 Oct 2009 23:17:13 +0000 (23:17 +0000)]
Disallow arbitrary custom inline asm constraints for msp430.

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

14 years agoImprove point-of-instantiation location information for members of class templates
Douglas Gregor [Thu, 15 Oct 2009 23:05:15 +0000 (23:05 +0000)]
Improve point-of-instantiation location information for members of class templates

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

14 years agoMake the remaining explicit-instantiation semantic action use
Douglas Gregor [Thu, 15 Oct 2009 22:53:21 +0000 (22:53 +0000)]
Make the remaining explicit-instantiation semantic action use
CheckSpecializationInstantiationRedecl to check for
redeclarations/instantiations. Also fixes a longstanding issue where
our explicit-instantiation location information wasn't as good as it
could have been.

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

14 years agoConcreteTypeLoc subclasses which call getInnerTypeLoc() should get a
John McCall [Thu, 15 Oct 2009 22:37:38 +0000 (22:37 +0000)]
ConcreteTypeLoc subclasses which call getInnerTypeLoc() should get a
compile-time error now;  moreover, remove the need for an explicit hasInnerType()
call.  Thanks to Doug Gregor for the metaprogramming approach.

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

14 years agoEducate the retain/release checker about [NSCursor dragCopyCursor].
Ted Kremenek [Thu, 15 Oct 2009 22:26:21 +0000 (22:26 +0000)]
Educate the retain/release checker about [NSCursor dragCopyCursor].
This fixes <rdar://problem/7306898>

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

14 years agoretain/release checker: Use simpler utility method for creating class method summarie...
Ted Kremenek [Thu, 15 Oct 2009 22:25:12 +0000 (22:25 +0000)]
retain/release checker: Use simpler utility method for creating class method summaries.  No functionality change.

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

14 years agoMake sure temporary files get unlinked.
Steve Naroff [Thu, 15 Oct 2009 22:23:48 +0000 (22:23 +0000)]
Make sure temporary files get unlinked.

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

14 years agoAdd missing #include for wait().
Ted Kremenek [Thu, 15 Oct 2009 22:10:56 +0000 (22:10 +0000)]
Add missing #include for wait().

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

14 years agoMinor improvement to format...no functionality change.
Steve Naroff [Thu, 15 Oct 2009 20:50:09 +0000 (20:50 +0000)]
Minor improvement to format...no functionality change.

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

14 years agoImplement <rdar://problem/7303432> [Clang/Index] In-memory-style AST generation API...
Steve Naroff [Thu, 15 Oct 2009 20:04:39 +0000 (20:04 +0000)]
Implement <rdar://problem/7303432> [Clang/Index] In-memory-style AST generation API (initial API implementation).

Added clang_createTranslationUnitFromSourceFile().
Changed clang_createIndex() to lookup the location of clang (using dladdr).

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

14 years agoDriver: Default to using PTH for C++ precompiled header support, PCH for C++
Daniel Dunbar [Thu, 15 Oct 2009 20:02:44 +0000 (20:02 +0000)]
Driver: Default to using PTH for C++ precompiled header support, PCH for C++
isn't implemented yet.
 - <rdar://problem/7297571> Clang should use pretokenized headers for C++ PCH
   files

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

14 years agoMake sure that we're diagnosing duplicate explicit instantiation definitions.
Douglas Gregor [Thu, 15 Oct 2009 18:07:02 +0000 (18:07 +0000)]
Make sure that we're diagnosing duplicate explicit instantiation definitions.

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

14 years agoSimplify checking of explicit template specialization/explicit
Douglas Gregor [Thu, 15 Oct 2009 17:21:20 +0000 (17:21 +0000)]
Simplify checking of explicit template specialization/explicit
instantiation redeclaration semantics for function template
specializations and member functions of class template
specializations. Also, record the point of instantiation for
explicit-instantiated functions and static data members.

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

14 years agoApply heuristics to cut back on number of candidate
Fariborz Jahanian [Thu, 15 Oct 2009 17:14:05 +0000 (17:14 +0000)]
Apply heuristics to cut back on number of candidate
sets of builtin operators. Currently, it is applied
to '++' and '->*' operators. I need to apply it to others
as well. Also, heuristics need be applied to
BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants.
This is WIP.

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

14 years agoCheck the interactions between explicit instantiations and template
Douglas Gregor [Thu, 15 Oct 2009 15:54:05 +0000 (15:54 +0000)]
Check the interactions between explicit instantiations and template
specializations. Work in progress; there's more cleanup required to
actually use the new CheckSpecializationInstantiationRedecl checker
uniformly.

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

14 years agoSorry! Accidentally checked in experimental change.
John Thompson [Thu, 15 Oct 2009 14:34:41 +0000 (14:34 +0000)]
Sorry!  Accidentally checked in experimental change.

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

14 years agoDiagnose explicit instantiations of function templates and member
Douglas Gregor [Thu, 15 Oct 2009 14:05:49 +0000 (14:05 +0000)]
Diagnose explicit instantiations of function templates and member
functions/static data members of class template specializations that
do not have definitions. This is the latter part of [temp.explicit]p4;
the former part still needs more testing.

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

14 years agoMore explicit template instantiation. Now we're checking for more
Douglas Gregor [Thu, 15 Oct 2009 12:53:22 +0000 (12:53 +0000)]
More explicit template instantiation. Now we're checking for more
cases where an explicit instantiation requires a definition; the
remainder of these checks will come with the implementation of
paragraph 4 of [temp.explicit].

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

14 years agoRefine non-virtual part of the this adjustment for thunks. Refine
Mike Stump [Thu, 15 Oct 2009 09:30:16 +0000 (09:30 +0000)]
Refine non-virtual part of the this adjustment for thunks.  Refine
non-virtual part of the return result adjustments for covariant
thunks.  WIP.

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

14 years agoAuroraUX toolchain fixes.
Edward O'Callaghan [Thu, 15 Oct 2009 07:44:07 +0000 (07:44 +0000)]
AuroraUX toolchain fixes.

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

14 years agoComplete some unfinished comments.
John McCall [Thu, 15 Oct 2009 04:01:40 +0000 (04:01 +0000)]
Complete some unfinished comments.

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

14 years agoBetter living through metaprogramming. Create a base class which abstracts
John McCall [Thu, 15 Oct 2009 03:50:32 +0000 (03:50 +0000)]
Better living through metaprogramming.  Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc.  Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers.  Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.

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

14 years agoMake this at least compile.
Mike Stump [Thu, 15 Oct 2009 02:10:57 +0000 (02:10 +0000)]
Make this at least compile.

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

14 years agoTrack the offset to the current virtual base in CurrentVBaseOffset.
Mike Stump [Thu, 15 Oct 2009 02:04:03 +0000 (02:04 +0000)]
Track the offset to the current virtual base in CurrentVBaseOffset.
Track path information completely to ensure we get all the overrides.  WIP.

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

14 years agoPer an astute observation from Zhongxing Xu, remove a "special case" logic in
Ted Kremenek [Thu, 15 Oct 2009 01:40:34 +0000 (01:40 +0000)]
Per an astute observation from Zhongxing Xu, remove a "special case" logic in
RegionStoreManager::Retrieve() that was intended to handle conflated uses of pointers as integers.
It turns out this isn't needed, and resulted in inconsistent behavior when creating symbolic values on the following test case in 'tests/Analysis/misc-ps.m':

  typedef struct _BStruct { void *grue; } BStruct;
  void testB_aux(void *ptr);
  void testB(BStruct *b) {
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      testB_aux(__gruep__);
    }
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      if (~0 != __gruev__) {}
    }
  }

When the code was analyzed with '-arch x86_64', the value assigned to '__gruev__' be would be a
symbolic integer, but for '-arch i386' the value assigned to '__gruev__' would be a symbolic region
(a blob of memory). With this change the value created is always a symbolic integer.

Since the code being removed was added to support analysis of code calling
OSAtomicCompareAndSwapXXX(), I also modified 'test/Analysis/NSString.m' to analyze the code in both
'-arch i386' and '-arch x86_64', and also added some complementary test cases to test the presence
of leaks when using OSAtomicCompareAndSwap32Barrier()/OSAtomicCompareAndSwap64Barrier() instead of
just their absence. This code change reveals that previously both RegionStore and BasicStore were
handling these cases wrong, and would never cause the analyzer to emit a leak in these cases (false
negatives). Now RegionStore gets it right, but BasicStore still gets it wrong (and hence it has been
disabled temporarily for this test case).

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

14 years agoHandle
Anders Carlsson [Thu, 15 Oct 2009 00:51:46 +0000 (00:51 +0000)]
Handle

struct A { };
struct B : A { };

void f() {
  const A& a = B();
}

correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).

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

14 years agoCheck the return type when calling pointer to member functions.
Anders Carlsson [Thu, 15 Oct 2009 00:41:48 +0000 (00:41 +0000)]
Check the return type when calling pointer to member functions.

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

14 years agoRemoved math.h include, as Windows math.h has a compile error.
John Thompson [Thu, 15 Oct 2009 00:39:58 +0000 (00:39 +0000)]
Removed math.h include, as Windows math.h has a compile error.

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

14 years agoRemove stale comment.
Ted Kremenek [Wed, 14 Oct 2009 23:58:34 +0000 (23:58 +0000)]
Remove stale comment.

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

14 years agoCheckTemplateSpecializationScope isn't going to be used for explicit
Douglas Gregor [Wed, 14 Oct 2009 23:50:59 +0000 (23:50 +0000)]
CheckTemplateSpecializationScope isn't going to be used for explicit
instantiations, since the requirements are too different from those
for template specializations. Simplify it slightly.

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

14 years agoAdditional semantic checking for explicit template instantiations,
Douglas Gregor [Wed, 14 Oct 2009 23:41:34 +0000 (23:41 +0000)]
Additional semantic checking for explicit template instantiations,
focusing on the scope- and qualifier-related semantic requirements in
C++ [temp.explicit]p2.

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

14 years agoOur C++ support is far enough along now that we shouldn't be recommending the use...
Douglas Gregor [Wed, 14 Oct 2009 21:54:48 +0000 (21:54 +0000)]
Our C++ support is far enough along now that we shouldn't be recommending the use of Elsa

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

14 years agoReuse some code for checking the scope of an explicit instantiation
Douglas Gregor [Wed, 14 Oct 2009 21:46:58 +0000 (21:46 +0000)]
Reuse some code for checking the scope of an explicit instantiation

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

14 years agoFix a thinko that John pointed out
Douglas Gregor [Wed, 14 Oct 2009 21:36:34 +0000 (21:36 +0000)]
Fix a thinko that John pointed out

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

14 years agoCheck the implicit instantiation of a static data member of a class
Douglas Gregor [Wed, 14 Oct 2009 21:33:19 +0000 (21:33 +0000)]
Check the implicit instantiation of a static data member of a class
template that has no out-of-line definition.

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

14 years agoGive explicit and implicit instantiations of static data members of
Douglas Gregor [Wed, 14 Oct 2009 21:29:40 +0000 (21:29 +0000)]
Give explicit and implicit instantiations of static data members of
class templates the proper linkage.

Daniel, please look over the CodeGenModule bits.

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

14 years agoTesting and some minor fixes for explicit template instantiation.
Douglas Gregor [Wed, 14 Oct 2009 20:14:33 +0000 (20:14 +0000)]
Testing and some minor fixes for explicit template instantiation.

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

14 years agoTestcase for recent checkin. WIP.
Mike Stump [Wed, 14 Oct 2009 18:38:01 +0000 (18:38 +0000)]
Testcase for recent checkin.  WIP.

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

14 years agoShift the vcall slots for non-virtual bases of a virtual base, up into
Mike Stump [Wed, 14 Oct 2009 18:14:51 +0000 (18:14 +0000)]
Shift the vcall slots for non-virtual bases of a virtual base, up into
the virtual base so they can be reused properly.  Don't reuse vcall
slots across a virtual boundary.  WIP.  I have a testcase, but there
are still things that need to be fixed before the testcase can go in.

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

14 years agoWhen mapping from an injected-class-name to its corresponding
Douglas Gregor [Wed, 14 Oct 2009 17:30:58 +0000 (17:30 +0000)]
When mapping from an injected-class-name to its corresponding
template, make sure to get the template that corresponds to *this*
declaration of the class template or specialization, rather than the
canonical specialization. Fixes PR5187.

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

14 years agoAdd support for having different c++ search dirs with -m32 and -m64. So far
Rafael Espindola [Wed, 14 Oct 2009 17:09:44 +0000 (17:09 +0000)]
Add support for having different c++ search dirs with -m32 and -m64. So far
this is only used in darwin10, 64 bit ubuntu 9.10 and 64 bit openSUSE 11.1.

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

14 years agoCopy metadata associated with CI
Devang Patel [Wed, 14 Oct 2009 17:03:29 +0000 (17:03 +0000)]
Copy metadata associated with CI

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

14 years agoImplement support for overloaded operator uses that result to a call
Douglas Gregor [Wed, 14 Oct 2009 16:50:13 +0000 (16:50 +0000)]
Implement support for overloaded operator uses that result to a call
to a member operator template. We missed updating this call site when
adding support for function templates; bug exposed by a test for
PR5072.

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

14 years agoThere is now only one version of eh.selector and eh.typeid.for.
Duncan Sands [Wed, 14 Oct 2009 16:13:30 +0000 (16:13 +0000)]
There is now only one version of eh.selector and eh.typeid.for.
Fix the clang build.

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

14 years agoHave the exception specification checkers take partial diagnostics. Use this to merge...
Sebastian Redl [Wed, 14 Oct 2009 16:09:29 +0000 (16:09 +0000)]
Have the exception specification checkers take partial diagnostics. Use this to merge two diagnostics.

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

14 years agoFew targets like PIC16 mangle the names of global variables, so retrieve the name
Sanjiv Gupta [Wed, 14 Oct 2009 15:08:34 +0000 (15:08 +0000)]
Few targets like PIC16 mangle the names of global variables, so retrieve the name
from Var itself rather than the decl for DebugInfo metadata.

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

14 years agoUse CanQualType in the exception specification verification type sets.
Sebastian Redl [Wed, 14 Oct 2009 15:06:25 +0000 (15:06 +0000)]
Use CanQualType in the exception specification verification type sets.

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

14 years agoTeach Lexer::MeasureTokenLength to be able to measure the
Chris Lattner [Wed, 14 Oct 2009 15:04:18 +0000 (15:04 +0000)]
Teach Lexer::MeasureTokenLength to be able to measure the
length of comment tokens.  Patch by Abramo Bagnara!

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

14 years agoUse partial diagnostics properly in call to RequireCompleteType. Among other things...
Sebastian Redl [Wed, 14 Oct 2009 14:59:48 +0000 (14:59 +0000)]
Use partial diagnostics properly in call to RequireCompleteType. Among other things, this means we get a note on the declaration of the incomplete type when it is used in an exception specification.

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

14 years agoDo exception spec compatibility tests for member pointers, too.
Sebastian Redl [Wed, 14 Oct 2009 14:38:54 +0000 (14:38 +0000)]
Do exception spec compatibility tests for member pointers, too.

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

14 years agoNow StoreManager::CastRegion() takes a MemRegion, returns a MemRegion.
Zhongxing Xu [Wed, 14 Oct 2009 06:55:01 +0000 (06:55 +0000)]
Now StoreManager::CastRegion() takes a MemRegion, returns a MemRegion.

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

14 years agoAdd comments to test.
Zhongxing Xu [Wed, 14 Oct 2009 06:05:09 +0000 (06:05 +0000)]
Add comments to test.

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

14 years agofix some cfstring related issues:
Chris Lattner [Wed, 14 Oct 2009 05:55:45 +0000 (05:55 +0000)]
fix some cfstring related issues:
1) -fwritable-string does affect the non-utf16 version of cfstrings
   just not the utf16 ones.
2) utf16 strings should always be marked constant, as the __TEXT segment
   is readonly.
3) The name of the global doesn't matter, remove it from TargetInfo.
4) Trust the asmprinter to drop cstrings into the right section, like llvmgcc does now.

This fixes rdar://7115750

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

14 years agounbreak test/CodeGen/builtins.c, reverting Devang's change.
Chris Lattner [Wed, 14 Oct 2009 05:49:21 +0000 (05:49 +0000)]
unbreak test/CodeGen/builtins.c, reverting Devang's change.

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