]> granicus.if.org Git - clang/log
clang
15 years agoCodegen for int (^bp)(int) = 0;
Mike Stump [Wed, 18 Feb 2009 21:44:49 +0000 (21:44 +0000)]
Codegen for int (^bp)(int) = 0;

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

15 years agoFix comment: analyzer builds are universal binaries.
Ted Kremenek [Wed, 18 Feb 2009 21:24:14 +0000 (21:24 +0000)]
Fix comment: analyzer builds are universal binaries.

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

15 years ago__attribute__((aligned)) was being ignored!
Daniel Dunbar [Wed, 18 Feb 2009 20:06:09 +0000 (20:06 +0000)]
__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

15 years agoAdd Type::isSpecificBuiltinType as a shortcut.
Daniel Dunbar [Wed, 18 Feb 2009 19:59:32 +0000 (19:59 +0000)]
Add Type::isSpecificBuiltinType as a shortcut.

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

15 years agoSimplify.
Daniel Dunbar [Wed, 18 Feb 2009 19:45:21 +0000 (19:45 +0000)]
Simplify.

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

15 years agofinal string diagnostic issue (that I know about):
Chris Lattner [Wed, 18 Feb 2009 19:26:42 +0000 (19:26 +0000)]
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

15 years agoNext step toward making string diagnostics correct: handle
Chris Lattner [Wed, 18 Feb 2009 19:21:10 +0000 (19:21 +0000)]
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

15 years agoupdate comment.
Chris Lattner [Wed, 18 Feb 2009 18:56:29 +0000 (18:56 +0000)]
update comment.

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

15 years agoretain/release checker: Distinguish in the function summaries between
Ted Kremenek [Wed, 18 Feb 2009 18:54:33 +0000 (18:54 +0000)]
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

15 years agoFix some issues handling sub-token locations that come from macro expansions.
Chris Lattner [Wed, 18 Feb 2009 18:52:52 +0000 (18:52 +0000)]
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

15 years agoStart generating gc'able code using the new
Fariborz Jahanian [Wed, 18 Feb 2009 18:52:41 +0000 (18:52 +0000)]
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

15 years agotidy up
Chris Lattner [Wed, 18 Feb 2009 18:50:45 +0000 (18:50 +0000)]
tidy up

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

15 years agoonly get the spelling of a token to get its length if
Chris Lattner [Wed, 18 Feb 2009 18:40:20 +0000 (18:40 +0000)]
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

15 years agouse the full spelling of a string literal token so that trigraphs
Chris Lattner [Wed, 18 Feb 2009 18:34:12 +0000 (18:34 +0000)]
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

15 years agoadd c testcase for string literal diagnostic improvement.
Chris Lattner [Wed, 18 Feb 2009 18:25:31 +0000 (18:25 +0000)]
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

15 years agodon't print codegen time unless -ftime-report was passed.
Chris Lattner [Wed, 18 Feb 2009 18:22:50 +0000 (18:22 +0000)]
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

15 years agoMake warn-weak-field.m test pass again.
Fariborz Jahanian [Wed, 18 Feb 2009 18:14:41 +0000 (18:14 +0000)]
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

15 years agoCleanup objc's gc attributes code no longer needed.
Fariborz Jahanian [Wed, 18 Feb 2009 17:52:36 +0000 (17:52 +0000)]
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

15 years agoStart improving diagnostics that relate to subcharacters of string literals.
Chris Lattner [Wed, 18 Feb 2009 17:49:48 +0000 (17:49 +0000)]
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

15 years agoUpdate Parser::ParseTypeName to return a TypeResult, which also tells
Douglas Gregor [Wed, 18 Feb 2009 17:45:20 +0000 (17:45 +0000)]
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

15 years agoRevise comment. Comparing pointer values in 'Range' wasn't the performance issue...
Ted Kremenek [Wed, 18 Feb 2009 17:42:44 +0000 (17:42 +0000)]
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

