Commit Graph

9816 Commits

Author SHA1 Message Date
Howard Hinnant 2d12fbdc2e testing
llvm-svn: 64990
2009-02-19 00:25:33 +00:00
Fariborz Jahanian d29fecd746 Couple of helpers for objc's gc attributes.
No change in functionality.

llvm-svn: 64989
2009-02-19 00:22:47 +00:00
Douglas Gregor 120951391c Make error-message check platform-agnostic
llvm-svn: 64985
2009-02-19 00:03:13 +00:00
Douglas Gregor 5f361c9f1e Address Chris's comments regarding C++ name mangling.
llvm-svn: 64984
2009-02-18 23:53:56 +00:00
Ted Kremenek 84e7c1e2ff retain/release checker: Place the leak diagnostic after the last statement that
references the tracked object.

llvm-svn: 64980
2009-02-18 23:28:26 +00:00
Chris Lattner 1b2cd9aca9 fariborz already fixed this.
llvm-svn: 64975
2009-02-18 23:00:57 +00:00
Ted Kremenek 6692f45829 Remove unused variable.
llvm-svn: 64974
2009-02-18 22:59:38 +00:00
Ted Kremenek 75a96ed40a Remove logic for computing 'display hint'.
llvm-svn: 64973
2009-02-18 22:59:04 +00:00
Chris Lattner 6805ac6ab0 minor name changes, no functionality change.
llvm-svn: 64972
2009-02-18 22:58:38 +00:00
Ted Kremenek 551747fe3a More fun with retain checker diagnostics:
- Fix some grammar.
- Fix a bug where a "reference count incremented" diagnostic would not be shown
  if the previous typestate was "Released" (only happens in GC mode).

llvm-svn: 64971
2009-02-18 22:57:22 +00:00
Chris Lattner d60183d29f fix some subtle bugs handling the mix of cvr qualifiers, addr spaces,
and gc attrs.  Add an assert to check that we never 
get ExtQualType(ExtQualType(T)).

llvm-svn: 64970
2009-02-18 22:53:11 +00:00
Daniel Dunbar a228a67637 Add anti-FIXME.
llvm-svn: 64969
2009-02-18 22:52:09 +00:00
Chris Lattner 416a3c1248 minor spacing changes.
llvm-svn: 64968
2009-02-18 22:34:38 +00:00
Daniel Dunbar 8cdb9dae45 i386 ABI: Offset computation in va_arg was incorrect for sizeof(Ty)>4.
We are down to only failing gcc.dg/compat/vector-[12] (8 tests total).

llvm-svn: 64967
2009-02-18 22:28:45 +00:00
Chris Lattner faca7d9842 fix typo
llvm-svn: 64966
2009-02-18 22:27:46 +00:00
Douglas Gregor ac3865c387 Remove pointless backslash
llvm-svn: 64965
2009-02-18 22:24:55 +00:00
Douglas Gregor 1cba5fe1d1 Downgrade the "excess elements in initializer" errors to warnings *in
C*. They're required errors in C++.

llvm-svn: 64964
2009-02-18 22:23:55 +00:00
Daniel Dunbar e60ec0abca x86_64 ABI: Fix thinko in computation of bound for "passed in SSE regs" test.
Two more gcc/x86_64 failures down.

llvm-svn: 64963
2009-02-18 22:19:44 +00:00
Ted Kremenek a790c8dcac Fix diagnostics bugs when computing ranges for the retain/release checker.
llvm-svn: 64962
2009-02-18 22:17:20 +00:00
Chris Lattner d7cfc246f6 rip out __builtin_overload
llvm-svn: 64961
2009-02-18 22:14:55 +00:00
Ted Kremenek 443e040d06 Add a few more GC-only test cases for the retain/release checker.
llvm-svn: 64960
2009-02-18 22:11:23 +00:00
Ted Kremenek ea3a9e270c HTMLDiagnostics: Always display diagnostics *below* the line in question.
llvm-svn: 64959
2009-02-18 22:10:00 +00:00
Daniel Dunbar e3bba6e3d0 x86_64 ABI: "is passed in regs" computation for va_arg was broken for
things passed in mixed registers.

This knocks out 8 x86_64 failures.

llvm-svn: 64958
2009-02-18 22:05:01 +00:00
Douglas Gregor 222e5e4ad2 Return true on errors, return true on errors, return true on errors
llvm-svn: 64957
2009-02-18 22:00:45 +00:00
Ted Kremenek 1045289881 retain/release checker: We now emit fancy diagnostics telling users about the
semantics of CFMakeCollectable and friends.

