summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Commit a bit of a hack to fully handle the situation where variables areChandler Carruth2011-04-051-4/+16
| | | | | | | | | | | | | | | | 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. llvm-svn: 128932
* Remove unintentional check-in.Devang Patel2011-04-051-3/+0
| | | | llvm-svn: 128928
* Enable sse4 and aes for SandyBridge. Leave avx support commented out for now.Roman Divacky2011-04-051-2/+5
| | | | llvm-svn: 128923
* Fix typo.Devang Patel2011-04-052-1/+5
| | | | llvm-svn: 128921
* Add security syntax checker for strcat() which causes the Static Analyzer to ↵Lenny Maiorani2011-04-051-57/+91
| | | | | | | | 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. llvm-svn: 128916
* Use TemplateParameterList to extract template parameter name.Devang Patel2011-04-051-8/+15
| | | | llvm-svn: 128915
* Added *hidden* flags -print-options and -print-all-options soAndrew Trick2011-04-051-0/+3
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 128911
* whitespaceAndrew Trick2011-04-051-3/+3
| | | | llvm-svn: 128908
* Simplify the tracking of when to issue a fixit hint, making the helperChandler Carruth2011-04-051-13/+18
| | | | | | | | function more clear and obvious in behavior. Add some comments documenting the behavior of the primary diagnostic helper. llvm-svn: 128901
* Separate the logic for issuing the initialization fixit hint from theChandler Carruth2011-04-051-4/+10
| | | | | | | diagnostic emission. The fixit hint, when suggested, typically has nothing to do with the nature or form of the reference. llvm-svn: 128899
* Begin refactoring the uninitialized warning code that I uglied up. ThisChandler Carruth2011-04-051-91/+94
| | | | | | | | | | | | | 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. llvm-svn: 128898
* Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:Chandler Carruth2011-04-051-17/+28
| | | | | | | | | | | | | | | 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. llvm-svn: 128894
* Refactor.Devang Patel2011-04-052-23/+36
| | | | llvm-svn: 128893
* Fix copy-and-paste bug that I introduced while tidying up the code.David Chisnall2011-04-051-1/+1
| | | | | | Does anyone want to buy me a new brain? llvm-svn: 128890
* Cleanup the style of some of this code prior to functional changes.Chandler Carruth2011-04-051-25/+28
| | | | | | | | | 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. llvm-svn: 128878
* Refactor one helper function to merely forward to another so that thereChandler Carruth2011-04-051-7/+6
| | | | | | is a single implementation. No functionality change intended. llvm-svn: 128877
* Set AAPCS-VFP calling convention accordingly and hard float ABI command ↵Sandeep Patel2011-04-052-7/+11
| | | | | | handling. llvm-svn: 128866
* Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with ↵Ted Kremenek2011-04-045-69/+58
| | | | | | | | | | | | | | 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. llvm-svn: 128858
* Eliminate conservative check that is covered by isIncompleteType() check.Devang Patel2011-04-041-5/+0
| | | | llvm-svn: 128857
* Incomplete type does not have any size.Devang Patel2011-04-041-1/+1
| | | | llvm-svn: 128855
* Also update CMakeList.txtArgyrios Kyrtzidis2011-04-041-0/+1
| | | | llvm-svn: 128854
* Add missing file for my previous commit.Argyrios Kyrtzidis2011-04-041-0/+90
| | | | llvm-svn: 128853
* Move Driver::createInvocationFromArgs function to Frontend library to avoid ↵Argyrios Kyrtzidis2011-04-042-71/+1
| | | | | | | | dependency cycle between libFrontend and libDriver. llvm-svn: 128852
* Explain why layout prefers 32 for small types on Thumb.Sandeep Patel2011-04-041-0/+4
| | | | llvm-svn: 128850
* Introduce Driver::createInvocationFromArgs used to create a ↵Argyrios Kyrtzidis2011-04-042-52/+74
| | | | | | CompilerInvocation from command-line args. llvm-svn: 128848
* -Wuninitialized: use "self-init" warning when issue uninitialized values ↵Ted Kremenek2011-04-041-2/+45
| | | | | | warnings from the dataflow analysis that include within the initializer of a variable. llvm-svn: 128843
* Revert r128770, r128771, r128773 and r128776 for now. It breaks debug info.Devang Patel2011-04-045-33/+26
| | | | llvm-svn: 128842
* -Wuninitialized: don't warn about uninitialized variables in unreachable code.Ted Kremenek2011-04-042-4/+17
| | | | llvm-svn: 128840
* -Wuninitialized: don't issue fixit for initializer if a variable declaration ↵Ted Kremenek2011-04-041-0/+4
| | | | | | already has an initializer. llvm-svn: 128838
* When emitting a "too many arguments to function call..." error, also include ↵Ted Kremenek2011-04-041-0/+7
| | | | | | a note with a location for the function prototype. llvm-svn: 128833
* Change ARM data layout strings to match llvm-gcc.Bob Wilson2011-04-041-5/+5
| | | | | | | | | Sandeep Patel noticed that the alignment was wrong for Neon vector types, and this change is partly derived from his patch. For the APCS ABI, however, additional changes were required: the maximum ABI alignment is 32 bits and the preferred alignment for i64 and f64 types should be 64 bits. llvm-svn: 128825
* PR9615: make sure we destroy any temporaries returned by operator->.Eli Friedman2011-04-041-1/+2
| | | | | | | I'm pretty sure this is the right fix, but I would appreciate it if someone else would double-check. llvm-svn: 128806
* Refactoring the security checker a little bit so that each CallExpr check ↵Lenny Maiorani2011-04-031-60/+44
| | | | | | doesn't get called for each CallExpr. Instead it does a switch and only runs the check for the proper identifier. Slight speed improvement (probably significant on very large ASTs), and should make it easier and more clear to add more checks for other CallExpr's later. llvm-svn: 128785
* static analyzer: Add a new ProgramPoint PostCondition to represent the post ↵Ted Kremenek2011-04-031-0/+19
| | | | | | | | position of a branch condition, and a new generateNode method to BranchNodeBuilder using PostCondition ProgramPoint. This method generates a new ExplodedNode but not a new block edge. Patch by Lei Zhang! llvm-svn: 128784
* Fix RegionStore bug when doing a field load whose parent is also a field ↵Ted Kremenek2011-04-031-11/+17
| | | | | | assigned a LazyCompoundValue. Fixes <rdar://problem/9163742> and PR 9522. llvm-svn: 128783
* Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a ↵Nico Weber2011-04-022-2/+2
| | | | | | non-header file. llvm-svn: 128780
* Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() toKen Dyck2011-04-025-15/+19
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128776
* Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. NoKen Dyck2011-04-022-6/+6
| | | | | | change in functionality intended. llvm-svn: 128773
* Use CharUnits for the offset type in the ClassNamesAndOffsets map inKen Dyck2011-04-021-4/+4
| | | | | | dumpLayout(). No change in functionality intended. llvm-svn: 128771
* Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. NoKen Dyck2011-04-021-8/+11
| | | | | | change in functionality intended. llvm-svn: 128770
* Apply a bug-fix patch from Marcin Kowalczyk to the source locations forChandler Carruth2011-04-021-1/+3
| | | | | | | | | | | a couple of operator overloads which form interesting expressions in the AST. I added test cases for both bugs with the c-index-test's token annotation feature. Also, thanks to John McCall for confirming that this is the correct solution. llvm-svn: 128768
* Remove a redundant method. We have a const version.Zhongxing Xu2011-04-021-0/+1
| | | | llvm-svn: 128762
* Teach IdempotentOperationsChecker about paths aborted because ExprEngine ↵Ted Kremenek2011-04-023-9/+19
| | | | | | didn't know how to handle a specific Expr type. llvm-svn: 128761
* static analyzer: Rename 'BlocksAborted' to 'BlocksExhausted' to reflect that ↵Ted Kremenek2011-04-023-3/+3
| | | | | | a given CFGBlock was analyzed too many times. llvm-svn: 128760
* Convert BaseOffset::NonVirtualOffset to CharUnits. No change inKen Dyck2011-04-021-12/+12
| | | | | | functionality intended. llvm-svn: 128756
* Convert offset parameters and return values of VTableComponent methods toKen Dyck2011-04-021-20/+29
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128754
* Convert the offsets in VCallOffsetMap to CharUnits. No change inKen Dyck2011-04-021-8/+9
| | | | | | functionality intended. llvm-svn: 128753
* Convert offset parameters of VTableBuilder::IsOverriderUsed() to CharUnits.Ken Dyck2011-04-021-7/+7
| | | | | | No change in functionality intended. llvm-svn: 128752
* Fixes a rewriter bug rewriting call to a byrefFariborz Jahanian2011-04-011-19/+2
| | | | | | block pointer nested inside a block. // rdar:// 9204669 llvm-svn: 128747
* Driver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.Daniel Dunbar2011-04-011-2/+8
| | | | llvm-svn: 128738
OpenPOWER on IntegriCloud