15 years agoAdd an unavailable __tg_promote function to attract incorrect uses of type-generic...
Douglas Gregor [Wed, 18 Feb 2009 17:23:05 +0000 (17:23 +0000)]
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

15 years agonothing says "ted was here" like a random url dropped in a header :)
Chris Lattner [Wed, 18 Feb 2009 07:09:44 +0000 (07:09 +0000)]
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

15 years agoAllow "overloadable" functions in C to be declared as variadic without
Douglas Gregor [Wed, 18 Feb 2009 07:07:28 +0000 (07:07 +0000)]
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

15 years agoteach child iterators to walk into the child string of an ObjCStringLiteral,
Chris Lattner [Wed, 18 Feb 2009 06:53:08 +0000 (06:53 +0000)]
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

15 years agofix the ownership issues and location tracking in
Chris Lattner [Wed, 18 Feb 2009 06:48:40 +0000 (06:48 +0000)]
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

15 years agoadd iterators for string token locations.
Chris Lattner [Wed, 18 Feb 2009 06:48:23 +0000 (06:48 +0000)]
add iterators for string token locations.

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

15 years agoprivatize all of the string literal memory allocation/creation
Chris Lattner [Wed, 18 Feb 2009 06:40:38 +0000 (06:40 +0000)]
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

15 years agoDon't allow calls to functions marked "unavailable". There's more work
Douglas Gregor [Wed, 18 Feb 2009 06:34:51 +0000 (06:34 +0000)]
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

15 years agoadd some comments describing what is happening here.
Chris Lattner [Wed, 18 Feb 2009 06:13:04 +0000 (06:13 +0000)]
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

15 years agosimplify the code used to compute the type of an objc string. This makes
Chris Lattner [Wed, 18 Feb 2009 06:06:56 +0000 (06:06 +0000)]
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

15 years agorename CheckBuiltinCFStringArgument -> CheckObjCString
Chris Lattner [Wed, 18 Feb 2009 06:01:06 +0000 (06:01 +0000)]
rename CheckBuiltinCFStringArgument -> CheckObjCString

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

15 years agosimplify some code.
Chris Lattner [Wed, 18 Feb 2009 05:56:09 +0000 (05:56 +0000)]
simplify some code.

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

15 years agochange the StringLiteral AST node to track all of the SourceLocations of
Chris Lattner [Wed, 18 Feb 2009 05:49:11 +0000 (05:49 +0000)]
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

15 years agoFix performance bug in RangeConstraintManager (that I introduced):
Ted Kremenek [Wed, 18 Feb 2009 05:22:01 +0000 (05:22 +0000)]
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

15 years agoRepresentation of objc gc's attribute using ExtQualType.
Fariborz Jahanian [Wed, 18 Feb 2009 05:09:49 +0000 (05:09 +0000)]
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

15 years agoccc: Forward -ftime-report to clang.
Daniel Dunbar [Wed, 18 Feb 2009 05:01:43 +0000 (05:01 +0000)]
ccc: Forward -ftime-report to clang.

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

15 years agopass -verify in exprs.m, merge const-id.m into message.m
Chris Lattner [Wed, 18 Feb 2009 04:41:38 +0000 (04:41 +0000)]
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

15 years agofix rdar://6597252: two exactly identical pointer types are always
Chris Lattner [Wed, 18 Feb 2009 04:38:20 +0000 (04:38 +0000)]
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

15 years agorename some variables, no functionality change.
Chris Lattner [Wed, 18 Feb 2009 04:28:32 +0000 (04:28 +0000)]
rename some variables, no functionality change.

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

15 years agoOptimize dyld startup time by specifying a trivial export map
Chris Lattner [Wed, 18 Feb 2009 04:02:00 +0000 (04:02 +0000)]
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

15 years agoHooked up the necessary machinery to allow the retain/release checker reference
Ted Kremenek [Wed, 18 Feb 2009 03:48:14 +0000 (03:48 +0000)]
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