llvm-svn: 64956
2009-02-18 21:57:45 +00:00
Douglas Gregor 171c45ab0c Downgrade complaints about calling unavailable functions to a warning
(as GCC does), except when we've performed overload resolution and
found an unavailable function: in this case, we actually error.

Merge the checking of unavailable functions with the checking for
deprecated functions. This unifies a bit of code, and makes sure that
we're checking for unavailable functions in the right places. Also,
this check can cause an error. We may, eventually, want an option to
make "unavailable" warnings into errors.

Implement much of the logic needed for C++0x deleted functions, which
are effectively the same as "unavailable" functions (but always cause
an error when referenced). However, we don't have the syntax to
specify deleted functions yet :)

llvm-svn: 64955
2009-02-18 21:56:37 +00:00
Fariborz Jahanian 9620769901 Some refactoring and simplificaiotn of objc's gc
ir gen.

llvm-svn: 64954
2009-02-18 21:49:28 +00:00
Mike Stump 8dbf1dbdb8 Codegen for int (^bp)(int) = 0;
llvm-svn: 64951
2009-02-18 21:44:49 +00:00
Ted Kremenek aa61951171 Fix comment: analyzer builds are universal binaries.
llvm-svn: 64950
2009-02-18 21:24:14 +00:00
Daniel Dunbar aac5bf19a5 __attribute__((aligned)) was being ignored!
This knocks out another 8 gcc/compat/i386 & x86_64 failures.

llvm-svn: 64947
2009-02-18 20:06:09 +00:00
Daniel Dunbar b1c22fe9b7 Add Type::isSpecificBuiltinType as a shortcut.
llvm-svn: 64946
2009-02-18 19:59:32 +00:00
Daniel Dunbar 216f64379f Simplify.
llvm-svn: 64944
2009-02-18 19:45:21 +00:00
Chris Lattner 3dd56f96c3 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);
                      ^    ~~~~~~~~~~~~

llvm-svn: 64941
2009-02-18 19:26:42 +00:00
Chris Lattner ddb7191920 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.

llvm-svn: 64940
2009-02-18 19:21:10 +00:00
Chris Lattner 57a09cfcbc update comment.
llvm-svn: 64939
2009-02-18 18:56:29 +00:00
Ted Kremenek f68490a3f7 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.

llvm-svn: 64937
2009-02-18 18:54:33 +00:00
Chris Lattner ec396b5114 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.

llvm-svn: 64936
2009-02-18 18:52:52 +00:00
Fariborz Jahanian 9959eee95d Start generating gc'able code using the new
objc gc type attributes.

llvm-svn: 64935
2009-02-18 18:52:41 +00:00
Chris Lattner 24eb28bcf8 tidy up
llvm-svn: 64934
2009-02-18 18:50:45 +00:00
Chris Lattner 259971431d only get the spelling of a token to get its length if
it needs cleaning.

llvm-svn: 64932
2009-02-18 18:40:20 +00:00
Chris Lattner f638b97fe0 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);
           ^    ~~~~~~~~~~~~

llvm-svn: 64930
2009-02-18 18:34:12 +00:00
Chris Lattner df18c6a9af add c testcase for string literal diagnostic improvement.
llvm-svn: 64929
2009-02-18 18:25:31 +00:00
Chris Lattner 2aee77c906 don't print codegen time unless -ftime-report was passed.
llvm-svn: 64928
2009-02-18 18:22:50 +00:00
Fariborz Jahanian d35c792ebb Make warn-weak-field.m test pass again.
llvm-svn: 64927
2009-02-18 18:14:41 +00:00
Fariborz Jahanian 257eac6d0c 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.

llvm-svn: 64925
2009-02-18 17:52:36 +00:00
Chris Lattner a26fb347a0 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.

llvm-svn: 64924
2009-02-18 17:49:48 +00:00
Douglas Gregor 220cac5e89 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.

llvm-svn: 64922
2009-02-18 17:45:20 +00:00
Ted Kremenek ab89bc8ca1 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.
llvm-svn: 64921
2009-02-18 17:42:44 +00:00
Douglas Gregor c5c0488338 Add an unavailable __tg_promote function to attract incorrect uses of type-generic macros, rom Howard Hinnant.
llvm-svn: 64919
2009-02-18 17:23:05 +00:00
Chris Lattner 1fa74d9509 nothing says "ted was here" like a random url dropped in a header :)
llvm-svn: 64903
2009-02-18 07:09:44 +00:00