]> granicus.if.org Git - clang/log
clang
15 years agoFix horrible non-termination bug in LiveVariables. The issue was that
Ted Kremenek [Fri, 30 Jan 2009 21:35:30 +0000 (21:35 +0000)]
Fix horrible non-termination bug in LiveVariables.  The issue was that
the liveness state of block-level expressions could oscillate because
of two issues:
- The initial value before a merge was not always set to "Top"
- The set of live block-level expressions is a union, not an intersection

This fixes <rdar://problem/650084>.

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

15 years agoGenerate list of implemented classes and categories in their
Fariborz Jahanian [Fri, 30 Jan 2009 20:55:31 +0000 (20:55 +0000)]
Generate list of implemented classes and categories in their
own sections (related to objc2 nonfragile abi).

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

15 years agoDiagnosticKinds.def is gone.
Chris Lattner [Fri, 30 Jan 2009 20:04:14 +0000 (20:04 +0000)]
DiagnosticKinds.def is gone.

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

15 years agomemset takes an int, not a char.
Chris Lattner [Fri, 30 Jan 2009 20:03:59 +0000 (20:03 +0000)]
memset takes an int, not a char.

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

15 years agox86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, but
Daniel Dunbar [Fri, 30 Jan 2009 19:38:39 +0000 (19:38 +0000)]
x86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, but
matches gcc 4.2 (not llvm-gcc).

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

15 years agoMove method out-of-line.
Ted Kremenek [Fri, 30 Jan 2009 19:27:39 +0000 (19:27 +0000)]
Move method out-of-line.

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

15 years agoFix inverted logic in ParentMap::hasParent()
Ted Kremenek [Fri, 30 Jan 2009 19:06:38 +0000 (19:06 +0000)]
Fix inverted logic in ParentMap::hasParent()

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

15 years agowire up -fno-show-source-location option, patch by Alexei Svitkine!
Chris Lattner [Fri, 30 Jan 2009 19:01:41 +0000 (19:01 +0000)]
wire up -fno-show-source-location option, patch by Alexei Svitkine!

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

15 years agoCode gen. for @protocol expression in the new nonfragile abi.
Fariborz Jahanian [Fri, 30 Jan 2009 18:58:59 +0000 (18:58 +0000)]
Code gen. for @protocol expression in the new nonfragile abi.

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

15 years agoadd testcase for PR3437 and r63405
Chris Lattner [Fri, 30 Jan 2009 18:49:16 +0000 (18:49 +0000)]
add testcase for PR3437 and r63405

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

15 years agoRemove testing -use-x86_64-abi option; current implementation is
Daniel Dunbar [Fri, 30 Jan 2009 18:47:53 +0000 (18:47 +0000)]
Remove testing -use-x86_64-abi option; current implementation is
robust enough for general use.

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

15 years agoavoid emitting a bogus line marker for the top level #include
Chris Lattner [Fri, 30 Jan 2009 18:44:17 +0000 (18:44 +0000)]
avoid emitting a bogus line marker for the top level #include
location.  We now -E a file containing "foo" into:

# 1 "t.c"
# 1 "t.c" 1
# 1 "<predefines>" 1
# 1 "t.c" 2
foo

instead of:

# 1 "t.c"
# 1 "t.c" 1
# 0 "t.c"
# 1 "<predefines>" 1
# 1 "t.c" 2
foo

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

15 years agox86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500...
Daniel Dunbar [Fri, 30 Jan 2009 18:40:10 +0000 (18:40 +0000)]
x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500 return type failures.

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

15 years agoClosed out a few radars that were addressed by designated initializers
Douglas Gregor [Fri, 30 Jan 2009 17:42:28 +0000 (17:42 +0000)]
Closed out a few radars that were addressed by designated initializers

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

15 years ago" Attached is a patch for TextDiagnosticPrinter that adds an optional
Chris Lattner [Fri, 30 Jan 2009 17:41:53 +0000 (17:41 +0000)]
" Attached is a patch for TextDiagnosticPrinter that adds an optional
parameter that allows users to omit the printing of the source
location on a diagnostic. So basically it would omit the "abc.c:5:1: "
at the beginning of the line."

