Commit Graph

29498 Commits

Author SHA1 Message Date
Dylan Noblesmith 92c07c27be refactor flags for TokenKinds.def
Make KEYALL a combination of all other flags instead
of its own separate flag. Also rewrite the enum
definitions in hex instead of decimal.

llvm-svn: 129213
2011-04-09 13:34:05 +00:00
Dylan Noblesmith 70e73a3d60 refactor -ccc-gcc-name code
Put the logic for deciding the default name for gcc/g++
in the only place that actually cares about it.

This also pushes an ifdef out of the generic driver code
to a little further down, when the target is actually known.
Hopefully it can be changed into just a runtime check
in the future.

llvm-svn: 129212
2011-04-09 13:31:59 +00:00
Eli Friedman c5b20b5283 PR8369: make __attribute((regparm(0))) work correctly. Original patch by
pageexec@freemail.hu, tweaks by me.

llvm-svn: 129206
2011-04-09 08:18:08 +00:00
Chandler Carruth 66a7b04767 Clean up the bool conversion warning. Group it with other conversion
warnings, and make its text appropriate for constant bool expressions
other than 'false'. This should finish off PR9612.

llvm-svn: 129205
2011-04-09 07:48:17 +00:00
Chandler Carruth ffab873ed5 Add support for warning on general null pointer expressions of boolean
type rather than just the literal 'false'. This begins fixing PR9612,
but the message is now wrong. WIP, the cleanup of the messaging is next.

llvm-svn: 129204
2011-04-09 07:32:05 +00:00
Chris Lattner e4ec5abf1b fix indentation
llvm-svn: 129202
2011-04-09 07:11:53 +00:00
Chris Lattner 5045cf1a61 accept -x objc-cpp-output as an alias for -x objective-c-cpp-output,
per PR9577

llvm-svn: 129201
2011-04-09 07:09:31 +00:00
Chris Lattner 9cb59fa834 add a __sync_swap builtin to fill out the rest of the __sync builtins.
Patch by Dave Zarzycki!

llvm-svn: 129189
2011-04-09 03:57:26 +00:00
Ken Dyck df01628e08 Convert the PointerWidthInBytes variable in EmitMemberPointer() to CharUnits
to eliminate a divide-by-8. No change in functionality intended.

llvm-svn: 129180
2011-04-09 01:30:02 +00:00
Ken Dyck 499e93d7ee Eliminate a divide-by-8 in BuildVMIClassTypeInfo() by using CharUnits for
the base offset. No change in functionality intended.

llvm-svn: 129179
2011-04-09 01:09:56 +00:00
Eric Christopher 6417e35568 Remove a pair of unused diagnostic messages.
llvm-svn: 129178
2011-04-09 00:53:03 +00:00
Nick Lewycky d85ae78c48 Apply explicit braces to avoid ambiguous 'else' [-Wparentheses]
llvm-svn: 129176
2011-04-09 00:25:15 +00:00
Eric Christopher 7f36a79ee9 Eat the UTF-8 BOM at the beginning of a file since it's ignored anyhow.
Nom Nom Nom.

Patch by Anton Korobeynikov!

llvm-svn: 129174
2011-04-09 00:01:04 +00:00
Chris Lattner 143ed0fc72 complete documentation of flags, patch by nobled
llvm-svn: 129173
2011-04-08 23:54:05 +00:00
Fariborz Jahanian eae9c0e3df Fixes a rewrting bug of a property-dot syntax expression inside
a block. First part of // rdar://9254348

llvm-svn: 129171
2011-04-08 23:48:29 +00:00
Argyrios Kyrtzidis 5ae6b64e7f Properly traverse a ObjCMethodDecl in RecursiveASTVisitor.
llvm-svn: 129169
2011-04-08 23:35:25 +00:00
Chris Lattner e094ee0a34 typo fix + expand
llvm-svn: 129167
2011-04-08 22:58:43 +00:00
Ted Kremenek f603f3afbd Start overhauling static analyzer support for C++ constructors. The inlining support isn't complete, and needs
to be reworked to model CallEnter/CallExit (just like all other calls).  For now, treat constructors mostly
like other function calls, making the analysis of C++ code just a little more useful.