15 years agox86_64 ABI: Two bug fixes.
Daniel Dunbar [Wed, 18 Feb 2009 03:44:19 +0000 (03:44 +0000)]
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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 18 Feb 2009 03:09:29 +0000 (03:09 +0000)]
Update checker build.

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

15 years agoretain/release checker: Record the summary used to generate a given node.
Ted Kremenek [Wed, 18 Feb 2009 02:00:25 +0000 (02:00 +0000)]
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

15 years agoadd a bunch of timers for -E and other modes. This requires
Chris Lattner [Wed, 18 Feb 2009 01:51:21 +0000 (01:51 +0000)]
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

15 years agoteach -ftime-report to time the code generator and -emit-llvm times.
Chris Lattner [Wed, 18 Feb 2009 01:37:30 +0000 (01:37 +0000)]
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

15 years agomove llvm backend specific #includes into Backend.cpp instead of Clang.cpp
Chris Lattner [Wed, 18 Feb 2009 01:23:44 +0000 (01:23 +0000)]
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

15 years agoindentation and formatting
Chris Lattner [Wed, 18 Feb 2009 01:20:05 +0000 (01:20 +0000)]
indentation and formatting

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

15 years agoclang will hopefully never support ratfor.
Chris Lattner [Wed, 18 Feb 2009 01:17:01 +0000 (01:17 +0000)]
clang will hopefully never support ratfor.

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

15 years agowire up a minimal -ftime-report, which prints the optimizer/codegen
Chris Lattner [Wed, 18 Feb 2009 01:12:43 +0000 (01:12 +0000)]
wire up a minimal -ftime-report, which prints the optimizer/codegen
times.  Daniel, plz add driver support.

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

15 years agoFix test: config.h is not guaranteed to exist at the location in
Eli Friedman [Wed, 18 Feb 2009 01:02:14 +0000 (01:02 +0000)]
Fix test: config.h is not guaranteed to exist at the location in
question.  Use __builtin_alloca instead, which is guaranteed to mean the right
thing without any includes.

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

15 years agoFix test on platforms where size_t != unsigned long.
Eli Friedman [Wed, 18 Feb 2009 00:52:29 +0000 (00:52 +0000)]
Fix test on platforms where size_t != unsigned long.

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

15 years agoisICE was evaluating ?: incorrectly with missing-gcc-LHS extension.
Daniel Dunbar [Wed, 18 Feb 2009 00:47:45 +0000 (00:47 +0000)]
isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.

Add assert to isICE that, on success, result must be the same as
EvaluateAsInt()... this enforces a minimum level of sanity.

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

15 years agoConvert isIntegerConstantExpr to use ASTContext::MakeIntValue.
Daniel Dunbar [Wed, 18 Feb 2009 00:32:53 +0000 (00:32 +0000)]
Convert isIntegerConstantExpr to use ASTContext::MakeIntValue.
 - This idiom ensures that the result will have the right width and
   type.

 - Tested on most of x86_64/llvm-test to satisfy my paranoia.

 - This fixes at least the following bugs:
   o UnaryTypeTraitExpr wasn't setting the width correctly.
   o Arithmetic on _Bool wasn't setting the width correctly.

   And probably a number more.

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

15 years agoAdd ASTContext::MakeIntValue
Daniel Dunbar [Wed, 18 Feb 2009 00:29:14 +0000 (00:29 +0000)]
Add ASTContext::MakeIntValue
 - Makes an APSInt given a uint64_t and a type, with the appropriate
   width and signedness to match the type. Yay for functional over
   imperative.

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

