]> granicus.if.org Git - clang/log
clang
13 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

13 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

13 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

13 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

13 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

13 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

13 years agoInitialize couple of fields.
Fariborz Jahanian [Sat, 13 Nov 2010 23:48:30 +0000 (23:48 +0000)]
Initialize couple of fields.

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

13 years agoRemoving these test till redo them so they won't depend
Fariborz Jahanian [Sat, 13 Nov 2010 23:04:46 +0000 (23:04 +0000)]
Removing these test till redo them so they won't depend
on the built compiler.

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

13 years agoBlock API patch to do copy ctor of copied-in cxx objects in
Fariborz Jahanian [Sat, 13 Nov 2010 21:53:34 +0000 (21:53 +0000)]
Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.

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

13 years agoWhen complaining about ambiguous overload resolution for a unary or
Douglas Gregor [Sat, 13 Nov 2010 20:06:38 +0000 (20:06 +0000)]
When complaining about ambiguous overload resolution for a unary or
binary operator, provide the types.

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

13 years agoWhen we're type-checking the result of calling a conversion function
Douglas Gregor [Sat, 13 Nov 2010 19:36:57 +0000 (19:36 +0000)]
When we're type-checking the result of calling a conversion function
(while computing user conversion sequences), make sure that a result
of class type is a complete class type. Had we gone through
ActOnCallExpr, this would have happened when we built the CallExpr.

Fixes PR8425.

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

13 years agoDriver: Support -Oz as an alias for -Os.
Daniel Dunbar [Sat, 13 Nov 2010 18:17:11 +0000 (18:17 +0000)]
Driver: Support -Oz as an alias for -Os.

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

13 years agoSwitch to using %clang_cc1 properly rather than manually passing the -cc1 flag.
Chandler Carruth [Sat, 13 Nov 2010 10:19:35 +0000 (10:19 +0000)]
Switch to using %clang_cc1 properly rather than manually passing the -cc1 flag.

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

13 years agoIntroduce five new cast kinds for various conversions into and
John McCall [Sat, 13 Nov 2010 09:02:35 +0000 (09:02 +0000)]
Introduce five new cast kinds for various conversions into and
between complex types.

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

13 years agoBring UsualArithmeticConversionsType back into Sema and cast the
John McCall [Sat, 13 Nov 2010 08:17:45 +0000 (08:17 +0000)]
Bring UsualArithmeticConversionsType back into Sema and cast the
operands appropriately.  There are a lot of missing complex-related
cast kinds.

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

13 years agoDo not add implicit dtors for CXXBindTemporaryExpr with elidable
Zhongxing Xu [Sat, 13 Nov 2010 07:30:59 +0000 (07:30 +0000)]
Do not add implicit dtors for CXXBindTemporaryExpr with elidable
CXXConstructExpr.

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

13 years agoRewrite reverse iteration loop in a more natural countdown manner.
Ted Kremenek [Sat, 13 Nov 2010 05:55:56 +0000 (05:55 +0000)]
Rewrite reverse iteration loop in a more natural countdown manner.

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

13 years agoCursorVisitor: migrate CXXNewExpr and CXXDefaultArgExpr over to data-recursive algorithm.
Ted Kremenek [Sat, 13 Nov 2010 05:55:53 +0000 (05:55 +0000)]
CursorVisitor: migrate CXXNewExpr and CXXDefaultArgExpr over to data-recursive algorithm.

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

13 years agoPre-compute all possible usual-arithmetic-conversions results for the
John McCall [Sat, 13 Nov 2010 05:51:15 +0000 (05:51 +0000)]
Pre-compute all possible usual-arithmetic-conversions results for the
promoted arithmetic types for which builtin operator candidates are
emitted.  A few of these need further analysis.

Removes all the uses of UsualArithmeticConversionsType except the
core function in SemaExpr.cpp.

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

13 years agoCursorVisitor: special-case CompoundStmt in data-recursion algorithm so we don't...
Ted Kremenek [Sat, 13 Nov 2010 05:38:03 +0000 (05:38 +0000)]
CursorVisitor: special-case CompoundStmt in data-recursion algorithm so we don't have to enqueue
its children and then reverse them.

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

