Граф коммитов

8614 Коммитов

Автор SHA1 Сообщение Дата
Mike Stump ca2f3fdeed Codegen for int (^bp)(int) = 0;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 21:44:49 +00:00
Ted Kremenek ed67b2c61c Fix comment: analyzer builds are universal binaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 21:24:14 +00:00
Daniel Dunbar 7549c5589a __attribute__((aligned)) was being ignored!
This knocks out another 8 gcc/compat/i386 & x86_64 failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 20:06:09 +00:00
Daniel Dunbar e00d5c00f3 Add Type::isSpecificBuiltinType as a shortcut.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 19:59:32 +00:00
Daniel Dunbar 6aee306b1c Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 19:45:21 +00:00
Chris Lattner 443e53c784 final string diagnostic issue (that I know about):
we used to not account for escapes in strings with
string concat.  Before:

t.m:5:20: warning: field width should have type 'int', but argument has type 'unsigned int'
  printf("\n\n" "\n\n%*d", (unsigned) 1, 1);
                   ^       ~~~~~~~~~~~~

after:

t.m:5:23: warning: field width should have type 'int', but argument has type 'unsigned int'
  printf("\n\n" "\n\n%*d", (unsigned) 1, 1);
                      ^    ~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 19:26:42 +00:00
Chris Lattner 719e61573f Next step toward making string diagnostics correct: handle
escapes in the string for subtoken positioning.  This gives
us working examples like:

t.m:5:16: warning: field width should have type 'int', but argument has type 'unsigned int'
  printf("\n\n%*d", (unsigned) 1, 1);
               ^    ~~~~~~~~~~~~

where before the caret pointed two spaces to the left.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 19:21:10 +00:00
Chris Lattner 6dcf63e920 update comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:56:29 +00:00
Ted Kremenek 1c512f5fcb retain/release checker: Distinguish in the function summaries between
retain/releases performed via [... release] and CFRetain(). The former are
no-ops in GC. The checker already handled this, but now we emit nice diagnostics
to the user telling them that these are no-ops.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:54:33 +00:00
Chris Lattner 2197c96354 Fix some issues handling sub-token locations that come from macro expansions.
We now emit:

t.m:6:15: warning: field width should have type 'int', but argument has type 'unsigned int'
  printf(STR, (unsigned) 1, 1);
         ^    ~~~~~~~~~~~~
t.m:3:18: note: instantiated from:
#define STR "abc%*ddef"
                 ^

which has the correct location in the string literal in the note line.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:52:52 +00:00
Fariborz Jahanian 5934e75d98 Start generating gc'able code using the new
objc gc type attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:52:41 +00:00
Chris Lattner 609b3ab97b tidy up
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:50:45 +00:00
Chris Lattner 0150cdfe94 only get the spelling of a token to get its length if
it needs cleaning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:40:20 +00:00
Chris Lattner d0d082f2eb use the full spelling of a string literal token so that trigraphs
and escaped newlines don't throw off the offset computation.

On this testcase:
  printf("abc\
def"
         "%*d", (unsigned) 1, 1);

Before:
t.m:5:5: warning: field width should have type 'int', but argument has type 'unsigned int'
def"
    ^

after:
t.m:6:12: warning: field width should have type 'int', but argument has type 'unsigned int'
         "%*d", (unsigned) 1, 1);
           ^    ~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:34:12 +00:00
Chris Lattner 07f192e1d7 add c testcase for string literal diagnostic improvement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:25:31 +00:00
Chris Lattner 8b76c0dd4a don't print codegen time unless -ftime-report was passed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:22:50 +00:00
Fariborz Jahanian ed7e9ef199 Make warn-weak-field.m test pass again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 18:14:41 +00:00
Fariborz Jahanian ba372b8552 Cleanup objc's gc attributes code no longer needed.
This make warn-weak-field.m to fail (subject of
a followup patch). 
attr-objc-gc.m no passes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64925 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:52:36 +00:00
Chris Lattner 6080008136 Start improving diagnostics that relate to subcharacters of string literals.
First step, handle diagnostics in StringLiteral's that are due to token pasting.

