diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-04-21 22:29:45 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-04-21 22:29:45 +0000 |
| commit | 70cfa66fe30ef12a29f50c705de8caf631c14f0d (patch) | |
| tree | 6a664f3681c594540be2ebc27da36e1c4f74c6ab /clang/lib/Basic | |
| parent | b23edebdd2cf725718c69950fa365a755f24a61e (diff) | |
| download | bcm5719-llvm-70cfa66fe30ef12a29f50c705de8caf631c14f0d.tar.gz bcm5719-llvm-70cfa66fe30ef12a29f50c705de8caf631c14f0d.zip | |
Try to fix bad Twine usage in r206791 with std::string
I'm pretty sure I was referencing destroyed temporaries here. I'm open
to suggestions on how to write this better.
llvm-svn: 206804
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 91148b01567..7d20f045c49 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -3103,7 +3103,9 @@ static void addMinGWDefines(const LangOptions &Opts, MacroBuilder &Builder) { // x64 as well as x86, even though they have no effect. const char *CCs[] = {"cdecl", "stdcall", "fastcall", "thiscall", "pascal"}; for (const char *CC : CCs) { - Twine GCCSpelling = Twine("__attribute__((__") + CC + Twine("__))"); + std::string GCCSpelling = "__attribute__((__"; + GCCSpelling += CC; + GCCSpelling += "__))"; Builder.defineMacro(Twine("_") + CC, GCCSpelling); Builder.defineMacro(Twine("__") + CC, GCCSpelling); } |