Patch by Alexei Svitkine!

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

15 years agoSwitch Type::isAggregateType to use the C++ definition of "aggregate
Douglas Gregor [Fri, 30 Jan 2009 17:31:00 +0000 (17:31 +0000)]
Switch Type::isAggregateType to use the C++ definition of "aggregate
type" rather than the C definition. We do this because both C99 and
Clang always use "aggregate type" as "aggregate or union type", and
the C++ definition includes union types.

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

15 years agoMake sure to cast the VLA size of array to the type of size_t. Fixes PR3442.
Anders Carlsson [Fri, 30 Jan 2009 16:41:04 +0000 (16:41 +0000)]
Make sure to cast the VLA size of array to the type of size_t. Fixes PR3442.

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

15 years agoSimplify/cleanup r63219 (based on Chris review).
Steve Naroff [Fri, 30 Jan 2009 14:23:32 +0000 (14:23 +0000)]
Simplify/cleanup r63219 (based on Chris review).

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

15 years agofix RUN line
Nuno Lopes [Fri, 30 Jan 2009 14:03:37 +0000 (14:03 +0000)]
fix RUN line

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

15 years agoenable test as it works
Nuno Lopes [Fri, 30 Jan 2009 13:01:29 +0000 (13:01 +0000)]
enable test as it works

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

15 years agoenable test as it already works
Nuno Lopes [Fri, 30 Jan 2009 12:58:18 +0000 (12:58 +0000)]
enable test as it already works

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

15 years agoAdd -fno-blocks support. This fixes block-no-block-def.c.
Mike Stump [Fri, 30 Jan 2009 08:22:07 +0000 (08:22 +0000)]
Add -fno-blocks support.  This fixes block-no-block-def.c.

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

15 years agox86_64 ABI: Implement classification for arrays.
Daniel Dunbar [Fri, 30 Jan 2009 08:09:32 +0000 (08:09 +0000)]
x86_64 ABI: Implement classification for arrays.
 - This brings us down to an 8% failure rate on the first 500 return
   types tests (from 12%).

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

15 years agoImplement constant generation of ImplicitValueInitExprs.
Anders Carlsson [Fri, 30 Jan 2009 06:13:25 +0000 (06:13 +0000)]
Implement constant generation of ImplicitValueInitExprs.

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

15 years agoccc: Forward -fobjc-nonfragile-abi to clang.
Daniel Dunbar [Fri, 30 Jan 2009 04:43:19 +0000 (04:43 +0000)]
ccc: Forward -fobjc-nonfragile-abi to clang.

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

15 years agoupdate for change in API.
Chris Lattner [Fri, 30 Jan 2009 01:58:33 +0000 (01:58 +0000)]
update for change in API.

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

15 years agoEliminated LookupCriteria, whose creation was causing a bottleneck for
Douglas Gregor [Fri, 30 Jan 2009 01:04:22 +0000 (01:04 +0000)]
Eliminated LookupCriteria, whose creation was causing a bottleneck for
LookupName et al. Instead, use an enum and a bool to describe its
contents.

Optimized the C/Objective-C path through LookupName, eliminating any
unnecessarily C++isms. Simplify IdentifierResolver::iterator, removing
some code and arguments that are no longer used.

Eliminated LookupDeclInScope/LookupDeclInContext, moving all callers
over to LookupName, LookupQualifiedName, or LookupParsedName, as
appropriate.

All together, I'm seeing a 0.2% speedup on Cocoa.h with PTH and
-disable-free. Plus, we're down to three name-lookup routines.

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

15 years agoUse uint64_t not unsigned for type sizes/offsets.
Daniel Dunbar [Fri, 30 Jan 2009 00:47:38 +0000 (00:47 +0000)]
Use uint64_t not unsigned for type sizes/offsets.

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

15 years agoBug fixing involving method-list in protocol meta-data
Fariborz Jahanian [Fri, 30 Jan 2009 00:46:37 +0000 (00:46 +0000)]
Bug fixing involving method-list in protocol meta-data
(objc2 nonfragile-abi).

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

