]> granicus.if.org Git - clang/log
clang
13 years agoPR9580: Handle vectors correctly in ScalarExprEmitter::EmitRem.
Eli Friedman [Sun, 10 Apr 2011 04:44:11 +0000 (04:44 +0000)]
PR9580: Handle vectors correctly in ScalarExprEmitter::EmitRem.

While I'm here, FileCheck-ize the ext-vector test, so we actually check
what it is generating.

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

13 years agoMSVC accepts that default parameters be redefined for member functions
Francois Pichet [Sun, 10 Apr 2011 03:03:52 +0000 (03:03 +0000)]
MSVC accepts that default parameters be redefined for member functions
of template class. The new value is ignored.

This fixes 1 error when parsing MSVC 2010 header files with clang.

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

13 years agolibclang output name is now libclang. This solves a name collision
Oscar Fuentes [Sun, 10 Apr 2011 02:29:27 +0000 (02:29 +0000)]
libclang output name is now libclang. This solves a name collision
when building with Visual Studio. `clang.dll' and `clang.exe' would
have the same `clang.ilk' and `clang.pdb'. On a serial build those
files would be overwritten as clang.exe/clang.dll are created. On a
parallel build there is a risk of both files being written at the same
time. On that case VS fails.

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

13 years agoFix a bunch of major problems with __unknown_anytype and properly test
John McCall [Sat, 9 Apr 2011 22:50:59 +0000 (22:50 +0000)]
Fix a bunch of major problems with __unknown_anytype and properly test
for them.  The only major missing feature is references.

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

13 years agoMake sure we or together the overflow flags of the multiply and add, so the
Eli Friedman [Sat, 9 Apr 2011 19:54:33 +0000 (19:54 +0000)]
Make sure we or together the overflow flags of the multiply and add, so the
check is triggered appropriately.  Reported on cfe-dev.

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

13 years agostrcat() and strncat() model additions to CStringChecker.
Lenny Maiorani [Sat, 9 Apr 2011 15:12:58 +0000 (15:12 +0000)]
strcat() and strncat() model additions to CStringChecker.

Validates inputs are not NULL, checks for overlapping strings, concatenates the strings checking for buffer overflow, sets the length of the destination string to the sum of the s1 length and the s2 length, binds the return value to the s1 value.

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

13 years agorefactor flags for TokenKinds.def
Dylan Noblesmith [Sat, 9 Apr 2011 13:34:05 +0000 (13:34 +0000)]
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.

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

13 years agorefactor -ccc-gcc-name code
Dylan Noblesmith [Sat, 9 Apr 2011 13:31:59 +0000 (13:31 +0000)]
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.

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

13 years agoPR8369: make __attribute((regparm(0))) work correctly. Original patch by
Eli Friedman [Sat, 9 Apr 2011 08:18:08 +0000 (08:18 +0000)]
PR8369: make __attribute((regparm(0))) work correctly.  Original patch by
pageexec@freemail.hu, tweaks by me.

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

13 years agoClean up the bool conversion warning. Group it with other conversion
Chandler Carruth [Sat, 9 Apr 2011 07:48:17 +0000 (07:48 +0000)]
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.

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

13 years agoAdd support for warning on general null pointer expressions of boolean
Chandler Carruth [Sat, 9 Apr 2011 07:32:05 +0000 (07:32 +0000)]
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.

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

13 years agofix indentation
Chris Lattner [Sat, 9 Apr 2011 07:11:53 +0000 (07:11 +0000)]
fix indentation

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

13 years agoaccept -x objc-cpp-output as an alias for -x objective-c-cpp-output,
Chris Lattner [Sat, 9 Apr 2011 07:09:31 +0000 (07:09 +0000)]
accept -x objc-cpp-output as an alias for -x objective-c-cpp-output,
per PR9577

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

13 years agoadd a __sync_swap builtin to fill out the rest of the __sync builtins.
Chris Lattner [Sat, 9 Apr 2011 03:57:26 +0000 (03:57 +0000)]
add a __sync_swap builtin to fill out the rest of the __sync builtins.
Patch by Dave Zarzycki!

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

