]> granicus.if.org Git - clang/log
clang
15 years agoAdd ConvertUTF module from http://www.unicode.org/Public/PROGRAMS/CVTUTF.
Steve Naroff [Wed, 1 Apr 2009 15:50:34 +0000 (15:50 +0000)]
Add ConvertUTF module from http://www.unicode.org/Public/PROGRAMS/CVTUTF.

#ifdef'd out the 5 conversion routines that we don't currently need.

Still need a bit more work in GetAddrOfConstantCFString(). Added a FIXME to indicate this.

Expect to remove the FIXME today...

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

15 years agoGive Type::getDesugaredType a "for-display" mode that can apply more
Douglas Gregor [Wed, 1 Apr 2009 15:47:24 +0000 (15:47 +0000)]
Give Type::getDesugaredType a "for-display" mode that can apply more
heuristics to determine when it's useful to desugar a type for display
to the user. Introduce two C++-specific heuristics:

  - For a qualified type (like "foo::bar"), only produce a new
    desugred type if desugaring the qualified type ("bar", in this
    case) produces something interesting. For example, if "foo::bar"
    refers to a class named "bar", don't desugar. However, if
    "foo::bar" refers to a typedef of something else, desugar to that
    something else. This gives some useful desugaring such as
    "foo::bar (aka 'int')".
  - Don't desugar class template specialization types like
    "basic_string<char>" down to their underlying "class
    basic_string<char, char_traits<char>, allocator<char>>, etc.";
    it's better just to leave such types alone.

Update diagnostics.html with some discussion and examples of type
preservation in C++, showing qualified names and class template
specialization types.

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

15 years agoAdd cocoa-pth.c test case, this got lost in shuffling PTH test cases.
Daniel Dunbar [Wed, 1 Apr 2009 15:36:37 +0000 (15:36 +0000)]
Add cocoa-pth.c test case, this got lost in shuffling PTH test cases.

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

15 years agoRe-enable PTH testing for cocoa.h and carbon.h. This tests that PTH works on
Ted Kremenek [Wed, 1 Apr 2009 15:28:20 +0000 (15:28 +0000)]
Re-enable PTH testing for cocoa.h and carbon.h. This tests that PTH works on
real-world header files and these tests have caught serious bugs in the past.

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

15 years agoMore "prep" work for handling UTF16 CFString.
Steve Naroff [Wed, 1 Apr 2009 13:55:36 +0000 (13:55 +0000)]
More "prep" work for handling UTF16 CFString.

Patch by Jean-Daniel Dupas. Thanks!

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

15 years agoProcessUCNEscape(): Incorportate some feedback from Chris.
Steve Naroff [Wed, 1 Apr 2009 11:09:15 +0000 (11:09 +0000)]
ProcessUCNEscape(): Incorportate some feedback from Chris.

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

15 years agox86-32 Darwin ABI: Handle small structures correctly.
Daniel Dunbar [Wed, 1 Apr 2009 07:45:00 +0000 (07:45 +0000)]
x86-32 Darwin ABI: Handle small structures correctly.
 - Small structures are returned in a register if:
    1. They fit nicely in a  register.
    2. All fields fit nicely in a register.
   (more or less)

 - We now pass the first 5000 ABITests if unions are disabled.

 - <rdar://problem/6497882> [irgen] x86-32 ABI compatibility with
   small structs

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

15 years agox86-32 Darwin ABI: Single element arrays can be part of "single
Daniel Dunbar [Wed, 1 Apr 2009 07:08:38 +0000 (07:08 +0000)]
x86-32 Darwin ABI: Single element arrays can be part of "single
element structures", which have different ABI rules.
 - Current return-arguments-32 status is: 1 out of 1000 failures (-7)

 - Also, vectors inside "single element structs" require special
   handling.

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

15 years agoFix: <rdar://problem/6740387>. Sending nil to an object that returns a struct
Ted Kremenek [Wed, 1 Apr 2009 06:52:48 +0000 (06:52 +0000)]
Fix: <rdar://problem/6740387>. Sending nil to an object that returns a struct
should only be an error if that value is consumed. This fix was largely
accomplished by moving 'isConsumedExpr' back to ParentMap.

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