15 years agoccc: Add -Xclang option, rename -WA, to -Xanalyzer.
Daniel Dunbar [Fri, 30 Jan 2009 00:24:16 +0000 (00:24 +0000)]
ccc: Add -Xclang option, rename -WA, to -Xanalyzer.
 - -Xclang always forwards to clang

 - -Xanalyzer replaces -WA,; it seems like the cleaner mechanism and
    is more readable.

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

15 years agoccc: Mark -combine option as unsupported.
Daniel Dunbar [Fri, 30 Jan 2009 00:12:29 +0000 (00:12 +0000)]
ccc: Mark -combine option as unsupported.

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

15 years agoFix a couple bugs:
Ted Kremenek [Fri, 30 Jan 2009 00:08:43 +0000 (00:08 +0000)]
Fix a couple bugs:
- NonLoc::MakeVal() would use sizeof(unsigned) (literally) instead of consulting
  ASTContext for the size (in bits) of 'int'. While it worked, it was a
  conflation of concepts and using ASTContext.IntTy is 100% correct.
- RegionStore::getSizeInElements() no longer assumes that a VarRegion has the
  type "ConstantArray", and handles the case when uses use ordinary variables
  as if they were arrays.
- Fixed ElementRegion::getRValueType() to just return the rvalue type of its
  "array region" in the case the array didn't have ArrayType.
- All of this fixes <rdar://problem/6541136>

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

15 years agoccc: Embrace destiny as a clang compiler driver.
Daniel Dunbar [Thu, 29 Jan 2009 23:54:06 +0000 (23:54 +0000)]
ccc: Embrace destiny as a clang compiler driver.

This redoes the default mode that ccc runs in w.r.t. using clang. Now
ccc defaults to always using clang for any task clang can
handle. However, the following options exist to tweak this behavior:

 -ccc-no-clang: Don't use clang at all for compilation (still used for
  static analysis).

 -ccc-no-clang-cxx: Don't use clang for C++ and Objective-C++ inputs.

 -ccc-no-clang-cpp: Don't use clang as a preprocessor.

 -ccc-clang-archs <archs>: If present, only use clang for the given
  comma separated list of architectures. This only works on Darwin for
  now.

Note that all -ccc options must be first on the command line.

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

15 years agoFix name of -x option for C preprocessed input; it should be
Daniel Dunbar [Thu, 29 Jan 2009 23:50:47 +0000 (23:50 +0000)]
Fix name of -x option for C preprocessed input; it should be
cpp-output, not c-cpp-output.

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

15 years agoRandom bug fix related to protocl metadata in categories in
Fariborz Jahanian [Thu, 29 Jan 2009 23:23:06 +0000 (23:23 +0000)]
Random bug fix related to protocl metadata in categories in
non-fragile abi.

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

15 years agoretain/release checker: When generating summaries for CF/CG functions, allow argument...
Ted Kremenek [Thu, 29 Jan 2009 22:45:13 +0000 (22:45 +0000)]
retain/release checker: When generating summaries for CF/CG functions, allow arguments to "escape" if they are passed to a function containing the terms "InsertValue", "SetValue", or "AddValue".  This fixes <rdar://problem/6539791>.

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

15 years agoABITest: Makefile tweaks
Daniel Dunbar [Thu, 29 Jan 2009 20:36:50 +0000 (20:36 +0000)]
ABITest: Makefile tweaks

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

15 years agoSet protocol linkage and visibility correctly and
Fariborz Jahanian [Thu, 29 Jan 2009 20:10:59 +0000 (20:10 +0000)]
Set protocol linkage and visibility correctly and
build protocol translation table meta-data (objc2
non-fragile abi).

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

15 years agoMake CodeGen produce an error if we come across a non-constant initializer list that...
Douglas Gregor [Thu, 29 Jan 2009 19:42:23 +0000 (19:42 +0000)]
Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension

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

15 years agoProtocol meta-data for objc2's non-fragile abi.
Fariborz Jahanian [Thu, 29 Jan 2009 19:24:30 +0000 (19:24 +0000)]
Protocol meta-data for objc2's non-fragile abi.
Lot more to do in this area.

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

