summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add an AST node for __leave statements, hook it up.Nico Weber2014-07-079-1/+38
| | | | | | | Codegen is still missing (and I won't work on that), but __leave is now as implemented as __try and friends. llvm-svn: 212425
* Sema: Check that __leave is contained in a __try block.Nico Weber2014-07-063-1/+11
| | | | | | | | | Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema walk the scope chain to find the SEHTry parent on __leave statements. (They are rare enough that it seems better to do the walk instead of giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.) llvm-svn: 212422
* Add parser support for __leave (sema and onward still missing).Nico Weber2014-07-062-0/+20
| | | | llvm-svn: 212421
* Update for llvm api change.Rafael Espindola2014-07-0611-36/+60
| | | | llvm-svn: 212408
* PlistSupport.h: avoid gcc 'defined but not used' warningAlp Toker2014-07-062-4/+2
| | | | llvm-svn: 212396
* Modernize a couple of loopsAlp Toker2014-07-062-10/+4
| | | | llvm-svn: 212394
* Add support for nested blocks in Microsoft inline assemblyEhsan Akhgari2014-07-061-17/+49
| | | | | | This fixes http://llvm.org/PR20204. llvm-svn: 212389
* Use non-intrusive refcounting for TargetOptionsAlp Toker2014-07-064-27/+26
| | | | llvm-svn: 212388
* Use non-intrusive refcounting for LangOptionsAlp Toker2014-07-061-2/+2
| | | | | | | This type is only refcounted in a couple of places so making ownership explicit improves clarity. llvm-svn: 212387
* Constify a read-only parameter and give function a better nameAlp Toker2014-07-063-8/+8
| | | | | | | This makes it clear that TargetInfo doesn't capture the LangOptions object, rather uses it to apply adjustments. llvm-svn: 212386
* writeARCDiagsToPlist(): make sure all diag levels get handledAlp Toker2014-07-061-6/+17
| | | | | | | Handle 'remark' level diagnostics as warnings instead of supplemental notes, and use a covered switch to ensure the mapping is kept up to date. llvm-svn: 212385
* Use PlistSupport in a few more placesAlp Toker2014-07-062-50/+37
| | | | | | Switch over LogDiagnosticPrinter and introduce an integer helper. llvm-svn: 212384
* clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.Nico Weber2014-07-061-1/+1
| | | | llvm-svn: 212383
* Remove leftovers of '-arcmt-modify-in-memory' from r133315Alp Toker2014-07-051-16/+0
| | | | llvm-svn: 212381
* CodeGen: add support for a few MSVC ARM intrinsicsSaleem Abdulrasool2014-07-051-4/+15
| | | | | | | | This adds support for simple MSVC compatibility mode intrinsics. These intrinsics are simple in that they are either directly passed through to the annotated MSBuiltin intrinsic or they mirror existing GCC builtins. llvm-svn: 212378
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-0516-40/+40
| | | | llvm-svn: 212369
* CodeGen: add support for MSBuiltin aliasesSaleem Abdulrasool2014-07-041-1/+7
| | | | | | | | | | | | | | | | | | This completes the infrastructure for the new MSBuiltin aliases in the instruction definitions. These behave similar to the GCCBuiltin in that they can be implicitly constructed without special handling unless needed. With this change it is possible to annotate an LLVM intrinsic in the backend instruction definitions and indicate it as a builtin in the Builtin*.def files in clang via LANGBUILTIN. That will automatically pass through the instruction much as a GCCBuiltin. Note that there is no need for the special handling for ensuring that the compatibility flag is enabled since the filtering on the LANGBUILTIN will automatically prevent the intrinsic from bleeding into non-MS compatible compiler invocations. llvm-svn: 212359
* [Driver][Mips] Support one more MIPS CPU name - octeon.Simon Atanasyan2014-07-042-2/+7
| | | | llvm-svn: 212339
* [Driver][Mips] Support more MIPS CPU names: mips1 - mips5.Simon Atanasyan2014-07-041-0/+5
| | | | llvm-svn: 212338
* Make a small crash preventing change.Fariborz Jahanian2014-07-031-2/+2
| | | | llvm-svn: 212291
* [ARM] Implement ISB memory barrier intrinsicYi Kong2014-07-031-3/+4
| | | | | | | Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions modelling by adding has-side-effects property. llvm-svn: 212277
* Add the __qdbl intrinsic to the arm_acle.h headerRenato Golin2014-07-031-0/+5
| | | | | | Patch by: Moritz Roth llvm-svn: 212264
* Move the calling of emitTargetMD() later.Robert Lytton2014-07-032-6/+15
| | | | | | | | | | | | | | | | Summary: Because a global created by GetOrCreateLLVMGlobal() is not finalised until later viz: extern char a[]; char f(){ return a[5];} char a[10]; Change MangledDeclNames to use a MapVector rather than a DenseMap so that the Metadata is output in order of original declaration, so to make deterministic and improve human readablity. Differential Revision: http://reviews.llvm.org/D4176 llvm-svn: 212263
* refactor for-loop as range-loop before making changes.Robert Lytton2014-07-031-10/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D4176 llvm-svn: 212262
* ARMEB: Fix function result return for composite typesChristian Pirker2014-07-031-0/+4
| | | | | | Reviewed at http://reviews.llvm.org/D4364 llvm-svn: 212261
* [Driver][Mips] Check MIPS CPU name provided to the Clang driver.Simon Atanasyan2014-07-031-1/+10
| | | | llvm-svn: 212260
* MS ABI: Get linkage of RTTI data correctDavid Majnemer2014-07-031-2/+17
| | | | | | | | | | | | | | | | | The Itanium rules are not appropriate for the MS ABI. RTTI data is _never_ imported and thus is never available_externally. It is either internal (if the type's linkage is internal) or linkonce_odr. This also means that classes which inherit from dllimport'd bases force their translation unit to duplicate the entirety of the RTTI data of that base. Interestingly, the complete object locator can never be referenced by translation units which import the class. This fixes PR20106. llvm-svn: 212256
* ARM: rename ARM builtins to use __builtin_arm prefixSaleem Abdulrasool2014-07-031-5/+5
| | | | | | | | | This corrects SVN r212196's naming change to use the proper prefix of `__builtin_arm_` instead of `__builtin_`. Thanks to Yi Kong for pointing out the incorrect naming! llvm-svn: 212253
* Address review feedback for r212238.Nico Weber2014-07-031-2/+1
| | | | | | | Also, forgot to say in the commit message of r212238: Library authors will see a warning about this issue if they build with -Wsystem-headers. llvm-svn: 212243
* Enable clang to continue to parse libstdc++4.6 and stlport after r210091.Nico Weber2014-07-021-2/+53
| | | | | | | | | | r210091 made initialization checking more strict in c++11 mode. LWG2193 is about changing standard libraries to still be valid under these new rules, but older libstdc++ (e.g. libstdc++4.6 in -D_GLIBCXX_DEBUG=1 mode, or stlport) do not implement that yet. So fall back to the C++03 semantics for container classes in system headers below the std namespace. llvm-svn: 212238
* Fix linkage bug that miscompiled variable templates instantiated from ↵Larisse Voufo2014-07-021-0/+64
| | | | | | | | | | | similarly named local types. In essence, this bug ensures that the x<Foo> specialization in function foo() defined as follows differs between two distinct translation units. static int &foo() { struct Foo { }; return x<Foo>; } llvm-svn: 212233
* CodeGen: make target builtins support languagesSaleem Abdulrasool2014-07-023-1/+7
| | | | | | | | | | This extends the target builtin support to allow language specific annotations (i.e. LANGBUILTIN). This is to allow MSVC compatibility whilst retaining the ability to have EABI targets use a __builtin_ prefix. This is merely to allow uniformity in the EABI case where the unprefixed name is provided as an alias in the header. llvm-svn: 212196
* ARCMigrate: simplify diagnostic handlingAlp Toker2014-07-022-14/+4
| | | | | | | | | | | | | Recent enhancements in the diagnostics engine mean that TransformActions::report() no longer needs to duplicate this suppression logic. That's great because the old code was flawed and would have attached notes to the wrong primary diagnostic in non-trivial use. With these changes it becomes safe to use reportNote() freely in the migration tool. llvm-svn: 212191
* [ASan] Print exact source location of global variables in error reports.Alexey Samsonov2014-07-023-10/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the original feature request. Introduce llvm.asan.globals metadata, which Clang (or any other frontend) may use to report extra information about global variables to ASan instrumentation pass in the backend. This metadata replaces llvm.asan.dynamically_initialized_globals that was used to detect init-order bugs. llvm.asan.globals contains the following data for each global: 1) source location (file/line/column info); 2) whether it is dynamically initialized; 3) whether it is blacklisted (shouldn't be instrumented). Source location data is then emitted in the binary and can be picked up by ASan runtime in case it needs to print error report involving some global. For example: 0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40 These source locations are printed even if the binary doesn't have any debug info. This is an ABI-breaking change. ASan initialization is renamed to __asan_init_v4(). Pre-built libraries compiled with older Clang will not work with the fresh runtime. llvm-svn: 212188
* Added standard macro guard. In case __GNUC_VA_LIST was notYaron Keren2014-07-021-0/+2
| | | | | | | | | | | | | | | defined or defined identically before there will not be any change in functionality. MinGW-w64 defines __GNUC_VA_LIST as #define __GNUC_VA_LIST which is different than the definition here, causing a warning without the guard. llvm-svn: 212183
* [Driver][Mips] If ABI name is not provided deduce it from the target tripleSimon Atanasyan2014-07-021-10/+10
| | | | | | not from the CPU name. This approach is closer to the method used by gcc driver. llvm-svn: 212176
* ARM: add support for v8 ldaex/stlex builtins.Tim Northover2014-07-022-20/+58
| | | | | | | | | | | | | | ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing variants of the exclusive operations, in line with the C++11 memory model. This adds support for two new intrinsics to expose them to C & C++ developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in direct analogy with the versions with no implicit barrier. rdar://problem/15885451 llvm-svn: 212175
* Make FunctionDecl::getReturnTypeSourceRange() support non-builtin typesAlp Toker2014-07-022-17/+15
| | | | | | | Also document that the function is a "best-effort" facility to extract source ranges from limited AST type location info. llvm-svn: 212174
* X86: inline all atomic operations up to 128-bits.Tim Northover2014-07-021-3/+1
| | | | | | | | | | The backend *can* cope with all of these now, so Clang should give it the chance. On CPUs without cmpxchg16b (e.g. the original athlon64) LLVM can reform the libcalls. rdar://problem/13496295 llvm-svn: 212173
* Don't accept qualified 'int' main return types in C++ or standard C modeAlp Toker2014-07-021-22/+27
| | | | | | | | | C++ [basic.start.main]p1: "It shall have a return type of type int" ISO C is also clear about this, so only accept 'int' with qualifiers in GNUMode C. llvm-svn: 212171
* [OPENMP, C++11] Improve code of InitVLACaptures function.Alexey Bataev2014-07-021-5/+8
| | | | llvm-svn: 212162
* Prevent Clang from crashing on template code.Richard Trieu2014-07-021-1/+8
| | | | | | | | | | Fixes PR20110, where Clang hits an assertion failure when it expects that the sub-expression of a bit cast to pointer to also be a pointer, but gets a value instead. Differential Revision: http://reviews.llvm.org/D4280 llvm-svn: 212160
* [OPENMP] Fixed error message reporting for nesting of regionsAlexey Bataev2014-07-021-2/+2
| | | | llvm-svn: 212156
* Introduce a FunctionDecl::getReturnTypeSourceRange() utilityAlp Toker2014-07-023-50/+60
| | | | | | | | | | This source range is useful for all kinds of diagnostic QOI and refactoring work, so let's make it more discoverable. This commit also makes use of the new function to enhance various diagnostics relating to return types and resolves an old FIXME. llvm-svn: 212154
* CodeGen: Add some comments describing VFTable CGDavid Majnemer2014-07-011-0/+20
| | | | | | | No functionality change, just some comments to describe what is going on. llvm-svn: 212142
* Driver: Handle /GR- in a compatible way with MSVCDavid Majnemer2014-07-016-20/+15
| | | | | | | | | | | | | | | | | There are slight differences between /GR- and -fno-rtti which made mapping one to the other inappropriate. -fno-rtti disables dynamic_cast, typeid, and does not emit RTTI related information for the v-table. /GR- does not generate complete object locators and thus will not reference them in vftables. However, constructs like dynamic_cast and typeid are permitted. This should bring our implementation of RTTI up to semantic parity with MSVC modulo bugs. llvm-svn: 212138
* Win64: Disable uwtable until we fix .pdata emission in LLVMReid Kleckner2014-07-011-1/+5
| | | | | | | | | LLVM r211399 started emitting .pdata for win64 by default. Unfortunately, it produces invalid object files. I plan to fix that Soon. For now, don't request unwind tables. This fixes the clang-cl self-host on win64. llvm-svn: 212137
* AST: Small simplification in VTableBuilderDavid Majnemer2014-07-011-4/+8
| | | | | | | Stash whether or not we have an RTTI component away instead of recomputing it. llvm-svn: 212127
* MS ABI: Reference MSVC RTTI from the VFTableDavid Majnemer2014-07-017-54/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointer for a class's RTTI data comes right before the VFTable but has no name. To be properly compatible with this, we do the following: * Create a single GlobalVariable which holds the contents of the VFTable _and_ the pointer to the RTTI data. * Create a GlobalAlias, with appropriate linkage/visibility, that points just after the RTTI data pointer. This ensures that the VFTable symbol will always refer to VFTable data. * Create a Comdat with a "Largest" SelectionKind and stick the private GlobalVariable in it. By transitivity, the GlobalAlias will be a member of the Comdat group. Using "Largest" ensures that foreign definitions without an RTTI data pointer will _not_ be chosen in the final linked image. Whether or not we emit RTTI data depends on several things: * The -fno-rtti flag implies that we should never not emit a pointer to RTTI data before the VFTable. * __declspec(dllimport) brings in the VFTable from a remote DLL. Use an available_externally GlobalVariable to provide a local definition of the VFTable. This means that we won't have any available_externally definitions of things like complete object locators. This is acceptable because they are never directly referenced. To my knowledge, this completes the implementation of MSVC RTTI code generation. Further semantic work should be done to properly support /GR-. llvm-svn: 212125
* GCC compatibility: Ignore -finput_charset=UTF-8 argument. It is the default ↵Sylvestre Ledru2014-07-011-0/+8
| | | | | | | | | | | | | | | | in Clang. Currently, we fail with an error. Reviewers: rafael Reviewed By: rafael Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D4347 llvm-svn: 212110
OpenPOWER on IntegriCloud