]> granicus.if.org Git - clang/log
clang
14 years agopush use of Preprocessor out of getOffsetOfStringByte
Chris Lattner [Wed, 17 Nov 2010 06:35:43 +0000 (06:35 +0000)]
push use of Preprocessor out of getOffsetOfStringByte

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

14 years agoadd a static form of the efficient PP::getSpelling method.
Chris Lattner [Wed, 17 Nov 2010 06:31:48 +0000 (06:31 +0000)]
add a static form of the efficient PP::getSpelling method.

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

14 years agorefactor the interface to StringLiteralParser::getOffsetOfStringByte,
Chris Lattner [Wed, 17 Nov 2010 06:26:08 +0000 (06:26 +0000)]
refactor the interface to StringLiteralParser::getOffsetOfStringByte,
pushing the dependency on the preprocessor out a bit.

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

14 years agoAdded mapping from 'this' to it's SymbolicRegion in BasicStoreManager::getInitialStore.
Marcin Swiderski [Wed, 17 Nov 2010 06:22:54 +0000 (06:22 +0000)]
Added mapping from 'this' to it's SymbolicRegion in BasicStoreManager::getInitialStore.

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

14 years agofactor some code out to a helper function, no functionality change.
Chris Lattner [Wed, 17 Nov 2010 05:58:54 +0000 (05:58 +0000)]
factor some code out to a helper function, no functionality change.

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

14 years agoCursorVisitor: Migrate handling of
Ted Kremenek [Wed, 17 Nov 2010 02:18:35 +0000 (02:18 +0000)]
CursorVisitor: Migrate handling of
'SizeOfAlignOfExpr' and 'CXXSCalarValueInitExpr'
to data-recursion algorithm.

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

14 years agoFor an Objective-C @synthesize statement, e.g.,
Douglas Gregor [Wed, 17 Nov 2010 01:03:52 +0000 (01:03 +0000)]
For an Objective-C @synthesize statement, e.g.,

  @synthesize foo = _foo;

keep track of the location of the ivar ("_foo"). Teach libclang to
visit the ivar as a member reference.

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