15 years agodiags moved, so these casts are no longer needed.
Chris Lattner [Thu, 29 Jan 2009 18:49:48 +0000 (18:49 +0000)]
diags moved, so these casts are no longer needed.

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

15 years agoHack Sema::LookupDeclInScope() to avoid calling Sema::LookupName() when parsing C...
Steve Naroff [Thu, 29 Jan 2009 18:09:31 +0000 (18:09 +0000)]
Hack Sema::LookupDeclInScope() to avoid calling Sema::LookupName() when parsing C/ObjC.

This results in a 1.7% improvement for "Cocoa.h". If we can figure out how to return a "Decl *", rather than a Sema::LookupResult(), we will likely bump the speedup from 1.7%->2.5%. I verified this, however couldn't get it to work without breaking a fair number of C++ test cases. Will discuss with Doug offline.

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

15 years agoremove two empty files
Chris Lattner [Thu, 29 Jan 2009 17:46:42 +0000 (17:46 +0000)]
remove two empty files

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

15 years agonext round of diagnostics cleanups, moving some
Chris Lattner [Thu, 29 Jan 2009 17:46:13 +0000 (17:46 +0000)]
next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc.  Patch by
Anders Johnsen!

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

15 years agoIntroduce a new expression node, ImplicitValueInitExpr, that
Douglas Gregor [Thu, 29 Jan 2009 17:44:32 +0000 (17:44 +0000)]
Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.

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

15 years agoClean up designated initialization of unions, so that CodeGen doesn't
Douglas Gregor [Thu, 29 Jan 2009 16:53:55 +0000 (16:53 +0000)]
Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.

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

15 years agoSuppress a warning
Douglas Gregor [Thu, 29 Jan 2009 16:09:46 +0000 (16:09 +0000)]
Suppress a warning

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

15 years agox86_64 ABI: Handle fields / complex components which straddle
Daniel Dunbar [Thu, 29 Jan 2009 09:42:07 +0000 (09:42 +0000)]
x86_64 ABI: Handle fields / complex components which straddle
eightbyte boundaries.
 - Getting harder to test now that we handle cases gcc & llvm-gcc get
   wrong ( { _Complex char; _Complex int; } is a good example). :)

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

15 years agoABITest: Fix access to array test values.
Daniel Dunbar [Thu, 29 Jan 2009 08:48:06 +0000 (08:48 +0000)]
ABITest: Fix access to array test values.

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

15 years agox86_64 ABI: Tweak merging algorithm so that we always bail early when
Daniel Dunbar [Thu, 29 Jan 2009 08:35:40 +0000 (08:35 +0000)]
x86_64 ABI: Tweak merging algorithm so that we always bail early when
we see a Memory classification.

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

15 years agoABI: When emitting calls which return an ignored argument, make sure
Daniel Dunbar [Thu, 29 Jan 2009 08:24:57 +0000 (08:24 +0000)]
ABI: When emitting calls which return an ignored argument, make sure
to still return an RValue of the correct type.

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

15 years agox86_64 ABI: Implement classification for records.
Daniel Dunbar [Thu, 29 Jan 2009 08:13:58 +0000 (08:13 +0000)]
x86_64 ABI: Implement classification for records.
 - This is my best initial guess at what the "spec" means, although it is not
   particularly clear on a number of points. Will refine through testing.

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

15 years agoABITest: Fix test value generation for unions.
Daniel Dunbar [Thu, 29 Jan 2009 07:36:46 +0000 (07:36 +0000)]
ABITest: Fix test value generation for unions.

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

15 years agox86_64: Support cases which map to returning multiple values in LLVM
Daniel Dunbar [Thu, 29 Jan 2009 07:36:07 +0000 (07:36 +0000)]
x86_64: Support cases which map to returning multiple values in LLVM
(e.g., _Complex double -> { double, double } return).

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

15 years agox86_64 ABI: Classify _Complex ints as integer.
Daniel Dunbar [Thu, 29 Jan 2009 07:22:20 +0000 (07:22 +0000)]
x86_64 ABI: Classify _Complex ints as integer.

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