15 years agoremove ASTContext::buildObjCInterfaceType, which breaks canonical
Chris Lattner [Wed, 1 Apr 2009 06:23:52 +0000 (06:23 +0000)]
remove ASTContext::buildObjCInterfaceType, which breaks canonical
types.  It is no longer needed now that the code generator
re-lays-out interfaces if they are defines after being laid out
from a forward decl.

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

15 years ago- Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocation
Ted Kremenek [Wed, 1 Apr 2009 06:13:56 +0000 (06:13 +0000)]
- Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocation
  instead of a FullSourceLoc. This resulted in a bunch of small edits in various
  clients.
- Updated BugReporter to include an alternate PathDiagnostic generation
  algorithm for PathDiagnosticClients desiring more control-flow pieces.

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

15 years agox86-32 Darwin ABI: Handle direct return of vectors.
Daniel Dunbar [Wed, 1 Apr 2009 06:13:08 +0000 (06:13 +0000)]
x86-32 Darwin ABI: Handle direct return of vectors.
 - Current return-arguments-32 status is: 8 out of 1000 failures (-7)

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

15 years agoUpdate docs.
Zhongxing Xu [Wed, 1 Apr 2009 06:01:08 +0000 (06:01 +0000)]
Update docs.

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

15 years agoAdjust doc format.
Zhongxing Xu [Wed, 1 Apr 2009 05:26:39 +0000 (05:26 +0000)]
Adjust doc format.

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

15 years agoPull clang-cc code for generating PTH files based on the input type.
Daniel Dunbar [Wed, 1 Apr 2009 05:09:09 +0000 (05:09 +0000)]
Pull clang-cc code for generating PTH files based on the input type.
 - <rdar://problem/6741594> [pth] don't abuse -x to drive pth
   generation

 - Simpler, and fixes PR3915.

Cleanup test cases for PTH:
 - Update to use -emit-pth

 - Removed PTH test of carbon.c and cocoa.mm; these didn't actually
   verify anything, and since PTH is token based the extra coverage
   (over cocoa.m) isn't particularly helpful.

 - Split PTH tests in cocoa.m to cocoa-pth.m, solely to increase
   available parallelism when running tests.

Ted, could you update the PTH test cases (include-pth.c and
cocoa-pth.m) to have some sort of positive check that the PTH is
getting used? "# of PTH cache hits" or "tokens read from PTH cache"
statistics would work great. :)

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

15 years agoupdate docs.
Zhongxing Xu [Wed, 1 Apr 2009 05:05:22 +0000 (05:05 +0000)]
update docs.

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

15 years agoFix a subtle bug where the cleanup scope entries had a dangling block reference
Daniel Dunbar [Wed, 1 Apr 2009 04:37:47 +0000 (04:37 +0000)]
Fix a subtle bug where the cleanup scope entries had a dangling block reference
 - <rdar://problem/6732143> Crash when generating @synchronize for
   zero-cost exception

 - Thanks to Anders for helping track down the problem.

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

15 years agoCFG: For 'if(...) {}' (empty body) construct an empty CFGBlock so that we can
Ted Kremenek [Wed, 1 Apr 2009 03:52:47 +0000 (03:52 +0000)]
CFG: For 'if(...) {}' (empty body) construct an empty CFGBlock so that we can
distinguish between the true and false branches for path-sensitive analyses.

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

15 years agoRemove a FIXME, use -emit-pth to drive PTH generation.
Daniel Dunbar [Wed, 1 Apr 2009 03:28:10 +0000 (03:28 +0000)]
Remove a FIXME, use -emit-pth to drive PTH generation.
 -  c.f. r68164

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

15 years agoUpdate docs.
Zhongxing Xu [Wed, 1 Apr 2009 03:23:38 +0000 (03:23 +0000)]
Update docs.

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

15 years agoTweak/cleanup darwin::Link a bit, add several FIXMES, and improve test
Daniel Dunbar [Wed, 1 Apr 2009 03:17:40 +0000 (03:17 +0000)]
Tweak/cleanup darwin::Link a bit, add several FIXMES, and improve test
case.

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

15 years agoFix pascal string support; testcase from mailing list message.
Eli Friedman [Wed, 1 Apr 2009 03:17:08 +0000 (03:17 +0000)]
Fix pascal string support; testcase from mailing list message.

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

15 years agoFollow gcc's example and warn by default on unknown escapes. Inspired
Eli Friedman [Wed, 1 Apr 2009 02:59:02 +0000 (02:59 +0000)]
Follow gcc's example and warn by default on unknown escapes.  Inspired
by mailing list message about "\phello" style strings.

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