14 years agoCursorVisitor: migrate handling of CXXUuidofExpr to
Ted Kremenek [Wed, 17 Nov 2010 00:50:52 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of CXXUuidofExpr to
data-recursion algorithm.

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

14 years agoCursorVisitor: migrate handling of UnaryTypeTraitExpr
Ted Kremenek [Wed, 17 Nov 2010 00:50:50 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of UnaryTypeTraitExpr
to data-recursion algorithm.

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

14 years agoCursorVisitor: refactor visitation of
Ted Kremenek [Wed, 17 Nov 2010 00:50:47 +0000 (00:50 +0000)]
CursorVisitor: refactor visitation of
explicit template args within data-recursion
algorithm.

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

14 years agoCursorVisitor: migrate handling of
Ted Kremenek [Wed, 17 Nov 2010 00:50:45 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
AddrLabelExpr to data-recursion algorithm, and
unify that reasoning with GotoStmt.

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

14 years agoCursorVisitor: migrate handling of
Ted Kremenek [Wed, 17 Nov 2010 00:50:43 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
VAArgExpr to data-recursion algorithm.

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

14 years agoCursorVisitor: migrate handling of
Ted Kremenek [Wed, 17 Nov 2010 00:50:41 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
CXXTypeidExpr to data-recursion algorithm.

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

14 years agoCursorVisitor: migrate handling of
Ted Kremenek [Wed, 17 Nov 2010 00:50:39 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
TypesCompatibleExpr to data-recursion algorithm.

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

14 years agoCursorVisitor: Migrate CXXUnresolvedConstructExpr over to data-recursive algorithm.
Ted Kremenek [Wed, 17 Nov 2010 00:50:36 +0000 (00:50 +0000)]
CursorVisitor: Migrate CXXUnresolvedConstructExpr over to data-recursive algorithm.

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

14 years agoAdd comments.
Ted Kremenek [Wed, 17 Nov 2010 00:50:34 +0000 (00:50 +0000)]
Add comments.

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

14 years agoRe-enable test with modifications for Neon vector changes in clang.
Bob Wilson [Wed, 17 Nov 2010 00:44:53 +0000 (00:44 +0000)]
Re-enable test with modifications for Neon vector changes in clang.
I mistakenly thought that this was checking for vector name mangling, but
it is not.  Since we're no longer wrapping Neon vectors in structs, this
test can just return a vector directly.  There are already other tests for
that, so just to make this interesting, change the test to return a struct
of two vectors.

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

14 years agoAdd support for distros that like x86_64-unknown-linux-gnu.
Rafael Espindola [Wed, 17 Nov 2010 00:25:26 +0000 (00:25 +0000)]
Add support for distros that like x86_64-unknown-linux-gnu.

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

14 years agoFixes synthesis of type for the object which holds info.
Fariborz Jahanian [Wed, 17 Nov 2010 00:21:28 +0000 (00:21 +0000)]
Fixes synthesis of type for the object which holds info.
about a __block cxx object.

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

14 years agoFix source-range information for Objective-C properties. Previously,
Douglas Gregor [Wed, 17 Nov 2010 00:13:31 +0000 (00:13 +0000)]
Fix source-range information for Objective-C properties. Previously,
we were just getting a range covering only the property name, which is
certainly not correct (and broke token annotation, among other
things).

Also, teach libclang about the relationship between
@synthesize/@dynamic and @property, so we get property name and
cursor-reference information for @synthesize and @dynamic.

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

14 years agoReset the lifetime-managed flag between emission of the agg conditional
John McCall [Wed, 17 Nov 2010 00:07:33 +0000 (00:07 +0000)]
Reset the lifetime-managed flag between emission of the agg conditional
branches.  Fixes PR8623.

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

14 years agoFront-end support for __attribute__((may_alias)). This is not
Dan Gohman [Wed, 17 Nov 2010 00:03:07 +0000 (00:03 +0000)]
Front-end support for __attribute__((may_alias)). This is not
yet hooked up to anything yet.

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

14 years agoSupport compound complex operations as l-values in C++. Add a test
John McCall [Tue, 16 Nov 2010 23:07:28 +0000 (23:07 +0000)]
Support compound complex operations as l-values in C++.  Add a test
case based on CodeGen/volatile-1.c which tests the current C++
semantics, and note the many, many places we fall short of them.

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

14 years agoWarn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922
Argyrios Kyrtzidis [Tue, 16 Nov 2010 21:00:12 +0000 (21:00 +0000)]
Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922

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

14 years agoUse an OwningPtr for the preamble buffer in ASTUnit. This plugs a leak
Douglas Gregor [Tue, 16 Nov 2010 20:45:51 +0000 (20:45 +0000)]
Use an OwningPtr for the preamble buffer in ASTUnit. This plugs a leak
where we failed to free this buffer along one of the paths, and
detangles the code a little.

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

14 years agoturned pointers into pointers to const in function parameters in all functions/builti...
Anton Yartsev [Tue, 16 Nov 2010 20:09:36 +0000 (20:09 +0000)]
turned pointers into pointers to const in function parameters in all functions/builtins accepting pointers to a const-qualified type according to PIM and "Language Extensions for CBEA"

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

14 years agoImplements __block API for c++ objects. There is still
Fariborz Jahanian [Tue, 16 Nov 2010 19:29:39 +0000 (19:29 +0000)]
Implements __block API for c++ objects. There is still
issue with runtime which I am discussing it with Blaine.
This is wip (so no test yet).

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

14 years agoTemporarily disable this check for Neon vector type mangling.
Bob Wilson [Tue, 16 Nov 2010 19:08:19 +0000 (19:08 +0000)]
Temporarily disable this check for Neon vector type mangling.
I'll reenable it soon when I'm done reworking <arm_neon.h>.

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

14 years agoStatic analyzer: Catch calls to malloc() with
Ted Kremenek [Tue, 16 Nov 2010 18:47:04 +0000 (18:47 +0000)]
Static analyzer: Catch calls to malloc() with
allocation sizes of 0 bytes.

Fixes PR 2899.

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

14 years agoEmit a specific diagnostic when typedefing C++ bool, mirroring gcc.
Argyrios Kyrtzidis [Tue, 16 Nov 2010 18:18:13 +0000 (18:18 +0000)]
Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.
Fixes rdar://8365458

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

14 years agoMSVC doesn't like the noinline attribute at the end of a declaration. Try the other...
Benjamin Kramer [Tue, 16 Nov 2010 15:45:46 +0000 (15:45 +0000)]
MSVC doesn't like the noinline attribute at the end of a declaration. Try the other side.

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

14 years agoAdd gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!
Nico Weber [Tue, 16 Nov 2010 12:42:55 +0000 (12:42 +0000)]
Add gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!

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

14 years agoRemove an unintended restriction on sysroots introduced during the Path
Chandler Carruth [Tue, 16 Nov 2010 11:30:11 +0000 (11:30 +0000)]
Remove an unintended restriction on sysroots introduced during the Path
conversion.

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

14 years agoThis really seems like a boring set of fixes to our tests to make them more
Chandler Carruth [Tue, 16 Nov 2010 10:26:08 +0000 (10:26 +0000)]
This really seems like a boring set of fixes to our tests to make them more
independent of the underlying system. Let me know if any of these are too
aggressive.

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

14 years agoSimplify some complex emission and implement correct semantics for
John McCall [Tue, 16 Nov 2010 10:08:07 +0000 (10:08 +0000)]
Simplify some complex emission and implement correct semantics for
assignment to volatiles in C.  This in effect reverts some of mjs's
work in and around r72572.  Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.

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

14 years agoFuther reduce the includes of our builtin headers, and teach limits.h to avoid
Chandler Carruth [Tue, 16 Nov 2010 10:07:43 +0000 (10:07 +0000)]
Futher reduce the includes of our builtin headers, and teach limits.h to avoid
include_next when not hosted or unavailable. This follows the pattern in
stdint.h and allows these headers to work even in a freestanding configuration
without a standard library.

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

14 years agoReverting r119341: doesn't compile, no obvious fix.
John McCall [Tue, 16 Nov 2010 09:18:38 +0000 (09:18 +0000)]
Reverting r119341:  doesn't compile, no obvious fix.

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

14 years agoRefactored GRExprEngine::getCXXThisRegion to use CXXMethodDecl::getThisType instead...
Marcin Swiderski [Tue, 16 Nov 2010 08:50:38 +0000 (08:50 +0000)]
Refactored GRExprEngine::getCXXThisRegion to use CXXMethodDecl::getThisType instead of calculating it by hand.

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

14 years agoFix PR8625 and correctly interpret member-calls to static members when
Chandler Carruth [Tue, 16 Nov 2010 08:49:43 +0000 (08:49 +0000)]
Fix PR8625 and correctly interpret member-calls to static members when
producing warnings.

This feels really fragile, and I've not audited all other argument index-based
warnings. I suspect we'll grow this bug on another warning eventually. It might
be nice to adjust the argument indices when building up the attribute AST node,
as we already have to remember about the 'this' argument within that code to
produce correct errors.

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

14 years agoRe-work the handling of implicit 'this' arguments and silly GCC-style attribute
Chandler Carruth [Tue, 16 Nov 2010 08:35:43 +0000 (08:35 +0000)]
Re-work the handling of implicit 'this' arguments and silly GCC-style attribute
argument indexes. This handles the offsets in a consistent manner for all of
the attributes which I saw working with these concepts. I've also added tests
for the attribute that motivated this: nonnull.

I consolidated the tests for format attributes into one file, and fleshed them
out a bit to trigger more of the warning cases. Also improved the quality of
some of the diagnostics that occur with invalid argument indices.

The only really questionable change here is supporting the implicit this
argument for the ownership attribute. I'm not sure it's really a sensible
concept there, but implemented the logic for consistency.

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

14 years agoRework USR generation from CXCursors to use CXStringBufs
Ted Kremenek [Tue, 16 Nov 2010 08:15:38 +0000 (08:15 +0000)]
Rework USR generation from CXCursors to use CXStringBufs
for the backing of generated USRs.  This optmizes
for the case when a client generates a sequence
of USRs in sequence, disposing of them soon
after generating them.  By using a string buffer,
we recycle malloc'ed memory instead of constantly
malloc'ing and copying strings.

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

14 years agoChange CXTranslationUnit to not directly cast to an ASTUnit*,
Ted Kremenek [Tue, 16 Nov 2010 08:15:36 +0000 (08:15 +0000)]
Change CXTranslationUnit to not directly cast to an ASTUnit*,
but to wrap both an ASTUnit and a "string pool"
that will be used for fast USR generation.

This requires a bunch of mechanical changes, as
there was a ton of code that assumed that CXTranslationUnit
and ASTUnit* were the same.

Along with this change, introduce CXStringBuf,
which provides an llvm::SmallVector<char> backing
for repeatedly generating CXStrings without a huge
amount of malloc() traffic.  This requires making
some changes to the representation of CXString
by renaming a few fields (but keeping the size
of the object the same).

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

14 years agoImprove diagnostic for calling non-const method on const object. Fixes rdar://7743000
Argyrios Kyrtzidis [Tue, 16 Nov 2010 08:04:45 +0000 (08:04 +0000)]
Improve diagnostic for calling non-const method on const object. Fixes rdar://7743000

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

14 years agoHandle member initializer in C++ ctor.
Zhongxing Xu [Tue, 16 Nov 2010 07:52:17 +0000 (07:52 +0000)]
Handle member initializer in C++ ctor.
 - Add a new Kind of ProgramPoint: PostInitializer.
 - Still use GRStmtNodeBuilder. But special handling PostInitializer in
   GRStmtNodeBuilder::GenerateAutoTransition().
 - Someday we should clean up the interface of GRStmtNodeBuilder.

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

14 years agoHave CXXDeleteExpr::getDestroyedType return the actual destroyed type
Craig Silverstein [Tue, 16 Nov 2010 07:16:25 +0000 (07:16 +0000)]
Have CXXDeleteExpr::getDestroyedType return the actual destroyed type
in more situations.  In particular, for code like

   template<class T> void Fn() { T* x; delete x; }

getDestroyedType() will now return T rather than T*, as it would
before this change.  On the other hand, for code like this:

   template<class T> void Fn() { T x; delete x; }

getDestroyedType() will return an empty QualType(), since it doesn't
know what the actual destroyed type would be.  Previously, it would
return T.

OKed by rjmccall

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

14 years agoBasic support for C++ in BasicStore:
Marcin Swiderski [Tue, 16 Nov 2010 07:15:33 +0000 (07:15 +0000)]
Basic support for C++ in BasicStore:
- CXXThisRegion treated like VarRegion and ObjCIVarRegion in various places,
- Reference treated like pointer in BindDeclInternal.

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

14 years agoNow that we have reliable cast kinds, simplify scalar cast IR gen.
John McCall [Tue, 16 Nov 2010 06:21:14 +0000 (06:21 +0000)]
Now that we have reliable cast kinds, simplify scalar cast IR gen.

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

14 years agoKill CK_Unknown and flesh out the documentation for the existing CastKinds.
John McCall [Tue, 16 Nov 2010 05:46:29 +0000 (05:46 +0000)]
Kill CK_Unknown and flesh out the documentation for the existing CastKinds.

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

14 years agoTeach complex compound assignment IR-generation that the RHS of
John McCall [Tue, 16 Nov 2010 05:45:35 +0000 (05:45 +0000)]
Teach complex compound assignment IR-generation that the RHS of
a compound assignment is always already in the computation type.

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

14 years agoKill off the remaining places which generate CK_Unknown casts.
John McCall [Tue, 16 Nov 2010 02:32:08 +0000 (02:32 +0000)]
Kill off the remaining places which generate CK_Unknown casts.

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

14 years agoAdd CXString.cpp and CXString.h
Ted Kremenek [Tue, 16 Nov 2010 02:03:55 +0000 (02:03 +0000)]
Add CXString.cpp and CXString.h

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

14 years agoMove CXString creation/management routines into
Ted Kremenek [Tue, 16 Nov 2010 01:56:27 +0000 (01:56 +0000)]
Move CXString creation/management routines into
their own .cpp file and make the interpretation
of its flags private.

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

14 years agoUpdate checker build.
Ted Kremenek [Tue, 16 Nov 2010 01:56:23 +0000 (01:56 +0000)]
Update checker build.

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

14 years agoAdd an ExternalASTSource hook to complete a type on demand.
John McCall [Tue, 16 Nov 2010 01:44:35 +0000 (01:44 +0000)]
Add an ExternalASTSource hook to complete a type on demand.

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

14 years agoAdd a test for Neon vector mangling
Bob Wilson [Tue, 16 Nov 2010 00:32:31 +0000 (00:32 +0000)]
Add a test for Neon vector mangling

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

14 years agoAdd tests for new Neon vector type attributes.
Bob Wilson [Tue, 16 Nov 2010 00:32:28 +0000 (00:32 +0000)]
Add tests for new Neon vector type attributes.

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

14 years agoUpdate TypePrinter::PrintVector to handle new Neon vector types.
Bob Wilson [Tue, 16 Nov 2010 00:32:26 +0000 (00:32 +0000)]
Update TypePrinter::PrintVector to handle new Neon vector types.

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

14 years agoAdd support for "neon_vector_type" and "neon_polyvector_type" attributes
Bob Wilson [Tue, 16 Nov 2010 00:32:24 +0000 (00:32 +0000)]
Add support for "neon_vector_type" and "neon_polyvector_type" attributes
to create the special Neon vector types.  These are intended to be used in
Clang's version of <arm_neon.h> to define special Neon vector types that will
be mangled according to ARM's ABI.

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

14 years agoASTContext::getVectorType should preserve the vector kind for canonical types.
Bob Wilson [Tue, 16 Nov 2010 00:32:20 +0000 (00:32 +0000)]
ASTContext::getVectorType should preserve the vector kind for canonical types.
This is needed for Neon types when it is most natural to define them in terms
of a typedef.  For example, Neon poly8_t is a typedef for "signed char", and
we want to define polynomial vectors as vectors of that typedef.  Without this
change, the result will be a generic GCC-style vector.  I think this is safe
for other vector types as well, but I would appreciate a review of this.

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

14 years agoChange CXXNameMangler::mangleNeonVectorType to require the vector type to be
Bob Wilson [Tue, 16 Nov 2010 00:32:18 +0000 (00:32 +0000)]
Change CXXNameMangler::mangleNeonVectorType to require the vector type to be
one of the special Neon types.  We'll check for invalid Neon vectors when
they are created, so there's no point in handling them when mangling.

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

14 years agoFix a comment typo.
Bob Wilson [Tue, 16 Nov 2010 00:32:16 +0000 (00:32 +0000)]
Fix a comment typo.

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

14 years agoUse getTypeSize() method.
Bob Wilson [Tue, 16 Nov 2010 00:32:12 +0000 (00:32 +0000)]
Use getTypeSize() method.

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

14 years agoAdd another case to the whitelist of cast kinds that can convert to bool.
John McCall [Tue, 16 Nov 2010 00:12:50 +0000 (00:12 +0000)]
Add another case to the whitelist of cast kinds that can convert to bool.
Fixes PR8608.

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

14 years agoCursorVisitor: cache worklists created for data-recursion to reduce malloc() traffic.
Ted Kremenek [Mon, 15 Nov 2010 23:31:32 +0000 (23:31 +0000)]
CursorVisitor: cache worklists created for data-recursion to reduce malloc() traffic.

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

14 years agoAdd a new expression kind, OpaqueValueExpr, which is useful for
John McCall [Mon, 15 Nov 2010 23:31:06 +0000 (23:31 +0000)]
Add a new expression kind, OpaqueValueExpr, which is useful for
certain internal type-checking procedures as well as for representing
certain implicitly-generated operations.  Uses to follow.

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

14 years agoAdds a README for the Clang static analyzer to document its design and work flow...
Zhanyong Wan [Mon, 15 Nov 2010 23:19:25 +0000 (23:19 +0000)]
Adds a README for the Clang static analyzer to document its design and work flow.  The contents are taken from email notes by kremenek and xuzhongxing.

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

14 years agoUse LLVM_ATTRIBUTE_NOINLINE instead of attribute((noinline)).
Ted Kremenek [Mon, 15 Nov 2010 23:11:54 +0000 (23:11 +0000)]
Use LLVM_ATTRIBUTE_NOINLINE instead of attribute((noinline)).

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

14 years agoTweak libclang's heuristics for building precompiled preambles and
Douglas Gregor [Mon, 15 Nov 2010 23:00:34 +0000 (23:00 +0000)]
Tweak libclang's heuristics for building precompiled preambles and
caching global code-completion results. In particular, don't perform
either operation the first time we parse, but do both after the first
reparse.

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

14 years agoRemove invalid assertion from CFG builder. When building the CFG pieces for a ternar...
Ted Kremenek [Mon, 15 Nov 2010 22:59:22 +0000 (22:59 +0000)]
Remove invalid assertion from CFG builder.  When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions.  Fixes assertion failure reported in PR 8619.

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

14 years agoCast pointers instead of returning a new value within RunVisitorWorkList().
Ted Kremenek [Mon, 15 Nov 2010 22:23:26 +0000 (22:23 +0000)]
Cast pointers instead of returning a new value within RunVisitorWorkList().

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

14 years agoAnnotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.
Ted Kremenek [Mon, 15 Nov 2010 22:23:24 +0000 (22:23 +0000)]
Annotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.
Clang currently uses a ridiculous amount of stack space when inlining
this function, which can lead to premature stack overflows.

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

14 years agoAdd method ParentMap::addStmt().
Ted Kremenek [Mon, 15 Nov 2010 20:54:24 +0000 (20:54 +0000)]
Add method ParentMap::addStmt().

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

14 years agoRelax assertion in SValuator so that we don't crash when analyzing a call via a funct...
Ted Kremenek [Mon, 15 Nov 2010 20:09:42 +0000 (20:09 +0000)]
Relax assertion in SValuator so that we don't crash when analyzing a call via a function pointer that
casts the return value to something completely different.  While we need better reasoning here,
we should definately not crash.

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

14 years agoSome cleanup of block API code.
Fariborz Jahanian [Mon, 15 Nov 2010 19:19:38 +0000 (19:19 +0000)]
Some cleanup of block API code.

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

14 years agoFixes PR8611.
Rafael Espindola [Mon, 15 Nov 2010 18:28:16 +0000 (18:28 +0000)]
Fixes PR8611.
Silence warning about -g not being used during linking. I couldn't find any
change in behavior in gcc liking when given -g. Please open another bug if
I missed something.

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

14 years agoRestore these tests. I think I fixed the problem.
Fariborz Jahanian [Mon, 15 Nov 2010 17:06:17 +0000 (17:06 +0000)]
Restore these tests. I think I fixed the problem.
We shall see.

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

14 years agoImplement C++0x [temp.func.order]p3 (aka DR532) properly. In
Douglas Gregor [Mon, 15 Nov 2010 15:41:16 +0000 (15:41 +0000)]
Implement C++0x [temp.func.order]p3 (aka DR532) properly. In
particular, we only add the implement object parameter type if only
one of the function templates is a non-static member function
template.

Moreover, since this DR differs from existing practice in C++98/03,
this commit implements the existing practice (which ignores the
first parameter of the function template that is not the non-static
member function template) in C++98/03 mode.

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

14 years agoSilence an unused variable warning during release builds by folding the
Chandler Carruth [Mon, 15 Nov 2010 13:54:43 +0000 (13:54 +0000)]
Silence an unused variable warning during release builds by folding the
expression into the assert.

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

14 years agoYes, vector conversions are bitcasts.
John McCall [Mon, 15 Nov 2010 10:08:00 +0000 (10:08 +0000)]
Yes, vector conversions are bitcasts.

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

14 years agoKill CK_Unknown references in the ObjC rewriter. The actual
John McCall [Mon, 15 Nov 2010 09:46:46 +0000 (09:46 +0000)]
Kill CK_Unknown references in the ObjC rewriter.  The actual
choice of cast doesn't matter here, but I've tried to choose
the right one anyway.

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

14 years agoFix a think-o. Fixes PR8606.
Chandler Carruth [Mon, 15 Nov 2010 09:28:23 +0000 (09:28 +0000)]
Fix a think-o. Fixes PR8606.

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

14 years agoAssorted work leading towards the elimination of CK_Unknown.
John McCall [Mon, 15 Nov 2010 09:13:47 +0000 (09:13 +0000)]
Assorted work leading towards the elimination of CK_Unknown.

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

14 years agoAdd driver support for Ubuntu 9.10.
Zhongxing Xu [Mon, 15 Nov 2010 09:01:52 +0000 (09:01 +0000)]
Add driver support for Ubuntu 9.10.

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

14 years agoAdd skeleton for handling other kinds of CFGElements.
Zhongxing Xu [Mon, 15 Nov 2010 08:48:43 +0000 (08:48 +0000)]
Add skeleton for handling other kinds of CFGElements.

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

14 years agoClean up some names and fix the handling of default sysroots on Windows and
Chandler Carruth [Mon, 15 Nov 2010 07:15:26 +0000 (07:15 +0000)]
Clean up some names and fix the handling of default sysroots on Windows and
other platforms where the textual default of '/' isn't the system's root
directory. We should probably still make the textual default platform specific,
but this should avoid the particularly bad problem with the previous state: we
applied a sysroot of '/' to '/usr/local/google' which added
'//usr/local/include' to the windows header search path, a share on another
machine named 'usr'. Oops.

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

14 years agoSwitch the sysroot logic to use the Path interface, resolving a FIXME and
Chandler Carruth [Mon, 15 Nov 2010 00:48:13 +0000 (00:48 +0000)]
Switch the sysroot logic to use the Path interface, resolving a FIXME and
making the code less gross.

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

14 years agoMake sysroot only apply to baked in paths which start with a '/'.
Chandler Carruth [Mon, 15 Nov 2010 00:05:18 +0000 (00:05 +0000)]
Make sysroot only apply to baked in paths which start with a '/'.

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

14 years agoRevert r119045. It was failing on Windows.
Ted Kremenek [Sun, 14 Nov 2010 17:53:34 +0000 (17:53 +0000)]
Revert r119045.  It was failing on Windows.

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

14 years ago"Fix" some unintentional fallout from converting
Ted Kremenek [Sun, 14 Nov 2010 17:47:35 +0000 (17:47 +0000)]
"Fix" some unintentional fallout from converting
the Stmt* visitation in CursorVisitor to be
data-recursive.

Since AnnotationTokensWorker explicitly calls
CursorVisitor::VisitChildren(), it essentially
transforms the data-recursive algorithm in
CursorVisitor back into a non-data recursive one.
This is particularly bad because the data-recursive
algorithm uses more stack space per stack frame,
which can cause us to blow the stack in some cases.

"Fix" this by making the stack that AnnotationTokensWorker
runs in really huge.  The real fix is to modify
AnnotationTokensWorker not to do the explicit
recursive call.

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

14 years agoClean up initialization of LangOptions object by splitting part of it into a parent...
Ted Kremenek [Sun, 14 Nov 2010 17:04:23 +0000 (17:04 +0000)]
Clean up initialization of LangOptions object by splitting part of it into a parent class
'LangOptionsBase' that default initializes all flags to 0.  Now the ctor of LangOptions
only initializes the flags that might be non-zero (significantly simplifying things).

This also appeases Valgrind on Mac OS X, which no longer reports that one of the flags
may be uninitialized.

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

14 years agoRevert r118991.
Zhongxing Xu [Sun, 14 Nov 2010 15:23:50 +0000 (15:23 +0000)]
Revert r118991.

Elidable CXXConstructExpr should inhibit calling destructor for temporary
that is copied, not the one created. This is because eliding copy constructor
means that the object that was to be copied will be constructed directly in
memory the copy would be constructed in.

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

14 years agoAlways emit full loads from volatile complex l-values.
John McCall [Sun, 14 Nov 2010 09:40:28 +0000 (09:40 +0000)]
Always emit full loads from volatile complex l-values.
Return the result of a complex assignment with the original values,
not by performing a load from the l-value;  this is the correct
semantics in C, although not in C++.

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

14 years agoAdd a few more complex-related cast kinds that arise due to arbitrary
John McCall [Sun, 14 Nov 2010 08:17:51 +0000 (08:17 +0000)]
Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions;  the last batch was specific to promotions.
I think this is the full set we need.  I do think dividing the cast
kinds into floating and integral is probably a good idea.

Annotate a *lot* more C casts with useful cast kinds.

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

14 years agotypo2
Chris Lattner [Sun, 14 Nov 2010 07:30:46 +0000 (07:30 +0000)]
typo2

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

14 years agofix typo
Chris Lattner [Sun, 14 Nov 2010 07:09:32 +0000 (07:09 +0000)]
fix typo

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

14 years agoCursorVisitor: make data-recursion algorithm the default except for the few remaining...
Ted Kremenek [Sun, 14 Nov 2010 05:45:47 +0000 (05:45 +0000)]
CursorVisitor: make data-recursion algorithm the default except for the few remaining Exprs still
covered by the normal recursive visitation.

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

14 years agoRemove stale #include.
Ted Kremenek [Sun, 14 Nov 2010 05:28:43 +0000 (05:28 +0000)]
Remove stale #include.

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

14 years agoRemoved unnecessary initialization of a flag which
Fariborz Jahanian [Sun, 14 Nov 2010 05:25:15 +0000 (05:25 +0000)]
Removed unnecessary initialization of a flag which
somehow got several block tests fail with a linux built
compiler.

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

14 years agoMakefile: Follow r118918, to add configuration "ENABLE_DOCS".
NAKAMURA Takumi [Sun, 14 Nov 2010 03:29:27 +0000 (03:29 +0000)]
Makefile: Follow r118918, to add configuration "ENABLE_DOCS".

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

14 years agotest/CodeGenCXX/dyncast.cpp: Remove XFAIL:win32 with tweaking llvm/utils/FileCheck...
NAKAMURA Takumi [Sun, 14 Nov 2010 03:29:22 +0000 (03:29 +0000)]
test/CodeGenCXX/dyncast.cpp: Remove XFAIL:win32 with tweaking llvm/utils/FileCheck in r119023, due to DOSish crlf issue.

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