15 years agoFix -Wimplicit-function-declaration, which required some refactoring and
Chris Lattner [Thu, 29 Jan 2009 06:55:46 +0000 (06:55 +0000)]
Fix -Wimplicit-function-declaration, which required some refactoring and
changes in various diagnostics code.

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

15 years agoFix typo
Daniel Dunbar [Thu, 29 Jan 2009 06:44:03 +0000 (06:44 +0000)]
Fix typo

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

15 years agoEvaluate ==,!= for complex types.
Daniel Dunbar [Thu, 29 Jan 2009 06:43:41 +0000 (06:43 +0000)]
Evaluate ==,!= for complex types.

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

15 years agoUse xcc (instead of clang directly).
Daniel Dunbar [Thu, 29 Jan 2009 06:20:19 +0000 (06:20 +0000)]
Use xcc (instead of clang directly).

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

15 years agoEvaluate casts to complex.
Daniel Dunbar [Thu, 29 Jan 2009 06:16:07 +0000 (06:16 +0000)]
Evaluate casts to complex.
 - Lift (int,float) -> (int,float) conversion into separate routines.

 - Fix handling of, e.g., char -> _Complex int, which was producing a
   _Complex char value instead.

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

15 years agoccc: Honor -ccc-clang for generic GCC toolchain.
Daniel Dunbar [Thu, 29 Jan 2009 06:12:22 +0000 (06:12 +0000)]
ccc: Honor -ccc-clang for generic GCC toolchain.

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

15 years agoupdate the project file for headers moving
Chris Lattner [Thu, 29 Jan 2009 05:30:38 +0000 (05:30 +0000)]
update the project file for headers moving

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

15 years agoFix a wart that existed from before we had EXTWARN.
Chris Lattner [Thu, 29 Jan 2009 05:23:19 +0000 (05:23 +0000)]
Fix a wart that existed from before we had EXTWARN.

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

15 years agomove library-specific diagnostic headers into library private dirs. Reduce
Chris Lattner [Thu, 29 Jan 2009 05:15:15 +0000 (05:15 +0000)]
move library-specific diagnostic headers into library private dirs.  Reduce
redundant #includes.  Patch by Anders Johnsen!

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

15 years agofix an absolutely inscrutible gcc 4.0 error:
Chris Lattner [Thu, 29 Jan 2009 05:10:57 +0000 (05:10 +0000)]
fix an absolutely inscrutible gcc 4.0 error:

llvm[0]: Compiling SemaInit.cpp for Debug build
SemaInit.cpp:171: error: ‘InitListChecker’ has not been declared
SemaInit.cpp:171: error: ISO C++ forbids declaration of ‘InitListChecker’ with no type
SemaInit.cpp: In function ‘int InitListChecker(clang::Sema*, clang::InitListExpr*, clang::QualType&)’:
SemaInit.cpp:172: error: ‘hadError’ was not declared in this scope
SemaInit.cpp:173: error: ‘SemaRef’ was not declared in this scope
SemaInit.cpp:177: error: ‘FullyStructuredList’ was not declared in this scope

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

15 years agoAdd folding for complex mul and fix some major bugs in complex float
Daniel Dunbar [Thu, 29 Jan 2009 01:32:56 +0000 (01:32 +0000)]
Add folding for complex mul and fix some major bugs in complex float
evaluation (alternate part of real/imag init was being set to 3 not 0
because the wrong APFloat constructor was being called).
 - Test cases coming once some more support is in.

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

15 years agoAdd another devilish testcase for designated initializers
Douglas Gregor [Thu, 29 Jan 2009 01:10:11 +0000 (01:10 +0000)]
Add another devilish testcase for designated initializers

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

15 years agoBetter documentation for our initialization checker
Douglas Gregor [Thu, 29 Jan 2009 01:05:33 +0000 (01:05 +0000)]
Better documentation for our initialization checker

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

15 years agoMove InitListChecker out of Sema.h
Douglas Gregor [Thu, 29 Jan 2009 00:45:39 +0000 (00:45 +0000)]
Move InitListChecker out of Sema.h

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