15 years agostop searching GCC install directories for standard C headers (but
Chris Lattner [Wed, 18 Feb 2009 00:25:15 +0000 (00:25 +0000)]
stop searching GCC install directories for standard C headers (but
keep searching for C++ headers when in C++ mode).  In theory clang
should be able to find all of its own headers now.  If not, the
CPATH or C_INCLUDE_PATH environment variables can be specified to
add a include path.

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

15 years agoAnalysisConsumer.h is gone
Chris Lattner [Wed, 18 Feb 2009 00:20:09 +0000 (00:20 +0000)]
AnalysisConsumer.h is gone

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

15 years agoUpdate several tests to explicitly use BasicConstraintManager as well as to use Range...
Ted Kremenek [Tue, 17 Feb 2009 23:32:18 +0000 (23:32 +0000)]
Update several tests to explicitly use BasicConstraintManager as well as to use RangeConstraintManager with RegionStoreManager.

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

15 years agoccc-analyzer:
Ted Kremenek [Tue, 17 Feb 2009 23:31:05 +0000 (23:31 +0000)]
ccc-analyzer:
- now logs which source files had "ignored attributes".
- disable-free is enabled

scan-build:
- now displays a table of ignored attributes under "Analyzer Failures".

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

15 years agoAdd panic function.
Ted Kremenek [Tue, 17 Feb 2009 23:27:17 +0000 (23:27 +0000)]
Add panic function.

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

15 years agoAvoid getNameAsCString when the decl doesn't have a name.
Mike Stump [Tue, 17 Feb 2009 23:25:52 +0000 (23:25 +0000)]
Avoid getNameAsCString when the decl doesn't have a name.
Build of the parm list with the iterator, not end().

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

15 years agoRename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
Daniel Dunbar [Tue, 17 Feb 2009 23:20:26 +0000 (23:20 +0000)]
Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
with Expr::Evaluate().

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

15 years agogcc spells it "warn_unused_result" (already supported) not "warnunusedresult"
Chris Lattner [Tue, 17 Feb 2009 23:20:10 +0000 (23:20 +0000)]
gcc spells it "warn_unused_result" (already supported) not "warnunusedresult"

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

15 years agoImplement basic parsing and semantic analysis for explicit
Douglas Gregor [Tue, 17 Feb 2009 23:15:12 +0000 (23:15 +0000)]
Implement basic parsing and semantic analysis for explicit
specialization of class templates, e.g.,

  template<typename T> class X;

  template<> class X<int> { /* blah */ };

Each specialization is a different *Decl node (naturally), and can
have different members. We keep track of forward declarations and
definitions as for other class/struct/union types.

This is only the basic framework: we still have to deal with checking
the template headers properly, improving recovery when there are
failures, handling nested name specifiers, etc.

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

15 years agoABITest: Add some checking of values for return types; useful for
Daniel Dunbar [Tue, 17 Feb 2009 23:13:43 +0000 (23:13 +0000)]
ABITest: Add some checking of values for return types; useful for
catching internal consistency problems (esp. w/ reference compiler).

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

15 years agoNote some more things to integrate into ABITest
Daniel Dunbar [Tue, 17 Feb 2009 23:12:22 +0000 (23:12 +0000)]
Note some more things to integrate into ABITest

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

15 years agoEliminate dependency on where test is run from.
Daniel Dunbar [Tue, 17 Feb 2009 22:47:27 +0000 (22:47 +0000)]
Eliminate dependency on where test is run from.

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

15 years agoBasicValueFactory: getMinValue/getMaxValue can be applied to any location type as...
Ted Kremenek [Tue, 17 Feb 2009 22:21:44 +0000 (22:21 +0000)]
BasicValueFactory: getMinValue/getMaxValue can be applied to any location type as specified by Loc::IsLocType().

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

15 years agoAttribute 'iboutlet' can be applied to Objective-C property declarations.
Ted Kremenek [Tue, 17 Feb 2009 22:20:20 +0000 (22:20 +0000)]
Attribute 'iboutlet' can be applied to Objective-C property declarations.

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

15 years agoEek! getDeclAlign sometimes returned alignment in bits.
Daniel Dunbar [Tue, 17 Feb 2009 22:16:19 +0000 (22:16 +0000)]
Eek! getDeclAlign sometimes returned alignment in bits.
 - Renamed to getDeclAlignInBytes since most other query functions
   work in bits.

 - Fun to track down as isIntegerConstantExpr was getting it right,
   but Evaluate() was getting it wrong. Maybe we should assert they
   compute the same thing when they succeed?

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

15 years agoinitial reimplement tgmath.h, written by Howard Hinnant!
Chris Lattner [Tue, 17 Feb 2009 22:14:32 +0000 (22:14 +0000)]
initial reimplement tgmath.h, written by Howard Hinnant!

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

15 years agoSimplified ExtQualType per Chris's feedback.
Fariborz Jahanian [Tue, 17 Feb 2009 21:45:36 +0000 (21:45 +0000)]
Simplified ExtQualType per Chris's feedback.

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

15 years agoRemove one more redundant dyn_cast.
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:46:25 +0000 (20:46 +0000)]
Remove one more redundant dyn_cast.

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