15 years agoFix test failure on Linux by forcing the triple to OS X.
Eli Friedman [Wed, 1 Apr 2009 02:55:21 +0000 (02:55 +0000)]
Fix test failure on Linux by forcing the triple to OS X.

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

15 years agoFlip diagnostic from Warning to ExtWarn so that it's an error
Eli Friedman [Wed, 1 Apr 2009 02:48:25 +0000 (02:48 +0000)]
Flip diagnostic from Warning to ExtWarn so that it's an error
with -pedantic-errors.  This fixes the C99 part of PR3919.

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

15 years agofix the two xfails I added with a previous patch by making ObjC interface
Chris Lattner [Wed, 1 Apr 2009 02:36:43 +0000 (02:36 +0000)]
fix the two xfails I added with a previous patch by making ObjC interface
types get completed when their definition is seen if previously laid out by
the code generator.

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

15 years agomove trivial forwarding function inline.
Chris Lattner [Wed, 1 Apr 2009 02:08:13 +0000 (02:08 +0000)]
move trivial forwarding function inline.

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

15 years agotidy some code.
Chris Lattner [Wed, 1 Apr 2009 02:00:48 +0000 (02:00 +0000)]
tidy some code.

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

15 years agoFix block comparisons. Radar 6732116.
Mike Stump [Wed, 1 Apr 2009 01:17:39 +0000 (01:17 +0000)]
Fix block comparisons.  Radar 6732116.

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

15 years agoImplement code generation of namespaces and add mangling tests.
Anders Carlsson [Wed, 1 Apr 2009 00:58:25 +0000 (00:58 +0000)]
Implement code generation of namespaces and add mangling tests.

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

15 years agoadd support for the LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX limits.h GNU extensions.
Chris Lattner [Wed, 1 Apr 2009 00:44:37 +0000 (00:44 +0000)]
add support for the LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX limits.h GNU extensions.
rdar://6740292

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

15 years agoFix a bug (that I thought I had fixed already) where mangling a prefix could get...
Anders Carlsson [Wed, 1 Apr 2009 00:42:16 +0000 (00:42 +0000)]
Fix a bug (that I thought I had fixed already) where mangling a prefix could get us into an infinite loop

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

15 years agoParsing, semantic analysis, and template instantiation for typename
Douglas Gregor [Wed, 1 Apr 2009 00:28:59 +0000 (00:28 +0000)]
Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,

  typename MetaFun::template apply<T1, T2>

Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,

  typename T::type::type

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

15 years agoTweak darwin::Assemble and add a FIXME.
Daniel Dunbar [Wed, 1 Apr 2009 00:27:44 +0000 (00:27 +0000)]
Tweak darwin::Assemble and add a FIXME.

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

15 years agoAdd '-emit-pth' option to clang-cc as an alternate API for the high-level driver
Ted Kremenek [Wed, 1 Apr 2009 00:23:28 +0000 (00:23 +0000)]
Add '-emit-pth' option to clang-cc as an alternate API for the high-level driver
to generate PTH files. Soon we will remove from clang-cc the GCC-style '-x
c-header' interface for generating PTH files and push this logic to 'clang'.

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

15 years agoFix a mangling bug where functions with no arguments weren't getting the 'v' paramete...
Anders Carlsson [Wed, 1 Apr 2009 00:15:23 +0000 (00:15 +0000)]
Fix a mangling bug where functions with no arguments weren't getting the 'v' parameter specifier.

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

15 years agoAdd Target hooks for IRgen of [cf]string literals.
Daniel Dunbar [Tue, 31 Mar 2009 23:42:16 +0000 (23:42 +0000)]
Add Target hooks for IRgen of [cf]string literals.
 - Notably, set section on cfstring literal string data (for now, this
   is done everywhere because it matches what we were already doing
   for the CFString data itself)

 - <rdar://problem/6599098> [irgen] linker requires objc string data
   to go into cstring

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

15 years agoMore code reshuffling. No functionality change.
Ted Kremenek [Tue, 31 Mar 2009 23:00:32 +0000 (23:00 +0000)]
More code reshuffling.  No functionality change.

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