15 years agoEliminate infinite looping in a wacky case with designated initializers. Simplifies...
Douglas Gregor [Thu, 29 Jan 2009 00:39:20 +0000 (00:39 +0000)]
Eliminate infinite looping in a wacky case with designated initializers. Simplifies (somewhat) the actually checking of the initializer expression following the designators

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

15 years agoRefactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInCon...
Steve Naroff [Thu, 29 Jan 2009 00:07:50 +0000 (00:07 +0000)]
Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInContext().

The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert.

The plan is to eventually deprecate both of these functions. For now, I'm focused on performance.

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

15 years agoRemove Expr::hasSideEffects. It doesn't work anyway
Douglas Gregor [Wed, 28 Jan 2009 23:43:32 +0000 (23:43 +0000)]
Remove Expr::hasSideEffects. It doesn't work anyway

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

15 years agoImprovements to code-generation and semantic analysis of designated
Douglas Gregor [Wed, 28 Jan 2009 23:36:17 +0000 (23:36 +0000)]
Improvements to code-generation and semantic analysis of designated
initializers.

  - We now initialize unions properly when a member other than the
    first is named by a designated initializer.
  - We now provide proper semantic analysis and code generation for
    GNU array-range designators *except* that side effects will occur
    more than once. We warn about this.

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

15 years agoAdd setter/getter methods to the list of methods
Fariborz Jahanian [Wed, 28 Jan 2009 22:46:49 +0000 (22:46 +0000)]
Add setter/getter methods to the list of methods
of class's meta-data (related to objc2 nonfragile abi).

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

15 years agoRemove '#if 0' code.
Ted Kremenek [Wed, 28 Jan 2009 22:35:55 +0000 (22:35 +0000)]
Remove '#if 0' code.

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

15 years agoRemove method 'AddNE' from the public interface of ConstraintManager.
Ted Kremenek [Wed, 28 Jan 2009 22:27:59 +0000 (22:27 +0000)]
Remove method 'AddNE' from the public interface of ConstraintManager.

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

15 years agoImplement basic _Complex integer constant folding.
Daniel Dunbar [Wed, 28 Jan 2009 22:24:07 +0000 (22:24 +0000)]
Implement basic _Complex integer constant folding.
 - Merged into single ComplexEvaluator, these share too much logic to
   be worth splitting for float/int (IMHO). Will split on request.

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

15 years agoproperty metadata for objc2's nonfragile abi
Fariborz Jahanian [Wed, 28 Jan 2009 22:18:42 +0000 (22:18 +0000)]
property metadata for objc2's nonfragile abi

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

15 years agoAdd some comments to GRStateManager. No functionality change.
Ted Kremenek [Wed, 28 Jan 2009 22:11:38 +0000 (22:11 +0000)]
Add some comments to GRStateManager.  No functionality change.

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

15 years agoCode generation support for C99 designated initializers.
Douglas Gregor [Wed, 28 Jan 2009 21:54:33 +0000 (21:54 +0000)]
Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
  - Designating a member of a union that isn't the first member may
    result in bogus initialization (we warn about this)
  - GNU array-range designators are not supported (we warn about this)

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

15 years agoretain/release checker: Always generate an "autorelease" summary for an "autorelease...
Ted Kremenek [Wed, 28 Jan 2009 21:44:40 +0000 (21:44 +0000)]
retain/release checker: Always generate an "autorelease" summary for an "autorelease" message, and have the summary processing logic treat it as a no-op in GC mode.  This change is motivated to encode more of the semantics in the summaries themselves for eventual better diagnostics.

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

15 years agoHandle complex types in ASTContext::mergeTypes
Daniel Dunbar [Wed, 28 Jan 2009 21:22:12 +0000 (21:22 +0000)]
Handle complex types in ASTContext::mergeTypes

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

15 years agoAdd autorelease test case.
Ted Kremenek [Wed, 28 Jan 2009 21:20:48 +0000 (21:20 +0000)]
Add autorelease test case.

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

15 years agoAdd more PTH diagnostics for invalid PTH files, etc.
Ted Kremenek [Wed, 28 Jan 2009 21:02:43 +0000 (21:02 +0000)]
Add more PTH diagnostics for invalid PTH files, etc.

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

