Commit Graph

50551 Commits

Author SHA1 Message Date
Evan Cheng a8fd1f2c8e Eliminate some unused variable compile time warnings.
llvm-svn: 59952
2008-11-24 07:09:49 +00:00
Zhongxing Xu 6587c75488 Cleanup code with utility method.
llvm-svn: 59951
2008-11-24 07:02:06 +00:00
Chris Lattner 1e5665e6be Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first.  This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.

llvm-svn: 59948
2008-11-24 06:25:27 +00:00
Chris Lattner f3d3faeca6 Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.

llvm-svn: 59947
2008-11-24 05:29:24 +00:00
Anders Carlsson a7c5eb72a0 Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.
llvm-svn: 59946
2008-11-24 05:23:59 +00:00
Bill Wendling 411eaa5c57 Test add-with-overflow with fast ISel.
llvm-svn: 59945
2008-11-24 05:23:38 +00:00
Anders Carlsson 4fb8a9c6b6 __builtin_constant_p takes an argument that can have any type.
llvm-svn: 59944
2008-11-24 05:23:12 +00:00
Zhongxing Xu f556cd6cb9 Strings are NULL terminated. So the region size should plus one.
llvm-svn: 59943
2008-11-24 05:16:01 +00:00
Anders Carlsson 87da2b5dce Forgot the newline :)
llvm-svn: 59942
2008-11-24 05:13:45 +00:00
Anders Carlsson 3abcb58a35 Add test case for bug that's been fixed.
llvm-svn: 59941
2008-11-24 05:11:21 +00:00
Nick Lewycky d59572cb22 Seriously strengthen the guarantee offered by noalias on a function's return
value. It must now be as if the pointer were allocated and has not escaped to
the caller. Thanks to Dan Gohman for pointing out the error in the original
and helping devise this definition.

llvm-svn: 59940
2008-11-24 05:00:44 +00:00
Anders Carlsson a42ee44aab The address of a variable is only constant if the variable has global storage.
llvm-svn: 59939
2008-11-24 04:41:22 +00:00
Anders Carlsson 4c76e93507 Fix bug in the constant evaluator. Fixes PR3115.
llvm-svn: 59938
2008-11-24 04:21:33 +00:00
Chris Lattner 1cbaacc4a0 Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.

llvm-svn: 59937
2008-11-24 04:00:27 +00:00
Chris Lattner 86d7d91366 Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.

llvm-svn: 59936
2008-11-24 03:54:41 +00:00
Chris Lattner 9b1f2792ba simplify this code.
llvm-svn: 59935
2008-11-24 03:52:59 +00:00
Nick Lewycky f5ffcbcd0b Extend the 'noalias' attribute to function return values. This is intended to
indicate functions that allocate, such as operator new, or list::insert. The
actual definition is slightly less strict (for now).

No changes to the bitcode reader/writer, asm printer or verifier were needed.

llvm-svn: 59934
2008-11-24 03:41:24 +00:00
Chris Lattner e4b95698df Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector 
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.