13 years agoConvert the PointerWidthInBytes variable in EmitMemberPointer() to CharUnits
Ken Dyck [Sat, 9 Apr 2011 01:30:02 +0000 (01:30 +0000)]
Convert the PointerWidthInBytes variable in EmitMemberPointer() to CharUnits
to eliminate a divide-by-8. No change in functionality intended.

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

13 years agoEliminate a divide-by-8 in BuildVMIClassTypeInfo() by using CharUnits for
Ken Dyck [Sat, 9 Apr 2011 01:09:56 +0000 (01:09 +0000)]
Eliminate a divide-by-8 in BuildVMIClassTypeInfo() by using CharUnits for
the base offset. No change in functionality intended.

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

13 years agoRemove a pair of unused diagnostic messages.
Eric Christopher [Sat, 9 Apr 2011 00:53:03 +0000 (00:53 +0000)]
Remove a pair of unused diagnostic messages.

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

13 years agoApply explicit braces to avoid ambiguous 'else' [-Wparentheses]
Nick Lewycky [Sat, 9 Apr 2011 00:25:15 +0000 (00:25 +0000)]
Apply explicit braces to avoid ambiguous 'else' [-Wparentheses]

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

13 years agoEat the UTF-8 BOM at the beginning of a file since it's ignored anyhow.
Eric Christopher [Sat, 9 Apr 2011 00:01:04 +0000 (00:01 +0000)]
Eat the UTF-8 BOM at the beginning of a file since it's ignored anyhow.

Nom Nom Nom.

Patch by Anton Korobeynikov!

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

13 years agocomplete documentation of flags, patch by nobled
Chris Lattner [Fri, 8 Apr 2011 23:54:05 +0000 (23:54 +0000)]
complete documentation of flags, patch by nobled

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

13 years agoFixes a rewrting bug of a property-dot syntax expression inside
Fariborz Jahanian [Fri, 8 Apr 2011 23:48:29 +0000 (23:48 +0000)]
Fixes a rewrting bug of a property-dot syntax expression inside
a block. First part of // rdar://9254348

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

13 years agoProperly traverse a ObjCMethodDecl in RecursiveASTVisitor.
Argyrios Kyrtzidis [Fri, 8 Apr 2011 23:35:25 +0000 (23:35 +0000)]
Properly traverse a ObjCMethodDecl in RecursiveASTVisitor.

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

13 years agotypo fix + expand
Chris Lattner [Fri, 8 Apr 2011 22:58:43 +0000 (22:58 +0000)]
typo fix + expand

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

13 years agoStart overhauling static analyzer support for C++ constructors. The inlining support...
Ted Kremenek [Fri, 8 Apr 2011 22:42:35 +0000 (22:42 +0000)]
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.

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

13 years agoMinor format fix.
Evan Cheng [Fri, 8 Apr 2011 22:34:21 +0000 (22:34 +0000)]
Minor format fix.

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

13 years agoDocument -ftrap-function= option
Evan Cheng [Fri, 8 Apr 2011 22:18:01 +0000 (22:18 +0000)]
Document -ftrap-function= option

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

13 years agoDo not use zero as an upper bound for unbounded array because upper bound zero also...
Devang Patel [Fri, 8 Apr 2011 21:56:52 +0000 (21:56 +0000)]
Do not use zero as an upper bound for unbounded array because upper bound zero also indicates one element array.

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

13 years agoRename -mtrap_function= to -ftrap_function= since it's now a target neutral options.
Evan Cheng [Fri, 8 Apr 2011 21:37:45 +0000 (21:37 +0000)]
Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options.

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

13 years agoAdd -mtrap_function=<> option. rdar://9257465
Evan Cheng [Fri, 8 Apr 2011 18:47:41 +0000 (18:47 +0000)]
Add -mtrap_function=<> option. rdar://9257465

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