llvm-svn: 129166
2011-04-08 22:42:35 +00:00
Evan Cheng 298de937e7 Minor format fix.
llvm-svn: 129164
2011-04-08 22:34:21 +00:00
Evan Cheng fbbacc9241 Document -ftrap-function= option
llvm-svn: 129162
2011-04-08 22:18:01 +00:00
Devang Patel 0b37e79891 Do not use zero as an upper bound for unbounded array because upper bound zero also indicates one element array.
llvm-svn: 129157
2011-04-08 21:56:52 +00:00
Evan Cheng 04c9429f34 Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options.
llvm-svn: 129153
2011-04-08 21:37:45 +00:00
Evan Cheng 77cdce9458 Add -mtrap_function=<> option. rdar://9257465
llvm-svn: 129145
2011-04-08 18:47:41 +00:00
John Wiegley 0129629fd3 Use ExprResult& instead of Expr *& in Sema
This patch authored by Eric Niebler.

Many methods on the Sema class (e.g. ConvertPropertyForRValue) take Expr
pointers as in/out parameters (Expr *&).  This is especially true for the
routines that apply implicit conversions to nodes in-place.  This design is
workable only as long as those conversions cannot fail.  If they are allowed
to fail, they need a way to report their failures.  The typical way of doing
this in clang is to use an ExprResult, which has an extra bit to signal a
valid/invalid state.  Returning ExprResult is de riguour elsewhere in the Sema
interface.  We suggest changing the Expr *& parameters in the Sema interface
to ExprResult &.  This increases interface consistency and maintainability.

This interface change is important for work supporting MS-style C++
properties.  For reasons explained here
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013180.html>,
seemingly trivial operations like rvalue/lvalue conversions that formerly
could not fail now can.  (The reason is that given the semantics of the
feature, getter/setter method lookup cannot happen until the point of use, at
which point it may be found that the method does not exist, or it may have the
wrong type, or overload resolution may fail, or it may be inaccessible.)

llvm-svn: 129143
2011-04-08 18:41:53 +00:00
Fariborz Jahanian 4806ff8af9 Warn for any kind of initialization if initializer does not
implement lhs's protocols. // rdar://9091389.
 

llvm-svn: 129142
2011-04-08 18:25:29 +00:00
Chris Lattner 9242b33de7 fix a typo, patch by PaX team.
llvm-svn: 129141
2011-04-08 18:06:54 +00:00
Chandler Carruth 42983aef34 Switch 'is possibly uninitialized' to 'may be uninitialized' based on
Chris's feedback.

llvm-svn: 129127
2011-04-08 06:47:15 +00:00
Chandler Carruth 278f89732f Now that the analyzer is distinguishing between uninitialized uses that
definitely have a path leading to them, and possibly have a path leading
to them; reflect that distinction in the warning text emitted.

llvm-svn: 129126
2011-04-08 06:33:38 +00:00
Daniel Dunbar f28c2ffb84 Driver: Don't attempt to forward some Clang-only options to cc1.
llvm-svn: 129108
2011-04-07 20:41:03 +00:00
Daniel Dunbar 44d9ef78ca Frontend/CC_LOG_DIAGNOSTICS: Fix thinko and open diag log in append mode.
llvm-svn: 129103
2011-04-07 20:19:21 +00:00
Ted Kremenek 97c393807b Teach -Wuninitialized to not warn about variables declared in C++ catch statements.
llvm-svn: 129102
2011-04-07 20:02:56 +00:00
Daniel Dunbar 2f8d10e8d7 Fronted/CC_LOG_DIAGNOSTICS: Add test case.
llvm-svn: 129097
2011-04-07 19:05:06 +00:00
Daniel Dunbar 7b83306d20 Fronted/CC_LOG_DIAGNOSTICS: Wire up dwarf-debug-flags support.
llvm-svn: 129095
2011-04-07 18:59:02 +00:00
Daniel Dunbar c032503274 Fronted/CC_LOG_DIAGNOSTICS: Output main file name, and add support for
outputting dwarf-debug-flags.