13 years agoRefine IdempotentOperationChecker::PathWasCompletelyAnalyzed() to also check
Ted Kremenek [Sat, 13 Nov 2010 05:12:26 +0000 (05:12 +0000)]
Refine IdempotentOperationChecker::PathWasCompletelyAnalyzed() to also check
BlockEdges, BlockEntrances, and BlockExits for the target block value.

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

13 years agoTeach IdempotentOperations::PathWasCompletelyAnalyzed to also consider items remainin...
Ted Kremenek [Sat, 13 Nov 2010 05:04:52 +0000 (05:04 +0000)]
Teach IdempotentOperations::PathWasCompletelyAnalyzed to also consider items remaining in the
worklist that could have impacted the evaluation of a block.

Fixes <rdar://problem/8663596>.

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

13 years agoAdd GRWorkList::VisitItemsInWorkList() to allow a client to introspect the contents...
Ted Kremenek [Sat, 13 Nov 2010 05:04:49 +0000 (05:04 +0000)]
Add GRWorkList::VisitItemsInWorkList() to allow a client to introspect the contents of a worklist.
This API required changing the BFS worklist to use a deque instead of a queue, but that is better
for performance reasons anyway.

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

13 years agoStore the list of arithmetic types as a static array of member pointers
John McCall [Sat, 13 Nov 2010 02:01:09 +0000 (02:01 +0000)]
Store the list of arithmetic types as a static array of member pointers
instead of copying them all out at the start.  Not a significant
optimization.

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

13 years agoIntroduce a null-to-pointer implicit cast kind.
John McCall [Sat, 13 Nov 2010 01:35:44 +0000 (01:35 +0000)]
Introduce a null-to-pointer implicit cast kind.

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

13 years agoCursorVisitor: Migrate BlockExpr, CXXTemporaryOBjectExpr, and ObjCEncodeExpr to data...
Ted Kremenek [Sat, 13 Nov 2010 01:09:29 +0000 (01:09 +0000)]
CursorVisitor: Migrate BlockExpr, CXXTemporaryOBjectExpr, and ObjCEncodeExpr to data-recursive algorithm.

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

13 years agoCursorVisitor: Migrate DeclRefExpr over to data-recursion algorithm.
Ted Kremenek [Sat, 13 Nov 2010 00:58:18 +0000 (00:58 +0000)]
CursorVisitor: Migrate DeclRefExpr over to data-recursion algorithm.

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

13 years agoCursorVisitor: migrate GotoStmt to data-recursive algorithm.
Ted Kremenek [Sat, 13 Nov 2010 00:58:15 +0000 (00:58 +0000)]
CursorVisitor: migrate GotoStmt to data-recursive algorithm.

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

13 years agoCursorVisitor: migrate DeclStmt over to data-recursive algorithm.
Ted Kremenek [Sat, 13 Nov 2010 00:36:50 +0000 (00:36 +0000)]
CursorVisitor: migrate DeclStmt over to data-recursive algorithm.

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

13 years agoCursorVisitor: Convert logic for populating data-recursion worklist from a switch...
Ted Kremenek [Sat, 13 Nov 2010 00:36:47 +0000 (00:36 +0000)]
CursorVisitor: Convert logic for populating data-recursion worklist from a switch statement to a StmtVisitor.  No functionality change.

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

13 years agoUse dyn_cast result instead of re-casting. Fixes -Werror build with:
Nick Lewycky [Fri, 12 Nov 2010 23:52:43 +0000 (23:52 +0000)]
Use dyn_cast result instead of re-casting. Fixes -Werror build with:
/llvm/tools/clang/tools/libclang/CIndex.cpp:1823: error: unused variable 'E' [-Wunused-variable]

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

13 years agoImplement C++ [over.match.funcs]p4 as it concerns partial ordering of
Douglas Gregor [Fri, 12 Nov 2010 23:44:13 +0000 (23:44 +0000)]
Implement C++ [over.match.funcs]p4 as it concerns partial ordering of
function templates. Fixes PR8130.

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