15 years agoChange UsedArray to be a vector of WeakVH to fix a dangling pointer problem that...
Chris Lattner [Tue, 31 Mar 2009 22:37:52 +0000 (22:37 +0000)]
Change UsedArray to be a vector of WeakVH to fix a dangling pointer problem that occurs when
attribute(used) and asm renaming are used together.

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

15 years agoremove some obsolete comments, use an AssertingVH.
Chris Lattner [Tue, 31 Mar 2009 22:17:44 +0000 (22:17 +0000)]
remove some obsolete comments, use an AssertingVH.

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

15 years agoDriver: Implement basic --help text.
Daniel Dunbar [Tue, 31 Mar 2009 21:38:17 +0000 (21:38 +0000)]
Driver: Implement basic --help text.
 - PR3875.
 - <rdar://problem/6615249> [driver] ccc should support some form of
   --help

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

15 years agoDriver: Add OptTable::getOptionKind.
Daniel Dunbar [Tue, 31 Mar 2009 21:26:12 +0000 (21:26 +0000)]
Driver: Add OptTable::getOptionKind.

Also, removed default value for getOptionMetaVar.

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

15 years agoDriver: Forward -Wp, and -Xpreprocessor arguments to clang when using
Daniel Dunbar [Tue, 31 Mar 2009 20:53:55 +0000 (20:53 +0000)]
Driver: Forward -Wp, and -Xpreprocessor arguments to clang when using
the preprocessor.
 - PR3602.

 - As is inherent in the blanket forwarding options, this will only
   work if clang-cc happens to accept what the user passed. Users by
   and large should use driver options to interact with the
   preprocessor, if at all possible.

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

15 years agoAllow two codepaths for PathDiagnostic generation. This patch mainly consists of
Ted Kremenek [Tue, 31 Mar 2009 20:22:36 +0000 (20:22 +0000)]
Allow two codepaths for PathDiagnostic generation. This patch mainly consists of
refactoring to make this possible (no functionality change).

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

15 years agoSome cleanup and renaming. No functionality change
Douglas Gregor [Tue, 31 Mar 2009 20:22:05 +0000 (20:22 +0000)]
Some cleanup and renaming. No functionality change

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

15 years agoDriver: Add extra parameters for help text to option definitions.
Daniel Dunbar [Tue, 31 Mar 2009 20:12:05 +0000 (20:12 +0000)]
Driver: Add extra parameters for help text to option definitions.
 - Currently unused.

And yes, now may be about the time I want a TableGen backend.

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

15 years agoAdd two FIXMEs
Daniel Dunbar [Tue, 31 Mar 2009 20:10:05 +0000 (20:10 +0000)]
Add two FIXMEs

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

15 years agoImprove the dependent nested-name-specifier test a bit
Douglas Gregor [Tue, 31 Mar 2009 20:07:16 +0000 (20:07 +0000)]
Improve the dependent nested-name-specifier test a bit

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

15 years agox86_32 Darwin ABI: Treat empty unions like empty structures.
Daniel Dunbar [Tue, 31 Mar 2009 19:01:39 +0000 (19:01 +0000)]
x86_32 Darwin ABI: Treat empty unions like empty structures.
 - Current return-arguments-32 status: 15/1000 failures

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

15 years agoRename clang.[cpp,h] to clang-cc.[cpp,h] to reflect the name change of the
Ted Kremenek [Tue, 31 Mar 2009 18:58:14 +0000 (18:58 +0000)]
Rename clang.[cpp,h] to clang-cc.[cpp,h] to reflect the name change of the
low-level frontend driver.

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

15 years agoUpdate VS project.
Ted Kremenek [Tue, 31 Mar 2009 18:57:19 +0000 (18:57 +0000)]
Update VS project.

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

15 years agoImplement template instantiation for template names, including both
Douglas Gregor [Tue, 31 Mar 2009 18:38:02 +0000 (18:38 +0000)]
Implement template instantiation for template names, including both
template template parameters and dependent template names. For
example, the oft-mentioned

  typename MetaFun::template apply<T1, T2>::type

can now be instantiated, with the appropriate name lookup for "apply".

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

15 years agoPatch to fix proptocol reference ir-gen for GNU runtime.
Fariborz Jahanian [Tue, 31 Mar 2009 18:27:22 +0000 (18:27 +0000)]
Patch to fix proptocol reference ir-gen for GNU runtime.
Patch by David Chisnal.

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