13 years agoUse ExprResult& instead of Expr *& in Sema
John Wiegley [Fri, 8 Apr 2011 18:41:53 +0000 (18:41 +0000)]
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.)

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

13 years agoWarn for any kind of initialization if initializer does not
Fariborz Jahanian [Fri, 8 Apr 2011 18:25:29 +0000 (18:25 +0000)]
Warn for any kind of initialization if initializer does not
implement lhs's protocols. // rdar://9091389.

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

13 years agofix a typo, patch by PaX team.
Chris Lattner [Fri, 8 Apr 2011 18:06:54 +0000 (18:06 +0000)]
fix a typo, patch by PaX team.

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

13 years agoSwitch 'is possibly uninitialized' to 'may be uninitialized' based on
Chandler Carruth [Fri, 8 Apr 2011 06:47:15 +0000 (06:47 +0000)]
Switch 'is possibly uninitialized' to 'may be uninitialized' based on
Chris's feedback.

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

13 years agoNow that the analyzer is distinguishing between uninitialized uses that
Chandler Carruth [Fri, 8 Apr 2011 06:33:38 +0000 (06:33 +0000)]
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.

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

13 years agoDriver: Don't attempt to forward some Clang-only options to cc1.
Daniel Dunbar [Thu, 7 Apr 2011 20:41:03 +0000 (20:41 +0000)]
Driver: Don't attempt to forward some Clang-only options to cc1.

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

13 years agoFrontend/CC_LOG_DIAGNOSTICS: Fix thinko and open diag log in append mode.
Daniel Dunbar [Thu, 7 Apr 2011 20:19:21 +0000 (20:19 +0000)]
Frontend/CC_LOG_DIAGNOSTICS: Fix thinko and open diag log in append mode.

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

13 years agoTeach -Wuninitialized to not warn about variables declared in C++ catch statements.
Ted Kremenek [Thu, 7 Apr 2011 20:02:56 +0000 (20:02 +0000)]
Teach -Wuninitialized to not warn about variables declared in C++ catch statements.

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

13 years agoFronted/CC_LOG_DIAGNOSTICS: Add test case.
Daniel Dunbar [Thu, 7 Apr 2011 19:05:06 +0000 (19:05 +0000)]
Fronted/CC_LOG_DIAGNOSTICS: Add test case.

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

13 years agoFronted/CC_LOG_DIAGNOSTICS: Wire up dwarf-debug-flags support.
Daniel Dunbar [Thu, 7 Apr 2011 18:59:02 +0000 (18:59 +0000)]
Fronted/CC_LOG_DIAGNOSTICS: Wire up dwarf-debug-flags support.

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

13 years agoFronted/CC_LOG_DIAGNOSTICS: Output main file name, and add support for
Daniel Dunbar [Thu, 7 Apr 2011 18:51:54 +0000 (18:51 +0000)]
Fronted/CC_LOG_DIAGNOSTICS: Output main file name, and add support for
outputting dwarf-debug-flags.

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

13 years agoFronted/CC_LOG_DIAGNOSTICS: Tweak output form to be plist chunks, and don't
Daniel Dunbar [Thu, 7 Apr 2011 18:44:15 +0000 (18:44 +0000)]
Fronted/CC_LOG_DIAGNOSTICS: Tweak output form to be plist chunks, and don't
output missing data.

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

13 years agoFrontend: Continue flushing out LogDiagnosticPrinter.
Daniel Dunbar [Thu, 7 Apr 2011 18:37:34 +0000 (18:37 +0000)]
Frontend: Continue flushing out LogDiagnosticPrinter.

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

13 years agoFrontend: Sketch a LogDiagnosticPrinter object, and wire CC_LOG_DIAGNOSTICS to
Daniel Dunbar [Thu, 7 Apr 2011 18:31:10 +0000 (18:31 +0000)]
Frontend: Sketch a LogDiagnosticPrinter object, and wire CC_LOG_DIAGNOSTICS to
it.

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