13 years agoCursorVisitor: Pull ObjCMessageExpr and explicit casts into data-recursion algorithm.
Ted Kremenek [Fri, 12 Nov 2010 22:24:57 +0000 (22:24 +0000)]
CursorVisitor: Pull ObjCMessageExpr and explicit casts into data-recursion algorithm.

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

13 years agoCursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.
Ted Kremenek [Fri, 12 Nov 2010 22:24:55 +0000 (22:24 +0000)]
CursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.

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

13 years agoCursorVisitor: migrate UnresolvedMemberExpr and UnresolvedLookupExpr over to data...
Ted Kremenek [Fri, 12 Nov 2010 21:34:16 +0000 (21:34 +0000)]
CursorVisitor: migrate UnresolvedMemberExpr and UnresolvedLookupExpr over to data-recursion algorithm.

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

13 years agoCursorVisitor: migrate CompoundLiteralExpr over to data-recursion algorithm.
Ted Kremenek [Fri, 12 Nov 2010 21:34:12 +0000 (21:34 +0000)]
CursorVisitor: migrate CompoundLiteralExpr over to data-recursion algorithm.

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

13 years agoCursorVisitor: add data-recursion support for InitListExprs.
Ted Kremenek [Fri, 12 Nov 2010 21:34:09 +0000 (21:34 +0000)]
CursorVisitor: add data-recursion support for InitListExprs.

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

13 years agoReduce string thrashing.
Benjamin Kramer [Fri, 12 Nov 2010 18:45:23 +0000 (18:45 +0000)]
Reduce string thrashing.

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

13 years agoCursorVisitor: migrate 'DoStmt', 'ForStmt', and 'WhileStmt' over to data-recursion...
Ted Kremenek [Fri, 12 Nov 2010 18:27:04 +0000 (18:27 +0000)]
CursorVisitor: migrate 'DoStmt', 'ForStmt', and 'WhileStmt' over to data-recursion algorithm.

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

13 years agoCursorVisitor: use 'WLAddStmt' and 'WLAddDecl' for adding to data-recursion worklist.
Ted Kremenek [Fri, 12 Nov 2010 18:27:01 +0000 (18:27 +0000)]
CursorVisitor: use 'WLAddStmt' and 'WLAddDecl' for adding to data-recursion worklist.

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

13 years agoCursorVisitor: migrate 'IfStmt' over to data-recursive algorithm.
Ted Kremenek [Fri, 12 Nov 2010 18:26:58 +0000 (18:26 +0000)]
CursorVisitor: migrate 'IfStmt' over to data-recursive algorithm.

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

13 years agoCursorVisitor: migrate handling of SwitchStmt and CaseStmt over to general data-recur...
Ted Kremenek [Fri, 12 Nov 2010 18:26:56 +0000 (18:26 +0000)]
CursorVisitor: migrate handling of SwitchStmt and CaseStmt over to general data-recursion algorithm.

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

13 years agoGeneralize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.
Bob Wilson [Fri, 12 Nov 2010 17:24:54 +0000 (17:24 +0000)]
Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.

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

13 years agoIncrease VectorTypeBitfields::VecKind field from 2 to 3 bits.
Bob Wilson [Fri, 12 Nov 2010 17:24:52 +0000 (17:24 +0000)]
Increase VectorTypeBitfields::VecKind field from 2 to 3 bits.
With the addition of 2 enum values for Neon vectors, this field must now
hold 6 different values and so requires 3 bits.  Make the NumElements field
one bit smaller to compensate.

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

13 years agoUse ASTContext::getTypeInfo to find the vector element size.
Bob Wilson [Fri, 12 Nov 2010 17:24:49 +0000 (17:24 +0000)]
Use ASTContext::getTypeInfo to find the vector element size.

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

13 years agoAdd a separate NeonPolyVector kind to distinguish polynomial vector types.
Bob Wilson [Fri, 12 Nov 2010 17:24:46 +0000 (17:24 +0000)]
Add a separate NeonPolyVector kind to distinguish polynomial vector types.
Add support for mangling those types according to ARM's ABI.

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

13 years agoAdd special-case mangling for Neon vector types.
Bob Wilson [Fri, 12 Nov 2010 17:24:43 +0000 (17:24 +0000)]
Add special-case mangling for Neon vector types.

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