15 years agoMove DeclContext::getParent and getLexicalParent in-line.
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:26:05 +0000 (20:26 +0000)]
Move DeclContext::getParent and getLexicalParent in-line.

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

15 years agoCurrently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:24:53 +0000 (20:24 +0000)]
Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.

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

15 years agoRemove some redundant Decl -> Decl castings.
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:23:54 +0000 (20:23 +0000)]
Remove some redundant Decl -> Decl castings.

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

15 years agoNow that ObjC decls have DeclContexts too, remove an ugly hack from IdentifierResolver.
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:21:51 +0000 (20:21 +0000)]
Now that ObjC decls have DeclContexts too, remove an ugly hack from IdentifierResolver.

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

15 years agoAll Decls have a DeclContext now, hooray! Fans of consistency rejoice.
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:20:37 +0000 (20:20 +0000)]
All Decls have a DeclContext now, hooray! Fans of consistency rejoice.

Pass the DeclContext to ObjCIvarDecls as well.

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

15 years agoAdded support for objc's gc attribute in ExtQualType.
Fariborz Jahanian [Tue, 17 Feb 2009 20:16:45 +0000 (20:16 +0000)]
Added support for objc's gc attribute in ExtQualType.

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

15 years agoConvert tabs to spaces.
Ted Kremenek [Tue, 17 Feb 2009 19:53:58 +0000 (19:53 +0000)]
Convert tabs to spaces.

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

15 years agoBackend: Accept -mcpu and -mattr for use by TargetMachine.
Daniel Dunbar [Tue, 17 Feb 2009 19:47:34 +0000 (19:47 +0000)]
Backend: Accept -mcpu and -mattr for use by TargetMachine.

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

15 years agoEnhance tests to exercise more combinations of using the RangeConstraintManager with...
Ted Kremenek [Tue, 17 Feb 2009 19:29:07 +0000 (19:29 +0000)]
Enhance tests to exercise more combinations of using the RangeConstraintManager with the RegionStoreManager.

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

15 years agoRevised RangeConstraintManager based on several discussions with Ben Laurie and
Ted Kremenek [Tue, 17 Feb 2009 19:28:04 +0000 (19:28 +0000)]
Revised RangeConstraintManager based on several discussions with Ben Laurie and
Zhongxing Xu. The resultant code is less than 1/2 the size of the original.

Key highlights:

- All CouldBeXXX methods have been removed. Checking for feasibility is now just
  done in the AddXXX methods.

- RangeSets now represent "all possible values" explicitly as the range set {
  [min, max] } instead of the empty set. The empty set now represents "no
  feasible values". This change consolidated much of the core algorithm to only
  have one code path instead of alternate paths that considered the empty set to
  represent "all possible falues."

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

15 years agoBasicValueFactory: getMaxValue and getMinValue now also handle 'block' pointers.
Ted Kremenek [Tue, 17 Feb 2009 19:22:05 +0000 (19:22 +0000)]
BasicValueFactory: getMaxValue and getMinValue now also handle 'block' pointers.

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