15 years agoir-gen support for nonfragile abi's synthesized ivars.
Fariborz Jahanian [Tue, 31 Mar 2009 18:11:23 +0000 (18:11 +0000)]
ir-gen support for nonfragile abi's synthesized ivars.

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

15 years agoDriver: Call 'as' directly on FreeBSD.
Daniel Dunbar [Tue, 31 Mar 2009 17:45:15 +0000 (17:45 +0000)]
Driver: Call 'as' directly on FreeBSD.
 - Patch by Ed Schouten!

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

15 years ago(LLVM up) Update to use llvm::sys::getHostTriple().
Daniel Dunbar [Tue, 31 Mar 2009 17:35:15 +0000 (17:35 +0000)]
(LLVM up) Update to use llvm::sys::getHostTriple().
 - Always pass -triple to clang-cc (-arch will be removed).

 - clang-cc doesn't play guess work with the target triple anymore.

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

15 years agoAdd -Wdeprecated-declarations to driver and add a test case.
Steve Naroff [Tue, 31 Mar 2009 17:28:26 +0000 (17:28 +0000)]
Add -Wdeprecated-declarations to driver and add a test case.

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

15 years agoWe fully support namespace aliases now.
Anders Carlsson [Tue, 31 Mar 2009 17:17:14 +0000 (17:17 +0000)]
We fully support namespace aliases now.

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

15 years agoMore toward nonfragile abi's synthesized ivars.
Fariborz Jahanian [Tue, 31 Mar 2009 17:00:52 +0000 (17:00 +0000)]
More toward nonfragile abi's synthesized ivars.

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

15 years agoSome "prep" work for handling ObjC @-string constants that contain UTF-8. No function...
Steve Naroff [Tue, 31 Mar 2009 16:53:37 +0000 (16:53 +0000)]
Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.

Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).

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

15 years agoImplement -Wmissing-prototypes. Fixes PR3911.
Douglas Gregor [Tue, 31 Mar 2009 16:35:03 +0000 (16:35 +0000)]
Implement -Wmissing-prototypes. Fixes PR3911.

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

15 years agoAdd support for -Wdeprecated-declarations.
Steve Naroff [Tue, 31 Mar 2009 15:00:11 +0000 (15:00 +0000)]
Add support for -Wdeprecated-declarations.

This fixes <rdar://problem/6712496> Unable to disable deprecated warning.

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

15 years agoIncorporate feedback from Eli.
Steve Naroff [Tue, 31 Mar 2009 10:29:45 +0000 (10:29 +0000)]
Incorporate feedback from Eli.

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

15 years agoFix a problem in ASTContext::addRecordToClass handling forward declarations.
Chris Lattner [Tue, 31 Mar 2009 09:24:30 +0000 (09:24 +0000)]
Fix a problem in ASTContext::addRecordToClass handling forward declarations.
In a case like:

@class foo;
foo *P;

addRecordToClass was making an empty shadow struct for the foo interface and
completing it.  Later when an:

@interface foo
...
@endif

foo *Q;

was seen, ASTContext::addRecordToClass would think that foo was already laid
out and not lay out the definition.  This fixes it to create a forward declared
struct the first time around, then complete it when the definition is seen.

Note that this causes two tests to regress, because something is trying to get
the size of the forward declared structs returned by this.  Previously, this
would end up getting a size of zero but now it properly dies.  I'm not sure
what the right solution is for this, so I xfailed the tests.

Fariborz, please take a look at this.  The testcase in rdar://6676794 now gets
farther, but dies later because the objc ivar is not assigned a field number.

As an aside, I really don't like the fact that the objc front-end is creating
shadow C structs for ObjC types.  This seems like an implementation detail of
the code generator that could be fixed by better factoring of the extant code.

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

15 years agoremove a dead prototype
Chris Lattner [Tue, 31 Mar 2009 09:07:15 +0000 (09:07 +0000)]
remove a dead prototype

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

15 years agoremove the warning. We don't control what users do, and this code
Chris Lattner [Tue, 31 Mar 2009 09:04:50 +0000 (09:04 +0000)]
remove the warning.  We don't control what users do, and this code
is run for perfectly reasonable things like NSString* because type
layout is recursive.

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

15 years agodisable copying of Type objects.
Chris Lattner [Tue, 31 Mar 2009 08:58:42 +0000 (08:58 +0000)]
disable copying of Type objects.

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