13 years agoUse a twine.
Benjamin Kramer [Fri, 12 Nov 2010 15:42:18 +0000 (15:42 +0000)]
Use a twine.

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

13 years agoReplace one hack with a different hack: strip out the ObjectType
John McCall [Fri, 12 Nov 2010 08:19:04 +0000 (08:19 +0000)]
Replace one hack with a different hack:  strip out the ObjectType
parameters to the Transform*Type functions and instead call out
the specific cases where an object type and the unqualified lookup
results are important.  Fixes an assert and failed compile on
a testcase from PR7248.

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

13 years agoAPI enhancements to TypeLocBuilder.
John McCall [Fri, 12 Nov 2010 07:35:56 +0000 (07:35 +0000)]
API enhancements to TypeLocBuilder.

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

13 years agoMake sure to always check the result of
Douglas Gregor [Fri, 12 Nov 2010 07:15:47 +0000 (07:15 +0000)]
Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.

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

13 years agoFix use of an uninitialized SourceLocation because DeclarationNameLoc failed to compl...
Ted Kremenek [Fri, 12 Nov 2010 04:25:07 +0000 (04:25 +0000)]
Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself.
Now we explicitly memset all of its values.

This bug was uncovered by the 'Index/recursive-cxx-member-calls.cpp', which exhibited an assertion
on an i386 darwin build of clang.  Adding this test case back since the assertion is now resolved.

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

13 years agoWhen performing initialization of a copy of a temporary object, use
Douglas Gregor [Fri, 12 Nov 2010 03:34:06 +0000 (03:34 +0000)]
When performing initialization of a copy of a temporary object, use
direct-initialization (rather than copy-initialization) to initialize
the temporary, allowing explicit constructors. Fixes PR8342.

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

13 years agoAdd support for -nostdlib in the linux toolchain.
Rafael Espindola [Fri, 12 Nov 2010 03:00:39 +0000 (03:00 +0000)]
Add support for -nostdlib in the linux toolchain.

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

13 years agoModify CursorVisitor to also walks CXXOperatorCallExprs using data-recursion. Fixes...
Ted Kremenek [Thu, 11 Nov 2010 23:11:43 +0000 (23:11 +0000)]
Modify CursorVisitor to also walks CXXOperatorCallExprs using data-recursion.  Fixes <rdar://problem/8659019>.

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

13 years agoRegionStore/BasicStore: do not return UndefinedVal for accesses to concrete addresses...
Ted Kremenek [Thu, 11 Nov 2010 23:10:10 +0000 (23:10 +0000)]
RegionStore/BasicStore: do not return UndefinedVal for accesses to concrete addresses; instead return UnknownVal.  This
leads it up to checkers (e.g., DereferenceChecker) to guard against illegal accesses (e.g., null dereferences).

Fixes PR 5272 and <rdar://problem/6839683>.

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

13 years agoTeach debug-info generation that SourceManager::getPresumedLoc() can
Douglas Gregor [Thu, 11 Nov 2010 20:45:16 +0000 (20:45 +0000)]
Teach debug-info generation that SourceManager::getPresumedLoc() can
produce an invalid location even when given a valid location, if the
file system has changed underneath us. Recovery more gracefully.

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

13 years agoAdd support for -s, -pthread and -pthreads. Thanks to Hans Wennborg and
Rafael Espindola [Thu, 11 Nov 2010 19:34:42 +0000 (19:34 +0000)]
Add support for -s, -pthread and -pthreads. Thanks to Hans Wennborg and
Cosmin Truta for reporting it.

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

13 years agoDriver: Allow build system override of default non-fragile ABI version.
Daniel Dunbar [Thu, 11 Nov 2010 16:08:59 +0000 (16:08 +0000)]
Driver: Allow build system override of default non-fragile ABI version.

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

13 years agoTemporarily remove this test. It is causing an assertion failure in the builtbot.
Ted Kremenek [Thu, 11 Nov 2010 08:17:57 +0000 (08:17 +0000)]
Temporarily remove this test.  It is causing an assertion failure in the builtbot.

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