13 years agoChainedDiagnosticClient: Fix a bug where chained diagnostic clients wouldn't
Daniel Dunbar [Thu, 7 Apr 2011 18:24:12 +0000 (18:24 +0000)]
ChainedDiagnosticClient: Fix a bug where chained diagnostic clients wouldn't
accurately track warning/error counts.

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

13 years agoFrontend: Sketch support for -diagnostic-log-file, which still doesn't do anything.
Daniel Dunbar [Thu, 7 Apr 2011 18:11:14 +0000 (18:11 +0000)]
Frontend: Sketch support for -diagnostic-log-file, which still doesn't do anything.

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

13 years agoEnhance the Rewriter.
Argyrios Kyrtzidis [Thu, 7 Apr 2011 18:10:12 +0000 (18:10 +0000)]
Enhance the Rewriter.

-Allow removing a line completely if it ends up empty
-Provide more control on what should be removed.

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

13 years agoAdd FullSourceLoc::BeforeThanCompare. a comparison function class, useful for sorting...
Argyrios Kyrtzidis [Thu, 7 Apr 2011 18:10:07 +0000 (18:10 +0000)]
Add FullSourceLoc::BeforeThanCompare. a comparison function class, useful for sorting FullSourceLocs.

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

13 years agoDriver: Sketch driver support for a CC_LOG_DIAGNOSTICS options, similar to the
Daniel Dunbar [Thu, 7 Apr 2011 18:01:20 +0000 (18:01 +0000)]
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.

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