15 years agoEnhance PTHManager::Create() to take an optional Diagnostic* argument that can be...
Ted Kremenek [Wed, 28 Jan 2009 20:49:33 +0000 (20:49 +0000)]
Enhance PTHManager::Create() to take an optional Diagnostic* argument that can be used to report issues such as a missing PTH file.

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

15 years agoFix TextDiagnosticPrinter::HandleDiagnostic to handle invalid FullSourceLocs that...
Ted Kremenek [Wed, 28 Jan 2009 20:47:47 +0000 (20:47 +0000)]
Fix TextDiagnosticPrinter::HandleDiagnostic to handle invalid FullSourceLocs that do not have a SourceManager.

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

15 years agoAdd method FullSourceLoc::getBufferData().
Ted Kremenek [Wed, 28 Jan 2009 20:46:26 +0000 (20:46 +0000)]
Add method FullSourceLoc::getBufferData().

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

15 years agoTweak doxygen comment. No functionality change.
Ted Kremenek [Wed, 28 Jan 2009 20:45:37 +0000 (20:45 +0000)]
Tweak doxygen comment.  No functionality change.

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

15 years agoName change (isTypeName->getTypeName).
Steve Naroff [Wed, 28 Jan 2009 19:39:02 +0000 (19:39 +0000)]
Name change (isTypeName->getTypeName).
Since it doesn't return a bool, is shouldn't be prefixed with 'is'.

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

15 years agoFix test case (for -### printing version)
Daniel Dunbar [Wed, 28 Jan 2009 19:30:43 +0000 (19:30 +0000)]
Fix test case (for -### printing version)

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

15 years agoccc: Support -v; invent a version number for ccc for now, will be
Daniel Dunbar [Wed, 28 Jan 2009 19:26:20 +0000 (19:26 +0000)]
ccc: Support -v; invent a version number for ccc for now, will be
shared with clang eventually.

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

15 years agoChange Parser::ParseFunctionDeclarator() to annotate typename tokens.
Steve Naroff [Wed, 28 Jan 2009 19:16:40 +0000 (19:16 +0000)]
Change Parser::ParseFunctionDeclarator() to annotate typename tokens.

This removes ~10% of the calls to Sema::isTypeName(), which amount to a little less than a 1% reduction in usertime (for Cocoa.h).

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

15 years agoSome refactoring of common code. No change in functionality.
Fariborz Jahanian [Wed, 28 Jan 2009 19:12:34 +0000 (19:12 +0000)]
Some refactoring of common code. No change in functionality.

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

15 years agoImplement pointer to member handling in static_cast.
Sebastian Redl [Wed, 28 Jan 2009 18:33:18 +0000 (18:33 +0000)]
Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.

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

15 years agoComplete semantic checking for typedef redeclarations in C++. The
Douglas Gregor [Wed, 28 Jan 2009 17:15:10 +0000 (17:15 +0000)]
Complete semantic checking for typedef redeclarations in C++. The
rules are slightly different than in C, and now we handle both
dialects properly.

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

15 years agoRemove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.
Steve Naroff [Wed, 28 Jan 2009 16:09:22 +0000 (16:09 +0000)]
Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.

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

15 years agoRemove 'enableLazyBuiltinCreation' argument to Sema::LookupDecl(). It is unused.
Steve Naroff [Wed, 28 Jan 2009 15:51:12 +0000 (15:51 +0000)]
Remove 'enableLazyBuiltinCreation' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.

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

15 years agoUpdated checker build.
Ted Kremenek [Wed, 28 Jan 2009 15:05:42 +0000 (15:05 +0000)]
Updated checker build.

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

15 years agoUpdate comment.
Ted Kremenek [Wed, 28 Jan 2009 07:10:33 +0000 (07:10 +0000)]
Update comment.

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

15 years agolong long and double have 64-bit alignment on x86-64.
Chris Lattner [Wed, 28 Jan 2009 06:58:19 +0000 (06:58 +0000)]
long long and double have 64-bit alignment on x86-64.

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