13 years agoAnnotate tokens in a separate thread to avoid blowing out stack space. While the...
Ted Kremenek [Thu, 11 Nov 2010 08:05:23 +0000 (08:05 +0000)]
Annotate tokens in a separate thread to avoid blowing out stack space.  While the CursorVisitor
is gradually becoming more data recursive, AnnotateTokensVisitor does its own recursive call
within the visitor that can still blow out the stack.  This can potentially be reworked to avoid this,
but for now just do token annotation on a separate thread.

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

13 years agoGeneralize data-recursive visitation in CursorVisitor to also handle MemberExprs
Ted Kremenek [Thu, 11 Nov 2010 08:05:18 +0000 (08:05 +0000)]
Generalize data-recursive visitation in CursorVisitor to also handle MemberExprs
and CXXCallMemberExprs.  This scheme is hopefully general enough to extend to the
rest of the visitor if necessary.

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

13 years agoUndo a refactor-o and base the bitfield-truncation warning on the
John McCall [Thu, 11 Nov 2010 05:33:51 +0000 (05:33 +0000)]
Undo a refactor-o and base the bitfield-truncation warning on the
uncoerced value.  Also, whitelist bool bitfields, which aren't
really a truncation.

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

13 years agotest/CMakeLists.txt: Use ${LLVM_LIT_ARGS} and remove redundant arguments "-sv" and...
NAKAMURA Takumi [Thu, 11 Nov 2010 04:09:51 +0000 (04:09 +0000)]
test/CMakeLists.txt: Use ${LLVM_LIT_ARGS} and remove redundant arguments "-sv" and "--no-progress-bar".

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

13 years agoRemove some unnecessary reinterpret_cast.
Francois Pichet [Thu, 11 Nov 2010 03:49:37 +0000 (03:49 +0000)]
Remove some unnecessary reinterpret_cast.

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

13 years agoExtend the bitfield-truncation warning to initializations.
John McCall [Thu, 11 Nov 2010 03:21:53 +0000 (03:21 +0000)]
Extend the bitfield-truncation warning to initializations.
rdar://problem/8652606

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

13 years agoAdd -rdynamic to freebsd and openbsd. Patch by Ruben.
Rafael Espindola [Thu, 11 Nov 2010 02:17:51 +0000 (02:17 +0000)]
Add -rdynamic to freebsd and openbsd. Patch by Ruben.

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

13 years agoAdd support for Exherbo. Patch by Elias Pipping.
Rafael Espindola [Thu, 11 Nov 2010 02:07:13 +0000 (02:07 +0000)]
Add support for Exherbo. Patch by Elias Pipping.

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

13 years agoUnnest; no functionality change.
John McCall [Thu, 11 Nov 2010 00:46:36 +0000 (00:46 +0000)]
Unnest;  no functionality change.

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

13 years agoImprove ASTUnit's capture of diagnostics so that the
Douglas Gregor [Thu, 11 Nov 2010 00:39:14 +0000 (00:39 +0000)]
Improve ASTUnit's capture of diagnostics so that the
diagnostic-capturing client lives as long as the ASTUnit itself
does. Otherwise, we can end up with crashes when we get a diagnostic
outside of parsing/code completion. The circumstances under which this
happen are really hard to reproduce, because a file needs to change
from under us.

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

13 years agoAdding couple of Block API, a bug fix and
Fariborz Jahanian [Thu, 11 Nov 2010 00:11:38 +0000 (00:11 +0000)]
Adding couple of Block API, a bug fix and
a test change, all for blocks. wip.

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

13 years agoadd a note about inline asm compatibility.
Chris Lattner [Wed, 10 Nov 2010 23:51:50 +0000 (23:51 +0000)]
add a note about inline asm compatibility.

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

13 years agoWhen -Wconversion computes the range of a type, it uses the (bit-)range
John McCall [Wed, 10 Nov 2010 23:38:19 +0000 (23:38 +0000)]
When -Wconversion computes the range of a type, it uses the (bit-)range
of the enumerators rather than the actual expressible range.  This is
great when dealing with opaque *values* of that type, but when computing
the range of the type for purposes of converting *into* it, it produces
warnings in cases we don't care about (e.g. enum_t x = 500;).  Divide
the logic into these two cases and use the more conservative range for
targets.

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

