search for: cplusplus

Displaying 20 results from an estimated 43 matches for "cplusplus".

2019 Sep 13
2
DWARF-5 Supported languages Tags C++03, C++11,C++14
Hello Everyone, I'm working on providing support for New Language Tags, prescribed in DWARF-5. DW_LANG_C_plus_plus_03 DW_LANG_C_plus_plus_11 DW_LANG_C_plus_plus_14 While, C++11 and C++14, is defined and can be emitted by Frontend. "include/clang/Basci/LangStandard.h" CPlusPlus = (1 << 5), CPlusPlus11 = (1 << 6), CPlusPlus14 = (1 << 7), CPlusPlus17 = (1 << 8), CPlusPlus2a = (1 << 9), Currently CLANG emits "DW_LANG_C_plus_plus" which in DWARF suggests ISO C++98, regardless of the -std=... specified in commandline. Also in file &qu...
2017 May 11
3
problem (and fix) with -fms-extensions
I've tried to build something that wanted ms-extensions on OpenBSD. Long story short, didn't work so well, because all system includes lead to <machine/_types.h> #ifndef __cplusplus typedef int __wchar_t; #endif and since ms-extensions includes __char_t as a built-in, this did fail abysmally. It would be simple to fix in OpenBSD, assuming clang did tell us it was using ms-extensions. Would something like this be appropriate ? macro name subject to approv...
2017 May 12
2
problem (and fix) with -fms-extensions
...<llvm-dev at lists.llvm.org> wrote: > > > > I've tried to build something that wanted ms-extensions on OpenBSD. > > Long story short, didn't work so well, because all system includes > > lead to > > > > <machine/_types.h> > > #ifndef __cplusplus > > typedef int __wchar_t; > > #endif > > > > and since ms-extensions includes __char_t as a built-in, this did fail > > abysmally. > > Back in 2014 when we encountered this in FreeBSD, we just renamed our > internal type to ___wchar_t in...
2014 Mar 10
2
[LLVMdev] A bug or a feature?
Hi, I've run Clang Static Analyzer checker alpha.cplusplus.NewDeleteLeaks over LLVM codebase to detect false-positives and at the same time eliminate memory leaks. The majority of leaks were detected in lib/Target/* and lib/MC/*. In all cases the similar trick was detected as a leak (example from lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp) :...
2015 Mar 31
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
...regression test in Transforms/InstCombine/malloc-free-delete.ll against me to directly fix it. The test is, define i1 @foo() { ; CHECK-LABEL: @foo( ; CHECK-NEXT: ret i1 false %m = call i8* @malloc(i32 1) %z = icmp eq i8* %m, null call void @free(i8* %m) ret i1 %z } According to http://www.cplusplus.com/reference/cstdlib/malloc/, malloc may return null if this memory allocation fails. So why we assume malloc() always returns a non-null pointer here? I think we can do such optimization with operator new, because new never returns null. But for all malloc like allocation(malloc, calloc, and new...
2013 Nov 26
2
[LLVMdev] R600/SI build failure on Leopard (Use of C++11)
...= Node->getNumOperands(); i != e; ++i) Ops.push_back(Node->getOperand(i)); Node = (MachineSDNode*)DAG.UpdateNodeOperands(Node, Ops.data(), Ops.size()); That fails with Leopard's libstdc++ STL which does not a data method for std::vector. This method was added in C++11: http://www.cplusplus.com/reference/vector/vector/ Is llvm-3.4 now requiring a C++11 runtime? If not, can we solve this a different way? Thanks, Jeremy commit 84a775d8e3d5a3765e01db4b454f849ed8be99be Author: Christian Konig <christian.koenig at amd.com> Date: Wed Apr 10 08:39:08 2013 +0000 R600/SI: ad...
2012 Sep 21
2
[LLVMdev] Clang API parsing of the destructor
...nosticsEngine *pDiagnosticsEngine = new clang::DiagnosticsEngine(pDiagIDs, pTextDiagnosticPrinter); clang::LangOptions languageOptions; languageOptions.GNUMode = 1; languageOptions.CXXExceptions = 1; languageOptions.RTTI = 1; languageOptions.Bool = 1; languageOptions.CPlusPlus = 1; clang::FileSystemOptions fileSystemOptions; clang::FileManager fileManager(fileSystemOptions); clang::SourceManager sourceManager( *pDiagnosticsEngine, fileManager); clang::TargetOptions targetOptions; targetOptions.Triple = "x86_64-unknown-linux-gnu&qu...
2009 Jul 13
0
[LLVMdev] Clang source question around failing MSVC build
.../ things like '=' and '*='. Sema rejects these in C89 mode because they // are not i-c-e's, so we don't need to distinguish between the two here. // Parse the constant-expression or assignment-expression now (depending // on dialect). if (getLang().CPlusPlus) NumElements = ParseConstantExpression(); else NumElements = ParseAssignmentExpression(); } As far as I can tell this code should not compile because of the following code from Ownership.h: template <ASTDestroyer Destroyer> class ASTOwningResult { …...
2006 May 14
2
Samba VFS issue
Hi, Since Samba-3.0.20 I am unable to compile sa-samba.c vfs module, which I have downloaded from the internet for auditing purpose, prior to this version it was getting compiled cleanly, I am receiving CPLUSPLUS error, Please suggest as what need to be done in order to resolve it. Thanks, Honey -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
2018 May 01
2
Disabling Exception in LLVM
Hi Chris, Thanks for answering, Can u clarify on this comment mentioned in https://github.com/Z3Prover/z3/issues/861 . cplusplus no exception support · Issue #861 · Z3Prover/z3 · GitHub - LLVM's *source code* does not use exceptions for performance reasons and so is compiled by default with -fno-exceptions. When using LLVM's libraries via it's C++ interface it is important to match how LLVM was built...
2017 Aug 14
2
clang-tidy : Modify cert-err60-cpp configuration
We want to modify the aforementioned check so that it does not flag the exceptions that aren't nothrow copy constructible/assignable. This page http://clang.llvm.org/extra/clang-tidy/#using-clang-tidy tells me to dump the configs of all the checks using %clang-tidy -checks=* -dump-config but it does not mention the cert-err60-cpp. How do I modify the configuration of this check so that it
2015 Mar 31
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
...e test is, >> >> define i1 @foo() { >> ; CHECK-LABEL: @foo( >> ; CHECK-NEXT: ret i1 false >> %m = call i8* @malloc(i32 1) >> %z = icmp eq i8* %m, null >> call void @free(i8* %m) >> ret i1 %z >> } >> >> According to http://www.cplusplus.com/reference/cstdlib/malloc/, malloc may >> return null if this memory allocation fails. So why we assume malloc() >> always returns a non-null pointer here? >> >> I think we can do such optimization with operator new, because new never >> returns null. But for all ma...
2013 Nov 26
0
[LLVMdev] R600/SI build failure on Leopard (Use of C++11)
...ds(); i != e; ++i) > Ops.push_back(Node->getOperand(i)); > Node = (MachineSDNode*)DAG.UpdateNodeOperands(Node, Ops.data(), Ops.size()); > > That fails with Leopard's libstdc++ STL which does not a data method for std::vector. This method was added in C++11: > http://www.cplusplus.com/reference/vector/vector/ > > Is llvm-3.4 now requiring a C++11 runtime? If not, can we solve this a different way? > > Thanks, > Jeremy > > > > commit 84a775d8e3d5a3765e01db4b454f849ed8be99be > Author: Christian Konig <christian.koenig at amd.com> > Date:...
2012 Sep 21
0
[LLVMdev] Clang API parsing of the destructor
...; new clang::DiagnosticsEngine(pDiagIDs, pTextDiagnosticPrinter); > > clang::LangOptions languageOptions; > languageOptions.GNUMode = 1; > languageOptions.CXXExceptions = 1; > languageOptions.RTTI = 1; > languageOptions.Bool = 1; > languageOptions.CPlusPlus = 1; > Don't do this, use CompilerInvocation::setLangDefaults. Your problem is probably that ImplicitInt is enabled (but you're likely to have other LangOptions wrong too, and this code may break next time we add one). > clang::FileSystemOptions fileSystemOptions; > clan...
2017 Jun 11
2
Force casting a Value*
On 11 June 2017 at 07:53, David Blaikie <dblaikie at gmail.com> wrote: > Sounds like you're looking for reinterpret_cast: http://en. > cppreference.com/w/cpp/language/reinterpret_cast > I tried cast<ConstInt>(vo), but that failed at run-time. > > On Sun, Jun 11, 2017 at 3:06 AM Dipanjan Das via llvm-dev < > llvm-dev at lists.llvm.org> wrote: >
2018 May 01
0
Disabling Exception in LLVM
...May 1, 2018, at 10:38 AM, Siddharth Shankar Swain <h2015096 at pilani.bits-pilani.ac.in> wrote: > > Hi Chris, > Thanks for answering, Can u clarify on this comment mentioned in https://github.com/Z3Prover/z3/issues/861 <https://github.com/Z3Prover/z3/issues/861> . > > cplusplus no exception support · Issue #861 · Z3Prover/z3 · GitHub > LLVM's source code does not use exceptions for performance reasons and so is compiled by default with -fno-exceptions. When using LLVM's libraries via it's C++ interface it is important to match how LLVM was built (i.e. do no...
2015 Apr 01
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
...@foo( >> >> ; CHECK-NEXT: ret i1 false >> >> %m = call i8* @malloc(i32 1) >> >> %z = icmp eq i8* %m, null >> >> call void @free(i8* %m) >> >> ret i1 %z >> >> } >> >> >> >> According to http://www.cplusplus.com/reference/cstdlib/malloc/, >> malloc may >> >> return null if this memory allocation fails. So why we assume malloc() >> >> always returns a non-null pointer here? >> >> >> >> I think we can do such optimization with operator new, because ne...
2015 Jun 03
3
[LLVMdev] [cfe-dev] RFC: Adding attribute(nonnull) to things in libc++
...t says "array" it means any pointer upon which > address computations and accesses to objects (that would be valid if the > pointer did point to the first element of such an array). Thus, nullptr is > valid if 'n' is zero. > > This was changed in DR2235: > http://cplusplus.github.io/LWG/lwg-defects.html#2235 > The text and discussion of DR2235 sound like they intend to make the > behaviour of assign match that of the constructor that takes the same > arguments. What they actually did was change the constructor to match the > behaviour of assign, and it do...
2013 Nov 11
0
[LLVMdev] [cfe-dev] Goal for 3.5: Library-friendly headers
...rc > #undef INT64_MAX > #undef alloca > > This is not OK to do globally -- even if LLVM doesn't care about the > definition, maybe embedding applications or OS headers do? > > $ find include -iname '*.h' | xargs grep '^#' -- | grep -vE > '^.*:.*(LLVM_|cplusplus|endif|else|include|define )'| grep -vw Support | wc > -l > *57* > > I think it's perfectly realistic to get that number down to 0. > > We can start by putting a check like that in the build system, first to > emit a warning, and ultimately to make violations a bui...
2016 Sep 09
2
defaults for FP contraction [e.g. fused multiply-add]: suggestion and patch to be slightly more aggressive and to make Clang`s optimization settings closer to having the same meaning as when they are given to GCC [at least for "-O3"]
...:spir64) { Res.getDiagnosticOpts().Warnings.push_back("spir-compat"); } + + // If there will ever be e.g. "LangOpts.C", replace "LangOpts.C11 || LangOpts.C99" with "LangOpts.C" on the next line. + if ( (LangOpts.C11 || LangOpts.C99 || LangOpts.CPlusPlus) // ... + /*...*/ && ( CodeGenOptions::FPC_On == Res.getCodeGenOpts().getFPContractMode() ) // ... // just being careful + /*...*/ && (Res.getCodeGenOpts().OptimizationLevel >= 3) ) + LangOpts.DefaultFPContract = 1; + return Success; } diff --git...