llvm-svn: 129094
2011-04-07 18:51:54 +00:00
Daniel Dunbar 719393a56b Fronted/CC_LOG_DIAGNOSTICS: Tweak output form to be plist chunks, and don't
output missing data.

llvm-svn: 129093
2011-04-07 18:44:15 +00:00
Daniel Dunbar 4f3a28b387 Frontend: Continue flushing out LogDiagnosticPrinter.
llvm-svn: 129091
2011-04-07 18:37:34 +00:00
Daniel Dunbar 2083c32f7a Frontend: Sketch a LogDiagnosticPrinter object, and wire CC_LOG_DIAGNOSTICS to
it.

llvm-svn: 129089
2011-04-07 18:31:10 +00:00
Daniel Dunbar 4efbb07527 ChainedDiagnosticClient: Fix a bug where chained diagnostic clients wouldn't
accurately track warning/error counts.

llvm-svn: 129088
2011-04-07 18:24:12 +00:00
Daniel Dunbar 6b58486466 Frontend: Sketch support for -diagnostic-log-file, which still doesn't do anything.
llvm-svn: 129086
2011-04-07 18:11:14 +00:00
Argyrios Kyrtzidis 2f8165b685 Enhance the Rewriter.
-Allow removing a line completely if it ends up empty
-Provide more control on what should be removed.

llvm-svn: 129085
2011-04-07 18:10:12 +00:00
Argyrios Kyrtzidis 3fd80c1f1a Add FullSourceLoc::BeforeThanCompare. a comparison function class, useful for sorting FullSourceLocs.
llvm-svn: 129084
2011-04-07 18:10:07 +00:00
Daniel Dunbar 529c03bc1e Driver: Sketch driver support for a CC_LOG_DIAGNOSTICS options, similar to the
existing CC_PRINT_OPTIONS and CC_PRINT_HEADERS, which can be used to
transparently capture the compiler diagnostics from a build.

llvm-svn: 129082
2011-04-07 18:01:20 +00:00
Ken Dyck bb4e977218 [Reapply r128776, modified so that it does not break debug info.]
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.

llvm-svn: 129072
2011-04-07 12:37:09 +00:00
Abramo Bagnara 7ccce98861 In C++ the argument of logical not should always be bool. Added missing implicit cast for scalars.
llvm-svn: 129066
2011-04-07 09:26:19 +00:00
John McCall 319963434c Basic, untested implementation for an "unknown any" type requested by LLDB.
The idea is that you can create a VarDecl with an unknown type, or a
FunctionDecl with an unknown return type, and it will still be valid to
access that object as long as you explicitly cast it at every use.  I'm
still going back and forth about how I want to test this effectively, but
I wanted to go ahead and provide a skeletal implementation for the LLDB
folks' benefit and because it also improves some diagnostic goodness for
placeholder expressions.

llvm-svn: 129065
2011-04-07 08:22:57 +00:00
Ken Dyck 3a09bc5ab0 [Reapply r128773. This is not the source of the issues Devang was seeing
with debug info.]

Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

llvm-svn: 129048
2011-04-07 01:22:42 +00:00
Ken Dyck 25c82240e9 [Reapply r128771. It wasn't the source of the issues Devang saw with debug
info.]

Use CharUnits for the offset type in the ClassNamesAndOffsets map in
dumpLayout(). No change in functionality intended.

llvm-svn: 129046
2011-04-07 00:59:42 +00:00
Ken Dyck 42a9d29c2c Reapply r128770. It's not the cause of the issues Devang saw with debug info.
Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
change in functionality intended.

llvm-svn: 129043
2011-04-07 00:55:01 +00:00
John McCall 26d365e149 I can't figure out any reasonable way to make this test non-host-dependent,
so I'm killing it.

llvm-svn: 129026
2011-04-06 20:46:42 +00:00
Anders Carlsson 6b06e18c70 Wide Pascal strings should be of type wchar_t[] and not unsigned char[].
llvm-svn: 129017
2011-04-06 18:42:48 +00:00