13 years agotest case for r118726.
Devang Patel [Wed, 10 Nov 2010 22:19:57 +0000 (22:19 +0000)]
test case for r118726.

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

13 years agoAdd a variant of GCC-style vector types for ARM NEON.
Bob Wilson [Wed, 10 Nov 2010 21:56:12 +0000 (21:56 +0000)]
Add a variant of GCC-style vector types for ARM NEON.
NEON vector types need to be mangled in a special way to comply with ARM's ABI,
similar to some of the AltiVec-specific vector types.  This patch is mostly
just renaming a bunch of "AltiVecSpecific" things, since they will no longer
be specific to AltiVec.  Besides that, it just adds the new "NeonVector" enum.

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

13 years agoDocument a language-compatibility issue with function parameter names in function...
Douglas Gregor [Wed, 10 Nov 2010 20:24:21 +0000 (20:24 +0000)]
Document a language-compatibility issue with function parameter names in function prototypes in C++

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

13 years agoInstantiate class member template partial specialization declarations
Douglas Gregor [Wed, 10 Nov 2010 19:44:59 +0000 (19:44 +0000)]
Instantiate class member template partial specialization declarations
in the order they occur within the class template, delaying
out-of-line member template partial specializations until after the
class has been fully instantiated. This fixes a regression introduced
by r118454 (itself a fix for PR8001).

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

13 years agoCheck for duplicate declaration of a property in current and
Fariborz Jahanian [Wed, 10 Nov 2010 18:01:36 +0000 (18:01 +0000)]
Check for duplicate declaration of a property in current and
other class extensions. // rdar://7629420

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

13 years agoPropagate the deprecated and unavailable attributes from a
John McCall [Wed, 10 Nov 2010 07:01:40 +0000 (07:01 +0000)]
Propagate the deprecated and unavailable attributes from a
@property declaration to the autogenerated methods.  I'm uncertain
whether this should apply to attributes in general, but these are
a reasonable core.

Implements rdar://problem/8617301

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

13 years agoRegion-allocate all AttributeList objects from a factory object instead of manually...
Ted Kremenek [Wed, 10 Nov 2010 05:59:39 +0000 (05:59 +0000)]
Region-allocate all AttributeList objects from a factory object instead of manually managing them
using new/delete and OwningPtrs.  After memory profiling Clang, I witnessed periodic leaks of these
objects; digging deeper into the code, it was clear that our management of these objects was a mess.  The ownership rules were murky at best, and not always followed.  Worse, there are plenty of error paths where we could screw up.

This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList
objects and then blows them away all at once.  While conceptually simple, most of the changes in
this patch just have to do with migrating over to the new interface.  Most of the changes have resulted in some nice simplifications.

This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser
object.  This is easily tunable.  If we desire to have more bound the lifetime of AttributeList
objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its
underlying allocator as we enter/leave key methods in the Parser.  This means that we get
simple memory management while still having the ability to finely control memory use if necessary.

Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic
in many large files with attributes.

This fixes the leak reported in: <rdar://problem/8650003>

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

13 years agoReplace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to avoid leaki...
Argyrios Kyrtzidis [Wed, 10 Nov 2010 05:40:41 +0000 (05:40 +0000)]
Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to avoid leaking memory.
Fixes rdar://8649963.

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

13 years agoAdd support for Ubuntu Jaunty.
Rafael Espindola [Wed, 10 Nov 2010 05:00:22 +0000 (05:00 +0000)]
Add support for Ubuntu Jaunty.

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

13 years agoFriend function declarations can overload with tag declarations.
John McCall [Wed, 10 Nov 2010 03:01:53 +0000 (03:01 +0000)]
Friend function declarations can overload with tag declarations.
Fixes PR7915.

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

13 years agoDiagnose attempst to template using declarations and using directives.
John McCall [Wed, 10 Nov 2010 02:40:36 +0000 (02:40 +0000)]
Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former.  Fixes PR8022.

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