llvm-svn: 59933
2008-11-24 03:33:13 +00:00
Zhongxing Xu 8361d4c51b Add a comment about the signedness.
llvm-svn: 59932
2008-11-24 02:30:48 +00:00
Zhongxing Xu bf900755d0 Add test case for out-of-bound memory access checking.
llvm-svn: 59931
2008-11-24 02:19:49 +00:00
Zhongxing Xu a61731dd0d Add getSize() support for StringRegion.
llvm-svn: 59930
2008-11-24 02:18:56 +00:00
Mon P Wang 35a70ec131 Added missing description for -disable-mmx option.
llvm-svn: 59929
2008-11-24 02:10:43 +00:00
Bill Wendling 2278f8f5e1 Add support for llvm.uadd.with.overflow.
llvm-svn: 59926
2008-11-24 01:38:29 +00:00
Chris Lattner 4fc69799f5 Rewrite FindDiagnostics to be more strict about the formatting of the
expected-foo strings.  Now the only allowed characters between 
expected-error and {{  is whitespace.

llvm-svn: 59925
2008-11-24 01:28:17 +00:00
Chris Lattner f3ab014308 clean up -verify mode output. If the expected-error string is
mangled, report it using the diagnostics machinery instead of printf.

llvm-svn: 59924
2008-11-23 23:38:26 +00:00
Chris Lattner 12f7c5a36a convert some more warnings to NOTEs.
llvm-svn: 59923
2008-11-23 23:26:13 +00:00
Chris Lattner d068503565 remove warn_previous_declaration
llvm-svn: 59922
2008-11-23 23:20:13 +00:00
Chris Lattner 03c4041cb5 make the 'to match this' diagnostic a note.
llvm-svn: 59921
2008-11-23 23:17:07 +00:00
Chris Lattner 0369c57ac6 Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.

llvm-svn: 59920
2008-11-23 23:12:31 +00:00
Chris Lattner e6447ef989 make some objc redefinition warnings more consistent: call definitions
"definitions", not declarations.  Point out the location of the 
original definition.

llvm-svn: 59919
2008-11-23 22:46:27 +00:00
Chris Lattner 88dcd2a1ab Tweak duplicate category diagnostic to work like the duplicate protocol diagnostic.
Also, point out where the previous decl was.  This unxfails two tests.

llvm-svn: 59918
2008-11-23 22:38:38 +00:00
Chris Lattner e3d20d9545 Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them.  This has a bunch of follow-on 
effects and requires tweaking to a whole lot of code.  This causes
a regression in two tests (xfailed) by causing it to emit things like:

  Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

  Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency.  This is good, but I was planning to do this
as an independent patch.  There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.

llvm-svn: 59917
2008-11-23 21:45:46 +00:00
Chris Lattner f7e69d5a77 add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString().  This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.

llvm-svn: 59916
2008-11-23 20:28:15 +00:00
Chris Lattner d125393d24 inserting a qualtype adds quotes implicitly
llvm-svn: 59915
2008-11-23 20:27:13 +00:00
Scott Michel 037fe56069 Roll back rev 59890, since Chris says this can never happen.
llvm-svn: 59914
2008-11-23 19:22:48 +00:00
Duncan Sands 8d6e2e13d5 Rename SetCCResultContents to BooleanContents. In
practice these booleans are mostly produced by SetCC,
however the concept is more general.

llvm-svn: 59911
2008-11-23 15:47:28 +00:00
Chris Lattner 63ecc509e3 Genericize the qualtype formating callback to support any diag argument.
No functionality change.

llvm-svn: 59908
2008-11-23 09:21:17 +00:00
Chris Lattner 6a2ed6f6dc Add support for sending QualType's directly into diags and convert two
diags over to use this.  QualTypes implicitly print single quotes around 
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.

llvm-svn: 59907
2008-11-23 09:13:29 +00:00
Chris Lattner 4e2e9f1a5d other minor edits.
llvm-svn: 59906
2008-11-23 08:32:53 +00:00
Chris Lattner c788a8bdec minor cleanups.
llvm-svn: 59905
2008-11-23 08:16:56 +00:00
Chris Lattner ddd7581c73 Make JIT::runFunction handle functions with non-C calling conventions.
llvm-svn: 59904
2008-11-23 08:00:11 +00:00
Zhongxing Xu aa86cff14c Add out-of-bound memory access warning report code.
llvm-svn: 59903
2008-11-23 05:52:28 +00:00
Zhongxing Xu 60d6cd1940 Improve test case.
llvm-svn: 59902
2008-11-23 05:50:21 +00:00
Mon P Wang 0aa8f0a549 Added -disable-mmx using a patch from Preston Gurd.
llvm-svn: 59901
2008-11-23 04:37:22 +00:00
Mon P Wang 2967480f54 Added check to avoid generating extract subvector beyond the end of the vector when normalizing vector shuffles.
llvm-svn: 59900
2008-11-23 04:35:05 +00:00
Zhongxing Xu cdf25053ee Clean up code by using utility methods.
llvm-svn: 59899
2008-11-23 04:30:35 +00:00
Chris Lattner 1fea89ccb1 finish up the diagnostics documentation. We don't
support QualType and DeclarationName yet, so some of it
is lies, however, this will be fixed shortly.

llvm-svn: 59896
2008-11-23 00:42:53 +00:00
Chris Lattner 80bec16f14 more updates
llvm-svn: 59895
2008-11-23 00:28:33 +00:00
Misha Brukman 50de2b2365 Fixed named anchor for llvm.stackprotector intrinsic.
llvm-svn: 59893
2008-11-22 23:55:29 +00:00
Chris Lattner cc6147cd3b finish documentation of %select.
llvm-svn: 59892
2008-11-22 23:50:47 +00:00