13 years ago[Reapply r128776, modified so that it does not break debug info.]
Ken Dyck [Thu, 7 Apr 2011 12:37:09 +0000 (12:37 +0000)]
[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.

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

13 years agoIn C++ the argument of logical not should always be bool. Added missing implicit...
Abramo Bagnara [Thu, 7 Apr 2011 09:26:19 +0000 (09:26 +0000)]
In C++ the argument of logical not should always be bool. Added missing implicit cast for scalars.

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

13 years agoBasic, untested implementation for an "unknown any" type requested by LLDB.
John McCall [Thu, 7 Apr 2011 08:22:57 +0000 (08:22 +0000)]
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.

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

13 years ago[Reapply r128773. This is not the source of the issues Devang was seeing
Ken Dyck [Thu, 7 Apr 2011 01:22:42 +0000 (01:22 +0000)]
[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.

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

13 years ago[Reapply r128771. It wasn't the source of the issues Devang saw with debug
Ken Dyck [Thu, 7 Apr 2011 00:59:42 +0000 (00:59 +0000)]
[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.

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

13 years agoReapply r128770. It's not the cause of the issues Devang saw with debug info.
Ken Dyck [Thu, 7 Apr 2011 00:55:01 +0000 (00:55 +0000)]
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.

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

13 years agoI can't figure out any reasonable way to make this test non-host-dependent,
John McCall [Wed, 6 Apr 2011 20:46:42 +0000 (20:46 +0000)]
I can't figure out any reasonable way to make this test non-host-dependent,
so I'm killing it.

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

13 years agoWide Pascal strings should be of type wchar_t[] and not unsigned char[].
Anders Carlsson [Wed, 6 Apr 2011 18:42:48 +0000 (18:42 +0000)]
Wide Pascal strings should be of type wchar_t[] and not unsigned char[].

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

13 years agoFix lookup for class messages sent to qualified-class
Fariborz Jahanian [Wed, 6 Apr 2011 18:40:08 +0000 (18:40 +0000)]
Fix lookup for class messages sent to qualified-class
types such that protocols are seached first. Fixes
// rdar://9224670

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

13 years agoAdd support for Fedora16, gcc 4.6.0 and Fedora Rawhide.
Eric Christopher [Wed, 6 Apr 2011 18:22:53 +0000 (18:22 +0000)]
Add support for Fedora16, gcc 4.6.0 and Fedora Rawhide.

Patch by Bobby Powers

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

13 years agoAdded link to LLVM cmake page in Visual Studio section.
John Thompson [Wed, 6 Apr 2011 18:22:12 +0000 (18:22 +0000)]
Added link to LLVM cmake page in Visual Studio section.

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

13 years agoRefine rules for atomic property api to
Fariborz Jahanian [Wed, 6 Apr 2011 16:05:26 +0000 (16:05 +0000)]
Refine rules for atomic property api to
pass a previously failing clang test.
// rdar://8808439

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

13 years agoDo not use IR marker for LLVM intrinsics
Peter Collingbourne [Wed, 6 Apr 2011 12:29:09 +0000 (12:29 +0000)]
Do not use IR marker for LLVM intrinsics

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

13 years agoIf this is an intrinsic function, set the function's attributes to the intrinsic...
Peter Collingbourne [Wed, 6 Apr 2011 12:29:04 +0000 (12:29 +0000)]
If this is an intrinsic function, set the function's attributes to the intrinsic's attributes.

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

13 years agoWhen updating the retain summary based on {cf,ns}_consumed attributes,
John McCall [Wed, 6 Apr 2011 09:02:12 +0000 (09:02 +0000)]
When updating the retain summary based on {cf,ns}_consumed attributes,
be sure to consume the argument index that actually had the attribute
rather than always the first.  rdar://problem/9234108

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

13 years agoMake this a -cc1 test with a triple and a target feature.
John McCall [Wed, 6 Apr 2011 06:48:04 +0000 (06:48 +0000)]
Make this a -cc1 test with a triple and a target feature.

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

13 years agoAnonymify this test.
John McCall [Wed, 6 Apr 2011 04:29:52 +0000 (04:29 +0000)]
Anonymify this test.

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

13 years agoImplement the AVX cmp builtins as macros instead of static inlines.
John McCall [Wed, 6 Apr 2011 03:37:51 +0000 (03:37 +0000)]
Implement the AVX cmp builtins as macros instead of static inlines.
Patch by Syoyo Fujita!  Reviewed by Chris Lattner!  Checked in by me!

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

13 years agoDiagnose a missing ')' on what looks like a statement expression.
John McCall [Wed, 6 Apr 2011 02:35:25 +0000 (02:35 +0000)]
Diagnose a missing ')' on what looks like a statement expression.
A situation where we can get an invalid ExprResult without an error.
Fixes PR8394.  Patch by Justin Bogner!

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

13 years agoFix getLocForEndOfToken to not double-count spurious internal characters
John McCall [Wed, 6 Apr 2011 01:50:22 +0000 (01:50 +0000)]
Fix getLocForEndOfToken to not double-count spurious internal characters
within a token, like trigraphs and escaped newlines.
Patch by Marcin Kowalczyk!

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

13 years agoAdd a test case for r128957. It fixed a bug!
Devang Patel [Wed, 6 Apr 2011 00:01:52 +0000 (00:01 +0000)]
Add a test case for r128957. It fixed a bug!

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

13 years agoSimplify.
Devang Patel [Tue, 5 Apr 2011 23:26:36 +0000 (23:26 +0000)]
Simplify.

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

13 years agoFixes a regression caused by my last patch.
Fariborz Jahanian [Tue, 5 Apr 2011 23:01:27 +0000 (23:01 +0000)]
Fixes a regression caused by my last patch.
As a result, I had to remove a c++ version of a clang
test which requires more scrutiny on my part.

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

13 years agoEmit debug info for function template parameters.
Devang Patel [Tue, 5 Apr 2011 22:54:11 +0000 (22:54 +0000)]
Emit debug info for function template parameters.

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

13 years agoAdd ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.
Ted Kremenek [Tue, 5 Apr 2011 22:04:27 +0000 (22:04 +0000)]
Add ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.

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

13 years agoGenerate atomic api for atomic properties (x86 and x86_64
Fariborz Jahanian [Tue, 5 Apr 2011 21:41:23 +0000 (21:41 +0000)]
Generate atomic api for atomic properties (x86 and x86_64
targets) when load/store results in multiple instructions.
// rdar://8808439

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

13 years agoCommit a bit of a hack to fully handle the situation where variables are
Chandler Carruth [Tue, 5 Apr 2011 21:36:30 +0000 (21:36 +0000)]
Commit a bit of a hack to fully handle the situation where variables are
marked explicitly as uninitialized through direct self initialization:

  int x = x;

With r128894 we prevented warnings about this code, and this patch
teaches the analysis engine to continue analyzing subsequent uses of
'x'. This should wrap up PR9624.

There is still an open question of whether we should suppress the
maybe-uninitialized warnings resulting from variables initialized in
this fashion. The definitely-uninitialized uses should always be warned.

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

13 years agoRemove unintentional check-in.
Devang Patel [Tue, 5 Apr 2011 21:05:56 +0000 (21:05 +0000)]
Remove unintentional check-in.

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

13 years agoEnable sse4 and aes for SandyBridge. Leave avx support commented out for now.
Roman Divacky [Tue, 5 Apr 2011 20:32:44 +0000 (20:32 +0000)]
Enable sse4 and aes for SandyBridge. Leave avx support commented out for now.

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

13 years agoFix typo.
Devang Patel [Tue, 5 Apr 2011 20:28:21 +0000 (20:28 +0000)]
Fix typo.

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

13 years agoAdd security syntax checker for strcat() which causes the Static Analyzer to generate...
Lenny Maiorani [Tue, 5 Apr 2011 20:18:46 +0000 (20:18 +0000)]
Add security syntax checker for strcat() which causes the Static Analyzer to generate a warning any time the strcat() function is used with a note suggesting to use a function which provides bounded buffers. CWE-119.

Also, brings the security syntax checker more inline with coding standards.

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

13 years agoUse TemplateParameterList to extract template parameter name.
Devang Patel [Tue, 5 Apr 2011 20:15:06 +0000 (20:15 +0000)]
Use TemplateParameterList to extract template parameter name.

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

13 years agoAdded *hidden* flags -print-options and -print-all-options so
Andrew Trick [Tue, 5 Apr 2011 18:56:55 +0000 (18:56 +0000)]
Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The
current implementation isn't perfect but handles most kinds of
options. This is nice to have when decomposing the stages of
compilation and moving between different drivers. It's also a good
sanity check when comparing results produced by different command line
invocations that are expected to produce the comparable results.

Note: This is not an attempt to prolong the life of cl::Option. On the
contrary, it's a placeholder for a feature that must exist when
cl::Option is replaced by a more appropriate framework. A new
framework needs: a central option registry, dynamic name lookup,
non-global containers of option values (e.g. per-module,
per-function), *and* the ability to print options values and their defaults at
any point during compilation.

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

13 years agowhitespace
Andrew Trick [Tue, 5 Apr 2011 18:49:32 +0000 (18:49 +0000)]
whitespace

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

13 years agoSimplify the tracking of when to issue a fixit hint, making the helper
Chandler Carruth [Tue, 5 Apr 2011 18:27:05 +0000 (18:27 +0000)]
Simplify the tracking of when to issue a fixit hint, making the helper
function more clear and obvious in behavior.

Add some comments documenting the behavior of the primary diagnostic helper.

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

13 years agoSeparate the logic for issuing the initialization fixit hint from the
Chandler Carruth [Tue, 5 Apr 2011 18:18:08 +0000 (18:18 +0000)]
Separate the logic for issuing the initialization fixit hint from the
diagnostic emission. The fixit hint, when suggested, typically has
nothing to do with the nature or form of the reference.

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

13 years agoBegin refactoring the uninitialized warning code that I uglied up. This
Chandler Carruth [Tue, 5 Apr 2011 18:18:05 +0000 (18:18 +0000)]
Begin refactoring the uninitialized warning code that I uglied up. This
extracts a function to handle the emission of the diagnostic separately
from the walking over the set of uninitialized uses.

Also updates the naming used within this extracted function to be a bit
more consistent with the rest of Clang's naming patterns.

The next step will be breaking this apart so that we can go through
different functions rather than tracking so many boolean variables.

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

13 years agoFix spelling.
Michael J. Spencer [Tue, 5 Apr 2011 17:57:51 +0000 (17:57 +0000)]
Fix spelling.

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

13 years agoFix PR9624 by explicitly disabling uninitialized warnings for direct self-init:
Chandler Carruth [Tue, 5 Apr 2011 17:41:31 +0000 (17:41 +0000)]
Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:

  int x = x;

GCC disables its warnings on this construct as a way of indicating that
the programmer intentionally wants the variable to be uninitialized.
Only the warning on the initializer is turned off in this iteration.

This makes the code a lot more ugly, but starts commenting the
surprising behavior here. This is a WIP, I want to refactor it
substantially for clarity, and to determine whether subsequent warnings
should be suppressed or not.

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

13 years agoRefactor.
Devang Patel [Tue, 5 Apr 2011 17:30:54 +0000 (17:30 +0000)]
Refactor.

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

13 years agoFix copy-and-paste bug that I introduced while tidying up the code.
David Chisnall [Tue, 5 Apr 2011 17:15:18 +0000 (17:15 +0000)]
Fix copy-and-paste bug that I introduced while tidying up the code.

Does anyone want to buy me a new brain?

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

13 years agoMake this const, there's probably no harm in it and it silences a bunch
Eric Christopher [Tue, 5 Apr 2011 07:54:42 +0000 (07:54 +0000)]
Make this const, there's probably no harm in it and it silences a bunch
of warnings when passing const arguments into the function.

Fixes PR9426

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

13 years agoCleanup the style of some of this code prior to functional changes.
Chandler Carruth [Tue, 5 Apr 2011 06:48:00 +0000 (06:48 +0000)]
Cleanup the style of some of this code prior to functional changes.
I think this moves the code in the desired direction of the new style
recommendations (and style conventional in Clang), but if anyone prefers
the previous style, or has other suggestions just chime in and I'll
follow up.

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

13 years agoRefactor one helper function to merely forward to another so that there
Chandler Carruth [Tue, 5 Apr 2011 06:47:57 +0000 (06:47 +0000)]
Refactor one helper function to merely forward to another so that there
is a single implementation. No functionality change intended.

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

13 years agodocs/UsersManual.html: Fix some inconsistent HTML elements.
NAKAMURA Takumi [Tue, 5 Apr 2011 04:31:31 +0000 (04:31 +0000)]
docs/UsersManual.html: Fix some inconsistent HTML elements.

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

13 years agodocs/UsersManual.html: "&quot;"ize in a paragraph. A few unpaired quotations might...
NAKAMURA Takumi [Tue, 5 Apr 2011 00:57:02 +0000 (00:57 +0000)]
docs/UsersManual.html: "&quot;"ize in a paragraph. A few unpaired quotations might confuse HTML-aware text edtors.

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

13 years agoSet AAPCS-VFP calling convention accordingly and hard float ABI command handling.
Sandeep Patel [Tue, 5 Apr 2011 00:23:47 +0000 (00:23 +0000)]
Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.

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

13 years agoFilter our experimental checks in scan-build's checker listing.
Ted Kremenek [Tue, 5 Apr 2011 00:21:49 +0000 (00:21 +0000)]
Filter our experimental checks in scan-build's checker listing.

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

13 years agoFix building with gcc.
Argyrios Kyrtzidis [Tue, 5 Apr 2011 00:14:22 +0000 (00:14 +0000)]
Fix building with gcc.

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

13 years agoFix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG...
Ted Kremenek [Mon, 4 Apr 2011 23:29:12 +0000 (23:29 +0000)]
Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

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

13 years agoEliminate conservative check that is covered by isIncompleteType() check.
Devang Patel [Mon, 4 Apr 2011 23:23:39 +0000 (23:23 +0000)]
Eliminate conservative check that is covered by isIncompleteType() check.

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

13 years agoIncomplete type does not have any size.
Devang Patel [Mon, 4 Apr 2011 23:18:38 +0000 (23:18 +0000)]
Incomplete type does not have any size.

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