13 years agomake sure #pragma clang is treated the same way as #pragma gcc in -E mode,
Chris Lattner [Wed, 10 Nov 2010 01:00:49 +0000 (01:00 +0000)]
make sure #pragma clang is treated the same way as #pragma gcc in -E mode,
unknown pragmas should just be passed through to the .i file.

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

13 years agoTweak to bitfield-overflow warning: don't warn about storing
John McCall [Wed, 10 Nov 2010 00:26:50 +0000 (00:26 +0000)]
Tweak to bitfield-overflow warning:  don't warn about storing
a positive value into a signed bitfield of the exact width of
the value.

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

13 years agoTypo.
John McCall [Tue, 9 Nov 2010 23:36:43 +0000 (23:36 +0000)]
Typo.

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

13 years agoAdd a warning for implicit truncation of constant values due to
John McCall [Tue, 9 Nov 2010 23:24:47 +0000 (23:24 +0000)]
Add a warning for implicit truncation of constant values due to
bitfield assignment.

Implements rdar://problem/7809123

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

13 years agoAdd a compat note about how Clang doesn't zero-initialize __block local variables.
Daniel Dunbar [Tue, 9 Nov 2010 22:45:16 +0000 (22:45 +0000)]
Add a compat note about how Clang doesn't zero-initialize __block local variables.

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

13 years agoSplit out -Wconversion warnings about constant precision into their
John McCall [Tue, 9 Nov 2010 22:22:12 +0000 (22:22 +0000)]
Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488

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

13 years agoTest moved to its correct place.
Fariborz Jahanian [Tue, 9 Nov 2010 21:40:30 +0000 (21:40 +0000)]
Test moved to its correct place.

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

13 years agoRestore patch reversed in r118475. Fixes
Fariborz Jahanian [Tue, 9 Nov 2010 21:38:20 +0000 (21:38 +0000)]
Restore patch reversed in r118475. Fixes
// rdar://8632525

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

13 years agoAttempt to resolve overloaded functions in comma expressions and
Douglas Gregor [Tue, 9 Nov 2010 21:07:58 +0000 (21:07 +0000)]
Attempt to resolve overloaded functions in comma expressions and
conditional operators. Fixes PR7863.

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

13 years agoIssues good diagnostic when @end is missing.
Fariborz Jahanian [Tue, 9 Nov 2010 20:38:00 +0000 (20:38 +0000)]
Issues good diagnostic when @end is missing.
// rdar://8283484

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

13 years agotidy up
Chris Lattner [Tue, 9 Nov 2010 20:15:55 +0000 (20:15 +0000)]
tidy up

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

13 years agofix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constru...
Chris Lattner [Tue, 9 Nov 2010 20:14:26 +0000 (20:14 +0000)]
fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constructed.

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

13 years agoRevert the fix for PR8013.
Douglas Gregor [Tue, 9 Nov 2010 20:03:54 +0000 (20:03 +0000)]
Revert the fix for PR8013.

That bug concerned the well-formedness of code such as (&ovl)(a, b,
c). GCC rejects the code, while EDG accepts it. On further study of the
standard, I see no support for EDG's position: in particular, C++
[over.over] does not list this as a context where we can take the
address of an overloaded function, C++ [over.call.func] does not
reference the address-of operator at any point, and C++ [expr.call]
claims that the function argument in a call is either a function
lvalue or a pointer-to-function; (&ovl) is neither.

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

13 years agoSimplify code.
Benjamin Kramer [Tue, 9 Nov 2010 20:00:56 +0000 (20:00 +0000)]
Simplify code.

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

13 years agomake the example a bit better, encouraging people to use "suggestions of what to...
Chris Lattner [Tue, 9 Nov 2010 19:43:35 +0000 (19:43 +0000)]
make the example a bit better, encouraging people to use "suggestions of what to use" in the message :)

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

13 years agoReplace "#if __clang__" by "#if __has_feature(attribute_analyzer_noreturn)" to be...
Ted Kremenek [Tue, 9 Nov 2010 18:54:17 +0000 (18:54 +0000)]
Replace "#if __clang__" by "#if __has_feature(attribute_analyzer_noreturn)" to be consistent with all other snippets on this page.

Patch by Jean-Daniel Dupas!

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