Commit Graph

54584 Commits

Author SHA1 Message Date
Owen Anderson ad4254935f Add a test for r61358, which I forgot to add way back when.
llvm-svn: 64904
2009-02-18 07:50:22 +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
Douglas Gregor 94349fd8cb 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).

llvm-svn: 64902
2009-02-18 07:07:28 +00:00
Chris Lattner 112c2a914f teach child iterators to walk into the child string of an ObjCStringLiteral,
so it shows up in -ast-dump.

llvm-svn: 64901
2009-02-18 06:53:08 +00:00
Chris Lattner 163ffd22c3 fix the ownership issues and location tracking in
Sema::ParseObjCStringLiteral.

llvm-svn: 64900
2009-02-18 06:48:40 +00:00
Chris Lattner c16fff7fb2 add iterators for string token locations.
llvm-svn: 64899
2009-02-18 06:48:23 +00:00
Chris Lattner f83b5afb7b privatize all of the string literal memory allocation/creation
stuff behind a private static function.

llvm-svn: 64898
2009-02-18 06:40:38 +00:00
Douglas Gregor b2809a0a1b 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.

llvm-svn: 64897
2009-02-18 06:34:51 +00:00
Chris Lattner d7670d9a96 add some comments describing what is happening here.
llvm-svn: 64896
2009-02-18 06:13:04 +00:00
Chris Lattner fffd6a7e38 simplify the code used to compute the type of an objc string. This makes
it faster in the common case when NSConstantString is around.

llvm-svn: 64895
2009-02-18 06:06:56 +00:00
Chris Lattner 6436fb6acb rename CheckBuiltinCFStringArgument -> CheckObjCString
llvm-svn: 64894
2009-02-18 06:01:06 +00:00
Chris Lattner d3b5d5d1df simplify some code.
llvm-svn: 64893
2009-02-18 05:56:09 +00:00
Chris Lattner 630970ddb8 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.

llvm-svn: 64892
2009-02-18 05:49:11 +00:00
Dan Gohman 2af1f85f1f Factor out the code to add a MachineOperand to a MachineInstrBuilder.
llvm-svn: 64891
2009-02-18 05:45:50 +00:00
Ted Kremenek c2c0bdb880 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

llvm-svn: 64890
2009-02-18 05:22:01 +00:00
Fariborz Jahanian e27e934d45 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.

llvm-svn: 64889
2009-02-18 05:09:49 +00:00
Dan Gohman 38a9631d5f Eliminate several more unnecessary intptr_t casts.
llvm-svn: 64888
2009-02-18 05:09:16 +00:00
Daniel Dunbar 5805c98526 ccc: Forward -ftime-report to clang.
llvm-svn: 64887
2009-02-18 05:01:43 +00:00
Chris Lattner c96e0c4399 pass -verify in exprs.m, merge const-id.m into message.m
llvm-svn: 64886
2009-02-18 04:41:38 +00:00
Chris Lattner 2c4866057d fix rdar://6597252: two exactly identical pointer types are always
compatible, even if they are weird implicit objc pointer types like
Class.

llvm-svn: 64885
2009-02-18 04:38:20 +00:00
Chris Lattner 432cff5bf4 rename some variables, no functionality change.
llvm-svn: 64884
2009-02-18 04:28:32 +00:00
Dan Gohman b694533a54 Change the argument type in this test to something less convoluted,
since it isn't actually used. 

llvm-svn: 64883
2009-02-18 04:25:04 +00:00
Chris Lattner f0c2d58acc 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

llvm-svn: 64882
2009-02-18 04:02:00 +00:00
Ted Kremenek 48d1645179 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.

llvm-svn: 64881
2009-02-18 03:48:14 +00:00
Daniel Dunbar 617e89231d 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
--

