Displaying 20 results from an estimated 49 matches for "compilerinvocation".
2010 Aug 14
2
[LLVMdev] clang: compile c code from char array?
...in clang?
Im using code from the interpreter example.
Thanks.
char *cCode; // the char array
// fill array with code goes here...
// Initialize a compiler invocation object from the clang (-cc1) arguments.
const driver::ArgStringList &CCArgs = Cmd->getArguments();
llvm::OwningPtr<CompilerInvocation> CI(new CompilerInvocation);
CompilerInvocation::CreateFromArgs(*CI,
const_cast<const char
**>(CCArgs.data()),
const_cast<const char
**>(CCArgs.data()) +
CCArgs.size(),...
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"]
...when compiling with "-O3" but without any additional optimization-related flags.
Patch relative to upstream code with Git ID b0768e805d1d33d730e5bd44ba578df043dfbc66
------------------------------------------------------------------------------------
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 619ea9c..d02d873 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2437,6 +2437,13 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
if (Arch == llvm::Triple::spi...
2010 Aug 15
2
[LLVMdev] clang: compile c code from char array?
...;> char *cCode; // the char array
>> // fill array with code goes here...
>>
>>
>> // Initialize a compiler invocation object from the clang (-cc1)
>> arguments.
>> const driver::ArgStringList &CCArgs = Cmd->getArguments();
>> llvm::OwningPtr<CompilerInvocation> CI(new CompilerInvocation);
>> CompilerInvocation::CreateFromArgs(*CI,
>> const_cast<const char
>> **>(CCArgs.data()),
>> const_cast<const char
>> **>(CCArgs.data()) +
>>...
2010 Aug 15
0
[LLVMdev] clang: compile c code from char array?
...preter example.
> Thanks.
>
> char *cCode; // the char array
> // fill array with code goes here...
>
>
> // Initialize a compiler invocation object from the clang (-cc1) arguments.
> const driver::ArgStringList &CCArgs = Cmd->getArguments();
> llvm::OwningPtr<CompilerInvocation> CI(new CompilerInvocation);
> CompilerInvocation::CreateFromArgs(*CI,
> const_cast<const char
> **>(CCArgs.data()),
> const_cast<const char
> **>(CCArgs.data()) +
>...
2010 Aug 15
0
[LLVMdev] clang: compile c code from char array?
...ar array
>>> // fill array with code goes here...
>>>
>>>
>>> // Initialize a compiler invocation object from the clang (-cc1)
>>> arguments.
>>> const driver::ArgStringList &CCArgs = Cmd->getArguments();
>>> llvm::OwningPtr<CompilerInvocation> CI(new CompilerInvocation);
>>> CompilerInvocation::CreateFromArgs(*CI,
>>> const_cast<const char
>>> **>(CCArgs.data()),
>>> const_cast<const char
>>> **>(CCArgs.data(...
2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
...Defines the entry point for the console application.
//
#include "stdafx.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/DiagnosticOptions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Su...
2020 Nov 17
2
JIT compiling CUDA source code
...would like to
extend it to allow the user to provide CUDA source code as well, for GPU
programming. But I am having a hard time figuring out how to do it.
To JIT compile C++ code, we do basically as follows:
1. call Driver::BuildCompilation(), which returns a clang Command to execute
2. create a CompilerInvocation using the arguments from the Command
3. create a CompilerInstance around the CompilerInvocation
4. use the CompilerInstance to execute an EmitLLVMOnlyAction
5. retrieve the resulting Module from the action and add it to the JIT
But to compile C++ requires only a single clang command. When you add...
2013 Oct 03
0
[LLVMdev] libclang JIT frontend
...CodeGen/CodeGenAction.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/Executio...
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
2010 Aug 18
0
[LLVMdev] clang: call extern function using JIT
I tried what you said, now I get:
LLVM ERROR: Program used external function 'yipee' which could not be
resolved!
Stack dump:
0. Running pass 'X86 Machine Code Emitter' on function '@main'
did not even get as far as a breakpoint.
Óscar Fuentes wrote:
>
> gafferuk <gafferuk at gmail.com> writes:
>
>> Im confused. The function i wish to call is
2010 Aug 18
2
[LLVMdev] clang: call extern function using JIT
gafferuk <gafferuk at gmail.com> writes:
> Im confused. The function i wish to call is a return type of int.
> Im calling it with int dd = yipee(1);
>
> What's wrong?
Declare the function:
int yipee(int);
int main()
{
int dd = yipee(1);
return 0;
}
If that still crashes, put a breakpoint on `yipee' and see if the
execution gets there, if the argument is
2020 Nov 19
1
JIT compiling CUDA source code
...urce code as well, for GPU
>> programming. But I am having a hard time figuring out how to do it.
>>
>> To JIT compile C++ code, we do basically as follows:
>>
>> 1. call Driver::BuildCompilation(), which returns a clang Command to
>> execute
>> 2. create a CompilerInvocation using the arguments from the Command
>> 3. create a CompilerInstance around the CompilerInvocation
>> 4. use the CompilerInstance to execute an EmitLLVMOnlyAction
>> 5. retrieve the resulting Module from the action and add it to the JIT
>>
>> But to compile C++ require...
2020 Nov 19
0
JIT compiling CUDA source code
...the user to provide CUDA source code as well, for GPU
> programming. But I am having a hard time figuring out how to do it.
>
> To JIT compile C++ code, we do basically as follows:
>
> 1. call Driver::BuildCompilation(), which returns a clang Command to
> execute
> 2. create a CompilerInvocation using the arguments from the Command
> 3. create a CompilerInstance around the CompilerInvocation
> 4. use the CompilerInstance to execute an EmitLLVMOnlyAction
> 5. retrieve the resulting Module from the action and add it to the JIT
>
> But to compile C++ requires only a single clan...
2018 Jan 29
2
Debuggability of -O1 level
...;ve found an old post (November 2016)
http://lists.llvm.org/pipermail/llvm-dev/2016-November/107006.html which
discussed debug information for optimized code. At the end of that
discussion, Adrian broached the interest in making -O1 only enable
optimizations. I see in the code (
*clang/lib/Frontend/CompilerInvocation.cpp*, in function
*getOptimizationLevel*) that *-Og* option is equivalent to *-O1*. Does this
mean any progress on making *-O1* the GCC's *-Og*? If not, would someone
kindly tell me what is holding the debuggability at *-O1* back? Which
optimization passes are removing our debug info at this *-...
2020 Jun 03
2
[cfe-dev] [RFC] Refactor Clang: move frontend/driver/diagnostics code to LLVM
...ver.h and Compilation.h
>> from libClangDriver are responsible to call, pass the correct arguments
>> and execute the driver. TextDiagnosticPrinter.h takes care of printing
>> the driver diagnostics in case of errors.
>>
>> The Flang frontend will use CompilerInstance, CompilerInvocation,
>> FrontendOptions, FrontendActions and Utils from libClangFrontend and
>> libClangFrontendTool. These methods are responsible for translating the
>> command line arguments to frontend Options and later to Actions to be
>> executed by ExecuteCompilerInvocation. The translat...
2012 Sep 21
0
[LLVMdev] Clang API parsing of the destructor
...Ds, 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;
> clang::FileManager fileManager(fileSystemOptions);
>
&...
llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event
2015 Aug 12
3
llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event
On 2015/8/12 12:57, Alexei Starovoitov wrote:
> On Wed, Aug 12, 2015 at 10:34:43AM +0800, Wangnan (F) via llvm-dev wrote:
>> Think about a program like this:
>>
>> struct strA { int a; }
>> struct strB { int b; }
>> int func() {
>> struct strA a;
>> struct strB b;
>>
>> a.a = 1;
>> b.b = 2;
>>
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
2020 Jun 09
4
[RFC] Refactor Clang: move frontend/driver/diagnostics code to LLVM
...ologies if I didn't emphasise this enough - there's a lot of
refactoring that needs to happen before Clang and Flang can share the
driver+infra code. The feedback so far has been helpful in identifying
the bits that will be easier to implement rather than to refactor &
re-use (i.e. CompilerInvocation, CompilerInstance and the frontend
driver overall). If there's more that we could or should re-implement
then we are happy to take that approach. But we also want to minimise
code duplication.
*NEXT STEPS*
Overall, there seems to be an agreement that it would be good to extract
the driver...
2018 Jan 29
0
Debuggability of -O1 level
...39;ve found an old post (November 2016) http://lists.llvm.org/pipermail/llvm-dev/2016-November/107006.html which discussed debug information for optimized code. At the end of that discussion, Adrian broached the interest in making -O1 only enable optimizations. I see in the code (clang/lib/Frontend/CompilerInvocation.cpp, in function getOptimizationLevel) that -Og option is equivalent to -O1. Does this mean any progress on making -O1 the GCC's -Og? If not, would someone kindly tell me what is holding the debuggability at -O1 back? Which optimization passes are removing our debug info at this -O1 level?
Tha...