15 years agodo not *copy* objc interface types, just use their reference.
Chris Lattner [Tue, 31 Mar 2009 08:55:07 +0000 (08:55 +0000)]
do not *copy* objc interface types, just use their reference.

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

15 years agofill in temporary smallvectors instead of vectors for performance.
Chris Lattner [Tue, 31 Mar 2009 08:48:01 +0000 (08:48 +0000)]
fill in temporary smallvectors instead of vectors for performance.
Fix BuildAggrIvarLayout to not access vectors out of range.

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

15 years agosimplify some casting
Chris Lattner [Tue, 31 Mar 2009 08:36:08 +0000 (08:36 +0000)]
simplify some casting

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

15 years agosmall cleanups.
Chris Lattner [Tue, 31 Mar 2009 08:33:16 +0000 (08:33 +0000)]
small cleanups.

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

15 years agoadd a const version of the lookupFieldDeclForIvar method.
Chris Lattner [Tue, 31 Mar 2009 08:31:13 +0000 (08:31 +0000)]
add a const version of the lookupFieldDeclForIvar method.

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

15 years agoreduce nesting.
Chris Lattner [Tue, 31 Mar 2009 08:18:48 +0000 (08:18 +0000)]
reduce nesting.

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

15 years agoCodegen sometimes crashes on comparisons that aren't legal, just
Chris Lattner [Tue, 31 Mar 2009 07:46:52 +0000 (07:46 +0000)]
Codegen sometimes crashes on comparisons that aren't legal, just
disable this feature for now, to err on the side of rejecting instead
of sometimes crashing.  rdar://6326239

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

15 years agoCheck in test for namespace aliases+using directives.
Anders Carlsson [Tue, 31 Mar 2009 05:47:19 +0000 (05:47 +0000)]
Check in test for namespace aliases+using directives.

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

15 years agoDocument NamespaceAliasDecl.
Anders Carlsson [Tue, 31 Mar 2009 04:51:13 +0000 (04:51 +0000)]
Document NamespaceAliasDecl.

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

15 years agoUpdate test case.
Ted Kremenek [Tue, 31 Mar 2009 03:34:38 +0000 (03:34 +0000)]
Update test case.

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

15 years agoParsing and AST representation for dependent template names that occur
Douglas Gregor [Tue, 31 Mar 2009 00:43:58 +0000 (00:43 +0000)]
Parsing and AST representation for dependent template names that occur
within nested-name-specifiers, e.g., for the "apply" in

  typename MetaFun::template apply<T1, T2>::type

At present, we can't instantiate these nested-name-specifiers, so our
testing is sketchy.

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

15 years agofe support for objc2's nonfragile-abi synthesized ivars.
Fariborz Jahanian [Tue, 31 Mar 2009 00:06:29 +0000 (00:06 +0000)]
fe support for objc2's nonfragile-abi synthesized ivars.

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

15 years agoImplement UCN support for C string literals (C99 6.4.3) and add some very basic tests...
Steve Naroff [Mon, 30 Mar 2009 23:46:03 +0000 (23:46 +0000)]
Implement UCN support for C string literals (C99 6.4.3) and add some very basic tests. Chris Goller has graciously offered to write some test to help validate UCN support.