For example, we now handle:
  id str2 = @"foo" 
            "bar"
           @"baz"
           " b\0larg";  // expected-warning {{literal contains NUL character}}

Correctly:

test/SemaObjC/exprs.m:17:15: warning: CFString literal contains NUL character
           " b\0larg";  // expected-warning {{literal contains NUL character}}
           ~~~^~~~~~~

There are several other related issues still to be done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:49:48 +00:00
Douglas Gregor 809070a886 Update Parser::ParseTypeName to return a TypeResult, which also tells
us whether there was an error in trying to parse a type-name (type-id
in C++). This allows propagation of errors further in the compiler,
suppressing more bogus error messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:45:20 +00:00
Ted Kremenek e53f8206eb Revise comment. Comparing pointer values in 'Range' wasn't the performance issue I thought it was, but it is still worth ordering Range objects by their APSInt values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:42:44 +00:00
Douglas Gregor c13c0125a0 Add an unavailable __tg_promote function to attract incorrect uses of type-generic macros, rom Howard Hinnant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:23:05 +00:00
Chris Lattner da425ebf61 nothing says "ted was here" like a random url dropped in a header :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 07:09:44 +00:00
Douglas Gregor 965acbb321 Allow "overloadable" functions in C to be declared as variadic without
any named parameters, e.g., this is accepted in C:

  void f(...) __attribute__((overloadable));

although this would be rejected:

  void f(...);

To do this, moved the checking of the "ellipsis without any named
arguments" condition from the parser into Sema (where it belongs anyway).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 07:07:28 +00:00
Chris Lattner c6c16af963 teach child iterators to walk into the child string of an ObjCStringLiteral,
so it shows up in -ast-dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:53:08 +00:00
Chris Lattner 39c28bbbf2 fix the ownership issues and location tracking in
Sema::ParseObjCStringLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:48:40 +00:00
Chris Lattner b137299ce5 add iterators for string token locations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:48:23 +00:00
Chris Lattner 2085fd6cd2 privatize all of the string literal memory allocation/creation
stuff behind a private static function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:40:38 +00:00
Douglas Gregor c6666f8e9b Don't allow calls to functions marked "unavailable". There's more work
to do in this area, since there are other places that reference
FunctionDecls.

Don't allow "overloadable" functions (in C) to be declared without a
prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:34:51 +00:00
Chris Lattner f4b136fb40 add some comments describing what is happening here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:13:04 +00:00
Chris Lattner a0af1fe67d simplify the code used to compute the type of an objc string. This makes
it faster in the common case when NSConstantString is around.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:06:56 +00:00
Chris Lattner 690398188e rename CheckBuiltinCFStringArgument -> CheckObjCString
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 06:01:06 +00:00
Chris Lattner 97cf6eb380 simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 05:56:09 +00:00
Chris Lattner 726e168dc0 change the StringLiteral AST node to track all of the SourceLocations of
the various PPTokens that are pasted together to make it.  In the course
of working on this, I discovered ParseObjCStringLiteral which needs some
work.  I'll tackle it next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 05:49:11 +00:00
Ted Kremenek b103f01e5e Fix performance bug in RangeConstraintManager (that I introduced):
When comparing if one Range is "less" than another, compare the actual APSInt
  numeric values instead of their pointer addresses. This ensures that the
  ImmutableSet in RangeSet always has a consistent ordering between Ranges. This
  is critical for generating the same digest/hash for the contents of the sets.
  This was a serious performance bug because it would often cause state caching
  to be disabled along complicated paths.
  
