search for: langopts

Displaying 20 results from an estimated 88 matches for "langopts".

2017 May 11
3
problem (and fix) with -fms-extensions
...1.1.1.4 InitPreprocessor.cpp --- lib/Frontend/InitPreprocessor.cpp 14 Mar 2017 08:07:56 -0000 1.1.1.4 +++ lib/Frontend/InitPreprocessor.cpp 11 May 2017 17:54:41 -0000 @@ -366,6 +366,8 @@ static void InitializeStandardPredefined else Builder.defineMacro("__STDC_HOSTED__"); + if (LangOpts.MicrosoftMode) + Builder.defineMacro("__ms_extensions__", 1); if (!LangOpts.CPlusPlus) { if (LangOpts.C11) Builder.defineMacro("__STDC_VERSION__", "201112L"); -------------- next part -------------- Index: lib/Frontend/InitPreprocessor.cpp ===========...
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"]
...rInvocation.cpp @@ -2437,6 +2437,13 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, if (Arch == llvm::Triple::spir || Arch == llvm::Triple::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() ) // ... //...
2017 May 12
2
problem (and fix) with -fms-extensions
...essor.cpp 14 Mar 2017 08:07:56 -0000 1.1.1.4 > > +++ lib/Frontend/InitPreprocessor.cpp 11 May 2017 17:54:41 -0000 > > @@ -366,6 +366,8 @@ static void InitializeStandardPredefined > > else > > Builder.defineMacro("__STDC_HOSTED__"); > > > > + if (LangOpts.MicrosoftMode) > > + Builder.defineMacro("__ms_extensions__", 1); > > if (!LangOpts.CPlusPlus) { > > if (LangOpts.C11) > > Builder.defineMacro("__STDC_VERSION__", "201112L"); > > Looks fine to me, though you would also have...
2016 Sep 11
3
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"]
On Sep 10, 2016, at 3:33 AM, Steve Canon <scanon at apple.com> wrote: >>> >>> Pretty much. In particular, imagine a user trying to debug an unexpected floating point result caused by conversion of a*b + c into fma(a, b, c). >> >> I think that’s unavoidable, because of the way the optimization levels work. Even fma contraction is on by default (something I’d
2015 Aug 11
2
NSW and ExtLdPromotion()
...motion, I am leaning to say Clang set nsw flag incorrectly, but please let me know if I was wrong. Here is the reduced testcase: long long foo(int *a) { long long c; c = *a * 1405; return c; } Clang emitted the following IR (It is done by EmitMUL() in CGExprScalar.cpp, while CGF.getLangOpts().getSignedOverflowBehavior()=LangOptions::SOB_Undefined and CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)=false): ; Function Attrs: nounwind readonly define i64 @foo(i32* nocapture readonly %a) #0 { entry: %0 = load i32* %a, align 4, !tbaa !1 %mul = mul nsw i32 %0, 1405 %con...
2012 Sep 21
2
[LLVMdev] Clang API parsing of the destructor
I am using the clang API (version 3.1 - trunk 153913) to compile some very simple code as follows class MyClass { ~MyClass() ; }; MyClass::~MyClass() { } int main() { return 0; } My problem is that I get the error message: test.cpp:20:10: error: destructor cannot have a return type MyClass::~MyClass() If someone can point me to the right direction that would be great. It compiles fine if
2012 Jul 10
0
[LLVMdev] Unable to do even basic Clang tutorial
Hi Ashok, $ cd bin/bin $ ./llvm-config --ldflags --libs -L/home/ubuntu/bin/lib   -ldl -lpthread -lLLVMAsmParser -lLLVMTableGen -lLLVMDebugInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInstrumentation -lLLVMInterpreter
2012 Jul 10
2
[LLVMdev] Unable to do even basic Clang tutorial
You will need to link to the LLVM/clang libraries. To get the correct flags, you can run: ./llvm-config --ldflags --libs and use the flags reported. On 7/10/2012 11:35 AM, NY Knicks Fan wrote: > OK. Thanks. I now get the following error (which appears to be a > problem w/ the tutorial itself?): > > $ /home/ubuntu/bin/bin/clang++ -I /home/ubuntu/bin/include/ >
2012 Jul 10
2
[LLVMdev] Unable to do even basic Clang tutorial
You need to link in the libclang* as well. On 7/10/2012 1:22 PM, NY Knicks Fan wrote: > Hi Ashok, > > $ cd bin/bin > $ ./llvm-config --ldflags --libs > -L/home/ubuntu/bin/lib -ldl -lpthread > -lLLVMAsmParser -lLLVMTableGen -lLLVMDebugInfo -lLLVMX86Disassembler > -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter > -lLLVMX86Desc -lLLVMX86Info
2012 Sep 21
0
[LLVMdev] Clang API parsing of the destructor
On Fri, Sep 21, 2012 at 12:22 PM, Kamaljit Lall <klall at factset.com> wrote: > I am using the clang API (version 3.1 - trunk 153913) to compile some > very simple code as follows**** > > class MyClass > { > ~MyClass() ; > > }; > > MyClass::~MyClass() > { > > } > > int main() > { > return 0; > } **** > > My problem is that
2012 Jul 10
0
[LLVMdev] Unable to do even basic Clang tutorial
OK.  Thanks.  I now get the following error (which appears to be a problem w/ the tutorial itself?): $ /home/ubuntu/bin/bin/clang++ -I /home/ubuntu/bin/include/  -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS tutorial1.cpp/tmp/tutorial1-LQ71fW.o: In function `main': tutorial1.cpp:(.text+0x42): undefined reference to `llvm::outs()' tutorial1.cpp:(.text+0x72): undefined reference to
2012 Jul 10
3
[LLVMdev] Unable to do even basic Clang tutorial
Add -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS to your compilation flag. On 7/10/2012 11:23 AM, NY Knicks Fan wrote: > Hi Ashok, > > I created a new Ubuntu 12.04 virtual machine and followed directions > except that I know use your cmake command instead of configure, and I > got the error below. > > Any help is very much appreciated. > > > $
2015 Jun 02
2
[LLVMdev] `Ty && "Trying to add a type that doesn't exist?
Hello, I'm having this error and couldn't find a resolution from online, any help would be greatly appreciated: clang: /export/home/hzhang86/chapel/chapel-llvm36/chapel/third-party/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:839: void llvm::DwarfUnit::addType(llvm::DIE&, llvm::DIType, llvm::dwarf::Attribute): Assertion `Ty && "Trying to add a type that doesn't
2015 May 19
2
[LLVMdev] Module crash when adding CallInst
Hi, I am learning to write LLVM modules. I am using IRBuilder to insert calls to an existing function. The call is to be inserted at a random location in every function in the code. The call does get inserted, however, the module crashes later (after doFinalization()). The crash happens only sometimes, not always. These are the kind of instructions that I see in the generated code. %callins =
2015 Jun 04
2
[LLVMdev] `Ty && "Trying to add a type that doesn't exist?
I think this is https://llvm.org/bugs/show_bug.cgi?id=16846 On Jun 4, 2015 12:04 PM, "Hui Zhang" <wayne.huizhang at gmail.com> wrote: > Is there any clue for this error ? > > Thanks > > On Tue, Jun 2, 2015 at 5:47 PM, Hui Zhang <wayne.huizhang at gmail.com> > wrote: > >> Hello, >> >> I'm having this error and couldn't find a
2015 Jun 04
2
[LLVMdev] `Ty && "Trying to add a type that doesn't exist?
Upgrade clang? I can't reproduce it with trunk. On 4 June 2015 at 14:48, Hui Zhang <wayne.huizhang at gmail.com> wrote: > Yes, I found this link, but what's the solution?? > > On Thu, Jun 4, 2015 at 1:09 PM, Rafael Espíndola > <rafael.espindola at gmail.com> wrote: >> >> I think this is https://llvm.org/bugs/show_bug.cgi?id=16846 >> >> On
2012 Oct 13
0
[LLVMdev] [cfe-dev] OpenMP support in CLANG: A proposal
Hi Eli, Attached zipped file, named, "fopenmp_option_support.tar.gz" contains the first patch, along with relevant *test case*. This patch is to support the option "-fopenmp" option in Clang. Following files are changed in this patch. Please start going through this patch, and let me know comments. Meanwhile, I will prepare next patch.
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
In a pass I’m working on, I’ve done some manipulation of several functions, replacing them with new copies with different types, etc. The LLVM IR passes the verifier, but when I have debug symbols enabled (“-g”), I get the following error when Clang generates the Dwarf info (using a very recent build of LLVM/Clang from Git mirror): > Assertion failed: (TheCU && "Unable to find
2016 Apr 27
2
Assertion in MachineScheduler.cpp
Thanks for the suggestion. I tried your fix. It worked for my particular case, but then I got a following error: clang-3.5: /home/rail/projects/escala_llvm/trunk/llvm-or1k/lib/CodeGen/RegisterPressure.cpp:39: void decreaseSetPressure(std::vector<unsigned int>&, llvm::PSetIterator): Assertion `CurrSetPressure[*PSetI] >= Weight && "register pressure underflow"'
2011 Dec 06
2
[LLVMdev] Assertion `PI && "Expected required passes to be initialized"' failed for AliasAnalysis.
Dear lazydev, I'm writing an instrumentation pass that depends on AliasAnalysis. My getAnalysisUsage() looks as follows: 2453 void ThreadSanitizer::getAnalysisUsage(AnalysisUsage &AU) const { 2454 AU.addRequired<TargetData>(); 2455 AU.addRequired<AliasAnalysis>(); 2456 } and the pass initialization: 2668 char ThreadSanitizer::ID = 0; 2669