From a front-end perspective, I believe this code should work for ObjC @-strings. At the moment, I believe we need to tweak the code generation for @-strings (which doesn't appear to handle them). Will be investigating.

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

15 years agoSlight generalization for Evaluate with const variables.
Eli Friedman [Mon, 30 Mar 2009 23:39:01 +0000 (23:39 +0000)]
Slight generalization for Evaluate with const variables.

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

15 years agoImprove the representation of template names in the AST. This
Douglas Gregor [Mon, 30 Mar 2009 22:58:21 +0000 (22:58 +0000)]
Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").

One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as

  std::(vector<int>)

we represent it as

  (std::vector)<int>

which more closely follows the C++ grammar.

Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.

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

15 years agoAdd partial CFG support for Objective-C exception-handling blocks. We basically
Ted Kremenek [Mon, 30 Mar 2009 22:29:21 +0000 (22:29 +0000)]
Add partial CFG support for Objective-C exception-handling blocks. We basically
assume that @catch blocks are never executed.

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

15 years agoRe-apply 68028. The code had drifted enough that the tests would fail without
Ted Kremenek [Mon, 30 Mar 2009 22:20:54 +0000 (22:20 +0000)]
Re-apply 68028. The code had drifted enough that the tests would fail without
it.  Will discuss offline whether symbolic regions should by typed or typeless.

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

15 years agoComment fix.
Daniel Dunbar [Mon, 30 Mar 2009 22:11:38 +0000 (22:11 +0000)]
Comment fix.

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

15 years agoRevert 68028.
Ted Kremenek [Mon, 30 Mar 2009 21:56:17 +0000 (21:56 +0000)]
Revert 68028.

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

15 years agoAdded new info to property impl. AST node to support
Fariborz Jahanian [Mon, 30 Mar 2009 21:33:50 +0000 (21:33 +0000)]
Added new info to property impl. AST node to support
objc2's ivar synthesis.

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

15 years agoRemove dead code.
Ted Kremenek [Mon, 30 Mar 2009 21:27:41 +0000 (21:27 +0000)]
Remove dead code.

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

15 years agoImplement -Wno-pointer-sign.
Eli Friedman [Mon, 30 Mar 2009 21:19:48 +0000 (21:19 +0000)]
Implement -Wno-pointer-sign.

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

15 years agoDriver: Sketch FreeBSD tool chain.
Daniel Dunbar [Mon, 30 Mar 2009 21:06:03 +0000 (21:06 +0000)]
Driver: Sketch FreeBSD tool chain.
 - Patch by Ed Schouten!

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

15 years agoCode gen does not yet supports __asm__ on a variable
Fariborz Jahanian [Mon, 30 Mar 2009 20:32:06 +0000 (20:32 +0000)]
Code gen does not yet supports __asm__ on a variable
declaration. Reject it.

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

15 years agoSimplify more code by using SVal::getAsSymbol().
Ted Kremenek [Mon, 30 Mar 2009 19:53:37 +0000 (19:53 +0000)]
Simplify more code by using SVal::getAsSymbol().

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

15 years agoSimplify more code by using SVal::getAsSymbol() instead of
Ted Kremenek [Mon, 30 Mar 2009 18:45:36 +0000 (18:45 +0000)]
Simplify more code by using SVal::getAsSymbol() instead of
loc::SymbolVal/nonloc::SymbolVal probing.

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

15 years agoConvert use of loc::SymbolVal and nonloc::SymbolVal to V.getAsSymbol(). This
Ted Kremenek [Mon, 30 Mar 2009 18:39:15 +0000 (18:39 +0000)]
Convert use of loc::SymbolVal and nonloc::SymbolVal to V.getAsSymbol(). This
also makes this code more correct as it transparently handles SVals that wrapped
TypedViewRegions(SymbolicRegions).

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

15 years agoAdd another uninitialized values test case illustrating that the CFG correctly
Ted Kremenek [Mon, 30 Mar 2009 18:29:27 +0000 (18:29 +0000)]
Add another uninitialized values test case illustrating that the CFG correctly
handles declarations with multiple variables.

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

15 years agoRemove a trivial FIXME
Douglas Gregor [Mon, 30 Mar 2009 18:22:51 +0000 (18:22 +0000)]
Remove a trivial FIXME

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

15 years agoDriver: Unbreak ArgList::hasFlag.
Daniel Dunbar [Mon, 30 Mar 2009 18:13:26 +0000 (18:13 +0000)]
Driver: Unbreak ArgList::hasFlag.
 - <rdar://problem/6726511> [driver] clang does not have -msoft-float
   hooked up.

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

15 years agoUse CodeGenModule API for ObjC runtime function references.
Fariborz Jahanian [Mon, 30 Mar 2009 18:02:14 +0000 (18:02 +0000)]
Use CodeGenModule API for ObjC runtime function references.
Patch by David Chisnall.

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

15 years agoFix -MD with no -MT when -o is specified (and fix test case).
Daniel Dunbar [Mon, 30 Mar 2009 17:59:58 +0000 (17:59 +0000)]
Fix -MD with no -MT when -o is specified (and fix test case).

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

15 years agoAdd version of GRExprEngine::AddCheck that registered a GRSimpleAPICheck that
Ted Kremenek [Mon, 30 Mar 2009 17:53:05 +0000 (17:53 +0000)]
Add version of GRExprEngine::AddCheck that registered a GRSimpleAPICheck that
will be called for every expression in a basic block.

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