Along the way:
 - Put Range and RangeSet in the "anonymous namespace" and mark them hidden



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 05:22:01 +00:00
Fariborz Jahanian d33d9c0cc0 Representation of objc gc's attribute using ExtQualType.
Note that one test attr-objc-gc.m fails. I will fix this
after removing these attributes from the Decl nodes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 05:09:49 +00:00
Daniel Dunbar 00dbfde0d7 ccc: Forward -ftime-report to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 05:01:43 +00:00
Chris Lattner e47f7b13ac pass -verify in exprs.m, merge const-id.m into message.m
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 04:41:38 +00:00
Chris Lattner a119a3b073 fix rdar://6597252: two exactly identical pointer types are always
compatible, even if they are weird implicit objc pointer types like
Class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 04:38:20 +00:00
Chris Lattner efdc39d4f5 rename some variables, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 04:28:32 +00:00
Chris Lattner d1dd229eda Optimize dyld startup time by specifying a trivial export map
(only export main) on the mac.

This improves DYLD_PRINT_STATISTICS from:
total time: 6.0 milliseconds (100.0%)
total images loaded:  5 (4 from dyld shared cache, 3 needed no fixups)
total segments mapped: 0, into 0 pages with 0 pages pre-fetched
total images loading time: 0.0 milliseconds (1.4%)
total rebase fixups:  0
total rebase fixups time: 0.0 milliseconds (0.0%)
total binding fixups: 7,928
total binding symbol lookups: 4,087, average images searched per symbol: 1.9
total binding fixups time: 4.7 milliseconds (79.2%)
total bindings lazily fixed up: 170 of 4,372
total init time time: 1.1 milliseconds (19.2%)
total images with weak exports:  2

to:
total time: 1.4 milliseconds (100.0%)
total images loaded:  5 (4 from dyld shared cache, 4 needed no fixups)
total segments mapped: 0, into 0 pages with 0 pages pre-fetched
total images loading time: 0.0 milliseconds (5.7%)
total rebase fixups:  0
total rebase fixups time: 0.0 milliseconds (0.2%)
total binding fixups: 1,079
total binding symbol lookups: 75, average images searched per symbol: 1.0
total binding fixups time: 0.5 milliseconds (33.9%)
total bindings lazily fixed up: 14 of 216
total init time time: 0.8 milliseconds (60.0%)
total images with weak exports:  1

This reduces the time to -fsyntax-only cocoa.h with PTH from 0.192s to 0.184 (4.3%)

rdar://6505315



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 04:02:00 +00:00
Ted Kremenek fe9e543a2a Hooked up the necessary machinery to allow the retain/release checker reference
back to the summary used when evaluating the statement associated with a
simulation node. This is now being used to help improve the checker's
diagnostics. To get things started, the checker now emits a path diagnostic
indicating that 'autorelease' is a no-op in GC mode.

Some of these changes are exposing further grossness in the interface between
BugReporter and the ExplodedGraph::Trim facilities. These really need to be
cleaned up one day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 03:48:14 +00:00
Daniel Dunbar 3e030b4c04 x86_64 ABI: Two bug fixes.
1. Return of _Complex long double used wrong type.

2. va_arg of types passed in two SSE registers didn't account for
extra space in register save area.

Down to 18 failures on gcc/compat/x86_64. Combined 32/64 results are:
--
		=== gcc Summary ===

# of expected passes		1292
# of unexpected failures	34
# of unsupported tests		2
--


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 03:44:19 +00:00
Ted Kremenek 09a9abc66b Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64879 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 03:09:29 +00:00
Ted Kremenek f5b34b120e retain/release checker: Record the summary used to generate a given node.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 02:00:25 +00:00
Chris Lattner 47099742e2 add a bunch of timers for -E and other modes. This requires
llvm r64874 or later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 01:51:21 +00:00
Chris Lattner 6f114eb1d6 teach -ftime-report to time the code generator and -emit-llvm times.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 01:37:30 +00:00
Chris Lattner 445026698c move llvm backend specific #includes into Backend.cpp instead of Clang.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 01:23:44 +00:00
Chris Lattner 8a5c80913c indentation and formatting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 01:20:05 +00:00
Chris Lattner dddaa9cbbc clang will hopefully never support ratfor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 01:17:01 +00:00