15 years agoccc: Pass -{MM,MMD,MF,MP,MT} to clang. Error on -{M,MM,MG,MQ} which
Daniel Dunbar [Tue, 17 Feb 2009 19:02:12 +0000 (19:02 +0000)]
ccc: Pass -{MM,MMD,MF,MP,MT} to clang. Error on -{M,MM,MG,MQ} which
clang doesn't support yet.
 - See PR3603.

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

15 years agoProof that attribute __overloadable__ works as well as overloadable
Douglas Gregor [Tue, 17 Feb 2009 18:51:14 +0000 (18:51 +0000)]
Proof that attribute __overloadable__ works as well as overloadable

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

15 years agoChange EmitConstantExpr to allow failure.
Daniel Dunbar [Tue, 17 Feb 2009 18:43:32 +0000 (18:43 +0000)]
Change EmitConstantExpr to allow failure.

IRgen no longer relies on isConstantInitializer, instead we just try
to emit the constant. If that fails then in C we emit an error
unsupported (this occurs when Sema accepted something that it doesn't
know how to fold, and IRgen doesn't know how to emit) and in C++ we
emit a guarded initializer.

This ends up handling a few more cases, because IRgen was actually
able to emit some of the constants Sema accepts but can't Evaluate().
For example, PR3398.

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

15 years ago80-cols.
Daniel Dunbar [Tue, 17 Feb 2009 18:31:04 +0000 (18:31 +0000)]
80-cols.

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

15 years agoRenamed ASQualType to ExtQualType to reflect its more
Fariborz Jahanian [Tue, 17 Feb 2009 18:27:45 +0000 (18:27 +0000)]
Renamed ASQualType to ExtQualType to reflect its more
general use; as for, objc2's gc type attributes. No
change in functionality.

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

15 years agoccc: Recognize -isystem.
Daniel Dunbar [Tue, 17 Feb 2009 18:10:48 +0000 (18:10 +0000)]
ccc: Recognize -isystem.

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

15 years agoccc: Assume gcc will accept piped assembler input when using generic GCC toolchain.
Daniel Dunbar [Tue, 17 Feb 2009 18:10:15 +0000 (18:10 +0000)]
ccc: Assume gcc will accept piped assembler input when using generic GCC toolchain.

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

15 years agoccc: Fix a FIXME.
Daniel Dunbar [Tue, 17 Feb 2009 18:07:00 +0000 (18:07 +0000)]
ccc: Fix a FIXME.

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

15 years agoAdd '_assert' to list of known panic functions.
Ted Kremenek [Tue, 17 Feb 2009 17:48:52 +0000 (17:48 +0000)]
Add '_assert' to list of known panic functions.

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

15 years agoDon't include alloca.h if it doesn't exist.
Ben Laurie [Tue, 17 Feb 2009 17:33:31 +0000 (17:33 +0000)]
Don't include alloca.h if it doesn't exist.

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

15 years agoHandle fatal errors.
Ben Laurie [Tue, 17 Feb 2009 17:32:22 +0000 (17:32 +0000)]
Handle fatal errors.

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

15 years agoBe sure to initialize Name.
Mike Stump [Tue, 17 Feb 2009 17:18:36 +0000 (17:18 +0000)]
Be sure to initialize Name.

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

15 years agoFixup spacing a little.
Mike Stump [Tue, 17 Feb 2009 17:00:02 +0000 (17:00 +0000)]
Fixup spacing a little.

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

15 years agoRemove the error about redefining library functions. It's causing too
Douglas Gregor [Tue, 17 Feb 2009 16:03:01 +0000 (16:03 +0000)]
Remove the error about redefining library functions. It's causing too
much pain when compiling the Linux kernel (PR3592).

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

15 years agoGrammar tweak.
Daniel Dunbar [Tue, 17 Feb 2009 15:49:03 +0000 (15:49 +0000)]
Grammar tweak.

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