llvm-svn: 64880
2009-02-18 03:44:19 +00:00
Ted Kremenek a16c98b97d Update checker build.
llvm-svn: 64879
2009-02-18 03:09:29 +00:00
Evan Cheng a40d5e14ab GV with null value initializer shouldn't go to BSS if it's meant for a mergeable strings section. Currently it only checks for Darwin. Someone else please check if it should apply to other targets as well.
llvm-svn: 64877
2009-02-18 02:19:52 +00:00
Ted Kremenek d84fff6524 retain/release checker: Record the summary used to generate a given node.
llvm-svn: 64876
2009-02-18 02:00:25 +00:00
Chris Lattner f53a9612d1 add a bunch of timers for -E and other modes. This requires
llvm r64874 or later.

llvm-svn: 64875
2009-02-18 01:51:21 +00:00
Chris Lattner 198d1f4496 allow TimeRegion to take a potentially-null pointer to a
timer for clang.

llvm-svn: 64874
2009-02-18 01:48:17 +00:00
Chris Lattner 263d64cd90 teach -ftime-report to time the code generator and -emit-llvm times.
llvm-svn: 64873
2009-02-18 01:37:30 +00:00
Chris Lattner deffa13399 move llvm backend specific #includes into Backend.cpp instead of Clang.cpp
llvm-svn: 64872
2009-02-18 01:23:44 +00:00
Chris Lattner baba6fc1c4 indentation and formatting
llvm-svn: 64871
2009-02-18 01:20:05 +00:00
Chris Lattner 5df3d46a9b clang will hopefully never support ratfor.
llvm-svn: 64870
2009-02-18 01:17:01 +00:00
Chris Lattner a1580a603a wire up a minimal -ftime-report, which prints the optimizer/codegen
times.  Daniel, plz add driver support.

llvm-svn: 64869
2009-02-18 01:12:43 +00:00
Eli Friedman 61d484ea8b 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.

llvm-svn: 64868
2009-02-18 01:02:14 +00:00
Eli Friedman 1e3a02f090 Fix test on platforms where size_t != unsigned long.
llvm-svn: 64867
2009-02-18 00:52:29 +00:00
Dan Gohman 8212ebb5cf Fix a corner case in the new indvars promotion logic: if there
are multiple IV's in a loop, some of them may under go signed
or unsigned wrapping even if the IV that's used in the loop
exit condition doesn't. Restrict sign-extension-elimination
and zero-extension-elimination to only those that operate on
the original loop-controlling IV.

llvm-svn: 64866
2009-02-18 00:52:00 +00:00
Daniel Dunbar 4750e63486 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.

llvm-svn: 64865
2009-02-18 00:47:45 +00:00
Daniel Dunbar 62347a0c55 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.

llvm-svn: 64864
2009-02-18 00:32:53 +00:00
Daniel Dunbar 1acc629bfd 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.

llvm-svn: 64863
2009-02-18 00:29:14 +00:00
Chris Lattner 970f245439 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.

llvm-svn: 64862
2009-02-18 00:25:15 +00:00
Chris Lattner 7b4b1d12b1 AnalysisConsumer.h is gone
llvm-svn: 64860
2009-02-18 00:20:09 +00:00
Dan Gohman d0b1fbd983 Fix a typo in a comment.
llvm-svn: 64859
2009-02-18 00:08:39 +00:00
Ted Kremenek 51189468ea Update several tests to explicitly use BasicConstraintManager as well as to use RangeConstraintManager with RegionStoreManager.
llvm-svn: 64854
2009-02-17 23:32:18 +00:00
Ted Kremenek 13ed6f1ebe 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".

llvm-svn: 64853
2009-02-17 23:31:05 +00:00
Ted Kremenek fa1840b25e Add panic function.
llvm-svn: 64852
2009-02-17 23:27:17 +00:00
Mike Stump eecd39f2d7 Avoid getNameAsCString when the decl doesn't have a name.
Build of the parm list with the iterator, not end().

llvm-svn: 64851
2009-02-17 23:25:52 +00:00
Daniel Dunbar 491812cd76 Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
with Expr::Evaluate().

llvm-svn: 64850
2009-02-17 23:20:26 +00:00
Chris Lattner 976fdefe2f gcc spells it "warn_unused_result" (already supported) not "warnunusedresult"
llvm-svn: 64849
2009-02-17 23:20:10 +00:00